buiild:h5
parent
9edf644afc
commit
074ecf5d31
|
|
@ -48,7 +48,6 @@ class CategoryController extends AdminController
|
||||||
->footerToolbar([])
|
->footerToolbar([])
|
||||||
->headerToolbar([
|
->headerToolbar([
|
||||||
$this->createButton(true, 'lg'),
|
$this->createButton(true, 'lg'),
|
||||||
amis('reload')->align('right'),
|
|
||||||
])
|
])
|
||||||
->filter($this->baseFilter()->actions()->body([
|
->filter($this->baseFilter()->actions()->body([
|
||||||
amisMake()->TextControl()->name('name')->label(__('category.name'))->size('md')->clearable(),
|
amisMake()->TextControl()->name('name')->label(__('category.name'))->size('md')->clearable(),
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ class PatientController extends AdminController
|
||||||
->columnsTogglable(false)
|
->columnsTogglable(false)
|
||||||
->headerToolbar([
|
->headerToolbar([
|
||||||
$this->createButton(),
|
$this->createButton(),
|
||||||
amis('reload')->align('right'),
|
|
||||||
$this->exportAction(),
|
$this->exportAction(),
|
||||||
])
|
])
|
||||||
->filter($this->baseFilter()->actions()->body([
|
->filter($this->baseFilter()->actions()->body([
|
||||||
|
|
@ -214,27 +213,20 @@ class PatientController extends AdminController
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
JS;
|
JS;
|
||||||
$buttons = [
|
return amisMake()->VanillaAction()
|
||||||
amisMake()->VanillaAction()->label(__('admin.export.all'))->onEvent(
|
|
||||||
$event(<<<JS
|
|
||||||
let url = new URL("{$exportPath}", window.location.origin)
|
|
||||||
let param = window.location.href.split('?')[1]
|
|
||||||
if (param) {
|
|
||||||
url = url + '&' + param
|
|
||||||
}
|
|
||||||
{$doAction}
|
|
||||||
JS
|
|
||||||
|
|
||||||
)
|
|
||||||
),
|
|
||||||
];
|
|
||||||
return amisMake()
|
|
||||||
->DropdownButton()
|
|
||||||
->label(__('admin.export.title'))
|
->label(__('admin.export.title'))
|
||||||
->set('icon', 'fa-solid fa-download')
|
->set('icon', 'fa-solid fa-download')
|
||||||
->buttons($buttons)
|
|
||||||
->align('right')
|
->align('right')
|
||||||
->closeOnClick();
|
->onEvent($event(
|
||||||
|
<<<JS
|
||||||
|
let url = new URL("{$exportPath}", window.location.origin)
|
||||||
|
let param = window.location.href.split('?')[1]
|
||||||
|
if (param) {
|
||||||
|
url = url + '&' + param
|
||||||
|
}
|
||||||
|
{$doAction}
|
||||||
|
JS
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function export()
|
protected function export()
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ class PatientRecordController extends AdminController
|
||||||
->columnsTogglable(false)
|
->columnsTogglable(false)
|
||||||
->headerToolbar([
|
->headerToolbar([
|
||||||
$this->createButton(true, 'lg'),
|
$this->createButton(true, 'lg'),
|
||||||
amis('reload')->align('right'),
|
|
||||||
$this->exportAction(),
|
$this->exportAction(),
|
||||||
])
|
])
|
||||||
->filter($this->baseFilter()->actions()->body([
|
->filter($this->baseFilter()->actions()->body([
|
||||||
|
|
@ -212,27 +211,20 @@ class PatientRecordController extends AdminController
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
JS;
|
JS;
|
||||||
$buttons = [
|
return amisMake()->VanillaAction()
|
||||||
amisMake()->VanillaAction()->label(__('admin.export.all'))->onEvent(
|
|
||||||
$event(<<<JS
|
|
||||||
let url = new URL("{$exportPath}", window.location.origin)
|
|
||||||
let param = window.location.href.split('?')[1]
|
|
||||||
if (param) {
|
|
||||||
url = url + '&' + param
|
|
||||||
}
|
|
||||||
{$doAction}
|
|
||||||
JS
|
|
||||||
|
|
||||||
)
|
|
||||||
),
|
|
||||||
];
|
|
||||||
return amisMake()
|
|
||||||
->DropdownButton()
|
|
||||||
->label(__('admin.export.title'))
|
->label(__('admin.export.title'))
|
||||||
->set('icon', 'fa-solid fa-download')
|
->set('icon', 'fa-solid fa-download')
|
||||||
->buttons($buttons)
|
|
||||||
->align('right')
|
->align('right')
|
||||||
->closeOnClick();
|
->onEvent($event(
|
||||||
|
<<<JS
|
||||||
|
let url = new URL("{$exportPath}", window.location.origin)
|
||||||
|
let param = window.location.href.split('?')[1]
|
||||||
|
if (param) {
|
||||||
|
url = url + '&' + param
|
||||||
|
}
|
||||||
|
{$doAction}
|
||||||
|
JS
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function export()
|
protected function export()
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ class TotalIllnessTypeController extends AdminController
|
||||||
$this->exportAction(),
|
$this->exportAction(),
|
||||||
])
|
])
|
||||||
->filter($this->baseFilter()->actions()->body([
|
->filter($this->baseFilter()->actions()->body([
|
||||||
amisMake()->SelectControl()->options($this->getIllness())->name('id')->label(__('total-illness-type.id'))->size('md')->clearable(),
|
amisMake()->SelectControl()->options($this->getIllness())->name('id')->label(__('total-illness-type.id'))->multiple()->size('md')->clearable(),
|
||||||
amisMake()->DateRangeControl()->name('treat_range')->label(__('total-illness-type.treat_at'))->clearable()->size('md'),
|
amisMake()->DateRangeControl()->name('treat_range')->label(__('total-illness-type.treat_at'))->clearable()->size('md'),
|
||||||
// amisMake()->Button()->label(__('admin.reset'))->actionType('clear-and-submit'),
|
// amisMake()->Button()->label(__('admin.reset'))->actionType('clear-and-submit'),
|
||||||
amisMake()->Component()->setType('submit')->label(__('admin.search'))->level('primary'),
|
amisMake()->Component()->setType('submit')->label(__('admin.search'))->level('primary'),
|
||||||
|
|
@ -68,27 +68,20 @@ class TotalIllnessTypeController extends AdminController
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
JS;
|
JS;
|
||||||
$buttons = [
|
return amisMake()->VanillaAction()
|
||||||
amisMake()->VanillaAction()->label(__('admin.export.all'))->onEvent(
|
|
||||||
$event(<<<JS
|
|
||||||
let url = new URL("{$exportPath}", window.location.origin)
|
|
||||||
let param = window.location.href.split('?')[1]
|
|
||||||
if (param) {
|
|
||||||
url = url + '&' + param
|
|
||||||
}
|
|
||||||
{$doAction}
|
|
||||||
JS
|
|
||||||
|
|
||||||
)
|
|
||||||
),
|
|
||||||
];
|
|
||||||
return amisMake()
|
|
||||||
->DropdownButton()
|
|
||||||
->label(__('admin.export.title'))
|
->label(__('admin.export.title'))
|
||||||
->set('icon', 'fa-solid fa-download')
|
->set('icon', 'fa-solid fa-download')
|
||||||
->buttons($buttons)
|
|
||||||
->align('right')
|
->align('right')
|
||||||
->closeOnClick();
|
->onEvent($event(
|
||||||
|
<<<JS
|
||||||
|
let url = new URL("{$exportPath}", window.location.origin)
|
||||||
|
let param = window.location.href.split('?')[1]
|
||||||
|
if (param) {
|
||||||
|
url = url + '&' + param
|
||||||
|
}
|
||||||
|
{$doAction}
|
||||||
|
JS
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function export()
|
protected function export()
|
||||||
|
|
|
||||||
|
|
@ -85,27 +85,20 @@ class TotalPatientController extends AdminController
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
JS;
|
JS;
|
||||||
$buttons = [
|
return amisMake()->VanillaAction()
|
||||||
amisMake()->VanillaAction()->label(__('admin.export.all'))->onEvent(
|
|
||||||
$event(<<<JS
|
|
||||||
let url = new URL("{$exportPath}", window.location.origin)
|
|
||||||
let param = window.location.href.split('?')[1]
|
|
||||||
if (param) {
|
|
||||||
url = url + '&' + param
|
|
||||||
}
|
|
||||||
{$doAction}
|
|
||||||
JS
|
|
||||||
|
|
||||||
)
|
|
||||||
),
|
|
||||||
];
|
|
||||||
return amisMake()
|
|
||||||
->DropdownButton()
|
|
||||||
->label(__('admin.export.title'))
|
->label(__('admin.export.title'))
|
||||||
->set('icon', 'fa-solid fa-download')
|
->set('icon', 'fa-solid fa-download')
|
||||||
->buttons($buttons)
|
|
||||||
->align('right')
|
->align('right')
|
||||||
->closeOnClick();
|
->onEvent($event(
|
||||||
|
<<<JS
|
||||||
|
let url = new URL("{$exportPath}", window.location.origin)
|
||||||
|
let param = window.location.href.split('?')[1]
|
||||||
|
if (param) {
|
||||||
|
url = url + '&' + param
|
||||||
|
}
|
||||||
|
{$doAction}
|
||||||
|
JS
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function export()
|
protected function export()
|
||||||
|
|
|
||||||
|
|
@ -89,27 +89,20 @@ class TotalProfitController extends AdminController
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
JS;
|
JS;
|
||||||
$buttons = [
|
return amisMake()->VanillaAction()
|
||||||
amisMake()->VanillaAction()->label(__('admin.export.all'))->onEvent(
|
|
||||||
$event(<<<JS
|
|
||||||
let url = new URL("{$exportPath}", window.location.origin)
|
|
||||||
let param = window.location.href.split('?')[1]
|
|
||||||
if (param) {
|
|
||||||
url = url + '&' + param
|
|
||||||
}
|
|
||||||
{$doAction}
|
|
||||||
JS
|
|
||||||
|
|
||||||
)
|
|
||||||
),
|
|
||||||
];
|
|
||||||
return amisMake()
|
|
||||||
->DropdownButton()
|
|
||||||
->label(__('admin.export.title'))
|
->label(__('admin.export.title'))
|
||||||
->set('icon', 'fa-solid fa-download')
|
->set('icon', 'fa-solid fa-download')
|
||||||
->buttons($buttons)
|
|
||||||
->align('right')
|
->align('right')
|
||||||
->closeOnClick();
|
->onEvent($event(
|
||||||
|
<<<JS
|
||||||
|
let url = new URL("{$exportPath}", window.location.origin)
|
||||||
|
let param = window.location.href.split('?')[1]
|
||||||
|
if (param) {
|
||||||
|
url = url + '&' + param
|
||||||
|
}
|
||||||
|
{$doAction}
|
||||||
|
JS
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function export()
|
protected function export()
|
||||||
|
|
|
||||||
|
|
@ -93,27 +93,20 @@ class UserController extends AdminController
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
JS;
|
JS;
|
||||||
$buttons = [
|
return amisMake()->VanillaAction()
|
||||||
amisMake()->VanillaAction()->label(__('admin.export.all'))->onEvent(
|
|
||||||
$event(<<<JS
|
|
||||||
let url = new URL("{$exportPath}", window.location.origin)
|
|
||||||
let param = window.location.href.split('?')[1]
|
|
||||||
if (param) {
|
|
||||||
url = url + '&' + param
|
|
||||||
}
|
|
||||||
{$doAction}
|
|
||||||
JS
|
|
||||||
|
|
||||||
)
|
|
||||||
),
|
|
||||||
];
|
|
||||||
return amisMake()
|
|
||||||
->DropdownButton()
|
|
||||||
->label(__('admin.export.title'))
|
->label(__('admin.export.title'))
|
||||||
->set('icon', 'fa-solid fa-download')
|
->set('icon', 'fa-solid fa-download')
|
||||||
->buttons($buttons)
|
|
||||||
->align('right')
|
->align('right')
|
||||||
->closeOnClick();
|
->onEvent($event(
|
||||||
|
<<<JS
|
||||||
|
let url = new URL("{$exportPath}", window.location.origin)
|
||||||
|
let param = window.location.href.split('?')[1]
|
||||||
|
if (param) {
|
||||||
|
url = url + '&' + param
|
||||||
|
}
|
||||||
|
{$doAction}
|
||||||
|
JS
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function export()
|
protected function export()
|
||||||
|
|
|
||||||
|
|
@ -40,10 +40,13 @@ class TotalIllnessTypeService extends BaseService
|
||||||
$item['count'] = $item->illnessTypeRecords->count();
|
$item['count'] = $item->illnessTypeRecords->count();
|
||||||
return $item;
|
return $item;
|
||||||
});
|
});
|
||||||
$allList = (clone $query)->get();
|
$count = PatientRecord::filter([
|
||||||
$count = round($allList->sum(fn ($item) => $item->illnessTypeRecords->count()), 2, PHP_ROUND_HALF_DOWN);;
|
'illness_type_id' => request('id'),
|
||||||
|
'treat_range' => request('treat_range'),
|
||||||
|
])->count();
|
||||||
|
// $allList = (clone $query)->get();
|
||||||
|
// $count = round($allList->sum(fn ($item) => $item->illnessTypeRecords->count()), 2, PHP_ROUND_HALF_DOWN);;
|
||||||
$total = $list->total();
|
$total = $list->total();
|
||||||
$this->sortable($query);
|
|
||||||
|
|
||||||
return compact('items', 'total', 'count');
|
return compact('items', 'total', 'count');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,10 +49,18 @@ class TotalPatientService extends BaseService
|
||||||
$item['records_count'] = $item->records->count();
|
$item['records_count'] = $item->records->count();
|
||||||
return $item;
|
return $item;
|
||||||
});
|
});
|
||||||
$allList = (clone $query)->get();
|
$filter = [
|
||||||
$records_count = round($allList->sum(fn($item) => $item->records->count()), 2, PHP_ROUND_HALF_DOWN);
|
'patient_id' => request('id'),
|
||||||
$origin_price = round($allList->sum(fn($item) => $item->records->sum('origin_price')), 2, PHP_ROUND_HALF_DOWN);
|
'type_id' => request('type_id'),
|
||||||
$sell_price = round($allList->sum(fn($item) => $item->records->sum('sell_price')), 2, PHP_ROUND_HALF_DOWN);
|
'treat_range' => request('treat_range'),
|
||||||
|
];
|
||||||
|
$records_count = PatientRecord::filter($filter)->count();
|
||||||
|
$origin_price = PatientRecord::filter($filter)->sum('origin_price');
|
||||||
|
$sell_price = PatientRecord::filter($filter)->sum('sell_price');
|
||||||
|
// $allList = (clone $query)->get();
|
||||||
|
// $records_count = round($allList->sum(fn($item) => $item->records->count()), 2, PHP_ROUND_HALF_DOWN);
|
||||||
|
// $origin_price = round($allList->sum(fn($item) => $item->records->sum('origin_price')), 2, PHP_ROUND_HALF_DOWN);
|
||||||
|
// $sell_price = round($allList->sum(fn($item) => $item->records->sum('sell_price')), 2, PHP_ROUND_HALF_DOWN);
|
||||||
$total = $list->total();
|
$total = $list->total();
|
||||||
|
|
||||||
return compact('items', 'total', 'sell_price', 'origin_price', 'records_count');
|
return compact('items', 'total', 'sell_price', 'origin_price', 'records_count');
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
namespace App\Admin\Services;
|
namespace App\Admin\Services;
|
||||||
|
|
||||||
use App\Models\AdminUser;
|
use App\Models\AdminUser;
|
||||||
|
use App\Models\PatientRecord;
|
||||||
|
|
||||||
class TotalProfitService extends BaseService
|
class TotalProfitService extends BaseService
|
||||||
{
|
{
|
||||||
|
|
@ -52,12 +53,32 @@ class TotalProfitService extends BaseService
|
||||||
$item['total_money'] = round($item['doctor_money'] + $item['inviter_money'] + $item['saler_money'], 2, PHP_ROUND_HALF_DOWN);
|
$item['total_money'] = round($item['doctor_money'] + $item['inviter_money'] + $item['saler_money'], 2, PHP_ROUND_HALF_DOWN);
|
||||||
return $item;
|
return $item;
|
||||||
});
|
});
|
||||||
$allList = (clone $query)->get();
|
$doctorQuery = PatientRecord::filter([
|
||||||
$records_count = $allList->sum(fn ($item) => $item->doctors->count() + $item->inviters->count() + $item->salers->count());
|
'type_id' => request('type_id'),
|
||||||
$doctor_money = round($allList->sum(fn ($item) => $item->doctors->sum('doctor_money')), 2, PHP_ROUND_HALF_DOWN);
|
'treat_range' => request('treat_range'),
|
||||||
$inviter_money = round($allList->sum(fn ($item) => $item->inviters->sum('inviter_money')), 2, PHP_ROUND_HALF_DOWN);
|
'doctor_id' => request('id')
|
||||||
$saler_money = round($allList->sum(fn ($item) => $item->salers->sum('saler_money')), 2, PHP_ROUND_HALF_DOWN);
|
]);
|
||||||
$total_money = round($allList->sum(fn ($item) => $item->salers->sum('saler_money') + $item->inviters->sum('inviter_money') + $item->doctors->sum('doctor_money')), 2, PHP_ROUND_HALF_DOWN);
|
$inviterQuery = PatientRecord::filter([
|
||||||
|
'type_id' => request('type_id'),
|
||||||
|
'treat_range' => request('treat_range'),
|
||||||
|
'inviter_id' => request('id')
|
||||||
|
]);
|
||||||
|
$salerQuery = PatientRecord::filter([
|
||||||
|
'type_id' => request('type_id'),
|
||||||
|
'treat_range' => request('treat_range'),
|
||||||
|
'saler_id' => request('id')
|
||||||
|
]);
|
||||||
|
$records_count = $doctorQuery->count() + $inviterQuery->count() + $salerQuery->count();
|
||||||
|
$doctor_money = $doctorQuery->sum('doctor_money');
|
||||||
|
$inviter_money = $inviterQuery->sum('inviter_money');
|
||||||
|
$saler_money = $salerQuery->sum('saler_money');
|
||||||
|
$total_money = round($doctor_money + $inviter_money + $saler_money, 2, PHP_ROUND_HALF_DOWN);
|
||||||
|
// $allList = (clone $query)->get();
|
||||||
|
// $records_count = $allList->sum(fn ($item) => $item->doctors->count() + $item->inviters->count() + $item->salers->count());
|
||||||
|
// $doctor_money = round($allList->sum(fn ($item) => $item->doctors->sum('doctor_money')), 2, PHP_ROUND_HALF_DOWN);
|
||||||
|
// $inviter_money = round($allList->sum(fn ($item) => $item->inviters->sum('inviter_money')), 2, PHP_ROUND_HALF_DOWN);
|
||||||
|
// $saler_money = round($allList->sum(fn ($item) => $item->salers->sum('saler_money')), 2, PHP_ROUND_HALF_DOWN);
|
||||||
|
// $total_money = round($allList->sum(fn ($item) => $item->salers->sum('saler_money') + $item->inviters->sum('inviter_money') + $item->doctors->sum('doctor_money')), 2, PHP_ROUND_HALF_DOWN);
|
||||||
$total = $list->total();
|
$total = $list->total();
|
||||||
|
|
||||||
$this->sortable($query);
|
$this->sortable($query);
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ class UserService extends BaseService
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($filter) {
|
if ($filter) {
|
||||||
logger('request', request()->input());
|
|
||||||
$query->filter(request()->input(), $filter);
|
$query->filter(request()->input(), $filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,15 +36,6 @@ class PatientRecordNotify extends Command
|
||||||
->whereNotNull('next_treat_at')
|
->whereNotNull('next_treat_at')
|
||||||
->where('notify_at', '<=', $now->copy()->endOfDay())
|
->where('notify_at', '<=', $now->copy()->endOfDay())
|
||||||
->get();
|
->get();
|
||||||
$app = EasyWeChat::officialAccount();
|
|
||||||
$app->setAccessToken(new \App\Services\WechatOfficialAccessToken(
|
|
||||||
appId: $app->getAccount()->getAppId(),
|
|
||||||
secret: $app->getAccount()->getSecret(),
|
|
||||||
cache: $app->getCache(),
|
|
||||||
httpClient: $app->getHttpClient(),
|
|
||||||
stable: $app->getConfig()->get('use_stable_access_token', false),
|
|
||||||
));
|
|
||||||
$api = $app->getClient();
|
|
||||||
// 微信公众号关联账户
|
// 微信公众号关联账户
|
||||||
$adminUsers = UserSocialite::where('user_type', (new AdminUser)->getMorphClass())
|
$adminUsers = UserSocialite::where('user_type', (new AdminUser)->getMorphClass())
|
||||||
->where('type', SocialiteType::WxOfficial)
|
->where('type', SocialiteType::WxOfficial)
|
||||||
|
|
@ -57,7 +48,7 @@ class PatientRecordNotify extends Command
|
||||||
foreach ($list as $item) {
|
foreach ($list as $item) {
|
||||||
$adminUser = $adminUsers->firstWhere('user_id', $item->notify_user_id);
|
$adminUser = $adminUsers->firstWhere('user_id', $item->notify_user_id);
|
||||||
if ($adminUser) {
|
if ($adminUser) {
|
||||||
$response = $api->postJson('/cgi-bin/message/template/send', [
|
$this->wechatNotify([
|
||||||
'touser' => $adminUser->openid,
|
'touser' => $adminUser->openid,
|
||||||
'template_id' => 'zdkOoIk7bfyzpW9Tuu-pxqh2no-93FCcqstFKLOTfu0',
|
'template_id' => 'zdkOoIk7bfyzpW9Tuu-pxqh2no-93FCcqstFKLOTfu0',
|
||||||
'url' => url('/h5/pages/record/detail?id=' . $item->id),
|
'url' => url('/h5/pages/record/detail?id=' . $item->id),
|
||||||
|
|
@ -73,13 +64,10 @@ class PatientRecordNotify extends Command
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
if ($response->isFailed()) {
|
|
||||||
logger('病历记录: 通知医师, 模板消息发送, 失败', $response->toArray(false));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$user = $users->firstWhere('user_id', $item->user_id);
|
$user = $users->firstWhere('user_id', $item->user_id);
|
||||||
if ($user) {
|
if ($user) {
|
||||||
$response = $api->postJson('/cgi-bin/message/template/send', [
|
$this->wechatNotify([
|
||||||
'touser' => $user->openid,
|
'touser' => $user->openid,
|
||||||
'template_id' => 'zdkOoIk7bfyzpW9Tuu-pxqh2no-93FCcqstFKLOTfu0',
|
'template_id' => 'zdkOoIk7bfyzpW9Tuu-pxqh2no-93FCcqstFKLOTfu0',
|
||||||
'url' => url('/client/pages/record/detail?id=' . $item->id),
|
'url' => url('/client/pages/record/detail?id=' . $item->id),
|
||||||
|
|
@ -95,11 +83,29 @@ class PatientRecordNotify extends Command
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
if ($response->isFailed()) {
|
|
||||||
logger('病历记录: 通知用户, 模板消息发送, 失败', $response->toArray(false));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$item->update(['is_notified' => 1]);
|
$item->update(['is_notified' => 1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function wechatNotify($params)
|
||||||
|
{
|
||||||
|
$debug = config('app.env') == 'local';
|
||||||
|
if ($debug) {
|
||||||
|
return logger('病历记录通知', $params);
|
||||||
|
}
|
||||||
|
$app = EasyWeChat::officialAccount();
|
||||||
|
$app->setAccessToken(new \App\Services\WechatOfficialAccessToken(
|
||||||
|
appId: $app->getAccount()->getAppId(),
|
||||||
|
secret: $app->getAccount()->getSecret(),
|
||||||
|
cache: $app->getCache(),
|
||||||
|
httpClient: $app->getHttpClient(),
|
||||||
|
stable: $app->getConfig()->get('use_stable_access_token', false),
|
||||||
|
));
|
||||||
|
$api = $app->getClient();
|
||||||
|
$response = $api->postJson('/cgi-bin/message/template/send', $params);
|
||||||
|
if ($response->isFailed()) {
|
||||||
|
logger('病历记录: 模板消息发送, 失败', $response->toArray(false));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ class PatientRecordFilter extends ModelFilter
|
||||||
|
|
||||||
public function patient($key)
|
public function patient($key)
|
||||||
{
|
{
|
||||||
$this->where('patient_id', $key);
|
$this->whereIn('patient_id', is_array($key) ? $key : explode(',', $key));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function type($key)
|
public function type($key)
|
||||||
|
|
@ -27,19 +27,19 @@ class PatientRecordFilter extends ModelFilter
|
||||||
|
|
||||||
public function doctor($key)
|
public function doctor($key)
|
||||||
{
|
{
|
||||||
$this->where('doctor_id', $key);
|
$this->whereIn('doctor_id', is_array($key) ? $key : explode(',', $key));
|
||||||
}
|
}
|
||||||
public function inviter($key)
|
public function inviter($key)
|
||||||
{
|
{
|
||||||
$this->where('inviter_id', $key);
|
$this->whereIn('inviter_id', is_array($key) ? $key : explode(',', $key));
|
||||||
}
|
}
|
||||||
public function saler($key)
|
public function saler($key)
|
||||||
{
|
{
|
||||||
$this->where('saler_id', $key);
|
$this->whereIn('saler_id', is_array($key) ? $key : explode(',', $key));
|
||||||
}
|
}
|
||||||
public function illnessType($key)
|
public function illnessType($key)
|
||||||
{
|
{
|
||||||
$this->where('illness_type_id', $key);
|
$this->whereIn('illness_type_id', is_array($key) ? $key : explode(',', $key));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function treatRange($key)
|
public function treatRange($key)
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>宝芝堂</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>宝芝堂</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
||||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel="stylesheet" href="/client/static/index.5841170f.css"/><script defer="defer" src="/client/static/js/chunk-vendors.40c214d6.js"></script><script defer="defer" src="/client/static/js/index.19d8df64.js"></script></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div></body></html>
|
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel="stylesheet" href="/client/static/index.5841170f.css"/><script defer="defer" src="/client/static/js/chunk-vendors.40c214d6.js"></script><script defer="defer" src="/client/static/js/index.a1eadb07.js"></script></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div></body></html>
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1 +0,0 @@
|
||||||
(self["webpackChunkuniapp"]=self["webpackChunkuniapp"]||[]).push([[810],{169:function(t,a,e){var n=e(1402);n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);var i=e(5472).Z;i("523a813e",n,!0,{sourceMap:!1,shadowMode:!1})},6824:function(t,a,e){"use strict";e.r(a),e.d(a,{default:function(){return d}});var n,i={uCellGroup:e(156).Z,uCell:e(7981).Z,uAlbum:e(3093).Z,uButton:e(7344).Z},o=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("v-uni-view",{staticClass:"page"},[e("u-cell-group",{attrs:{border:!1}},[e("u-cell",{attrs:{title:"类别",value:t.info.type?t.info.type.name:""}}),e("u-cell",{attrs:{title:t.type+"时间",value:t._f("date")(t.info.treat_at,"yyyy-MM-dd")}}),e("u-cell",{attrs:{title:t.type+"医师",value:t.info.doctor?t.info.doctor.name:""}}),e("u-cell",{attrs:{title:"病情描述"}},[e("v-uni-view",{attrs:{slot:"value"},slot:"value"},[e("v-uni-text",[t._v(t._s(t.info.illness))])],1)],1),e("u-cell",{attrs:{title:"图片资料"}},[e("v-uni-view",{attrs:{slot:"value"},slot:"value"},[e("u-album",{attrs:{urls:t.info.images}})],1)],1)],1),e("v-uni-view",{staticClass:"btn"},[e("u-button",{attrs:{text:"病历记录",type:"success"},on:{click:function(a){arguments[0]=a=t.$handleEvent(a),t.record.apply(void 0,arguments)}}})],1)],1)},u=[],l={data:function(){return{id:"",info:{images:[],doctor_id:"",doctor:{}},type:""}},onLoad:function(t){this.id=t.id,this.loadData()},onPullDownRefresh:function(){this.loadData()},methods:{loadData:function(){var t=this;this.id&&(uni.showLoading(),this.$ajax.get("/api/client/patient/".concat(this.id)).then((function(a){uni.stopPullDownRefresh(),0==a.status&&(t.info=a.data,t.type=t.info.type?t.info.type.name:"",uni.setNavigationBarTitle({title:t.info.name}))})).catch((function(t){uni.stopPullDownRefresh()})))},record:function(){uni.navigateTo({url:"/pages/record/index?patient=".concat(this.id)})}}},s=l,c=(e(169),e(1503)),r=(0,c.Z)(s,o,u,!1,null,"3c8017d6",null,!1,i,n),d=r.exports},1402:function(t,a,e){"use strict";e.r(a);var n=e(2916),i=e.n(n),o=e(3282),u=e.n(o),l=u()(i());l.push([t.id,".page[data-v-3c8017d6]{padding:20px;background:#fff}.u-cell-group[data-v-3c8017d6]{background:#fff}.btn[data-v-3c8017d6]{padding:0 10px}.btn .u-button[data-v-3c8017d6]{margin-top:20px}.page[data-v-3c8017d6] .u-upload__wrap{justify-content:flex-end}.text-gray[data-v-3c8017d6]{color:gray}",""]),a["default"]=l}}]);
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
(self["webpackChunkuniapp"]=self["webpackChunkuniapp"]||[]).push([[810],{5637:function(t,a,e){var n=e(8515);n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.id,n,""]]),n.locals&&(t.exports=n.locals);var i=e(5472).Z;i("5c9351de",n,!0,{sourceMap:!1,shadowMode:!1})},6704:function(t,a,e){"use strict";e.r(a),e.d(a,{default:function(){return c}});var n,i={uCellGroup:e(156).Z,uCell:e(7981).Z,"u-Text":e(1153).Z,uAlbum:e(3093).Z,uButton:e(7344).Z},o=function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("v-uni-view",{staticClass:"page"},[e("u-cell-group",{attrs:{border:!1}},[e("u-cell",{attrs:{title:"类别",value:t.info.type?t.info.type.name:""}}),e("u-cell",{attrs:{title:"初次"+t.type,value:t._f("date")(t.info.treat_at,"yyyy-MM-dd")}}),e("u-cell",{attrs:{title:"病情描述"}},[e("v-uni-view",{attrs:{slot:"label"},slot:"label"},[e("u--text",{attrs:{text:t.info.illness,type:"info",wordWrap:"anywhere"}})],1)],1),e("u-cell",{attrs:{title:"图片资料"}},[e("v-uni-view",{attrs:{slot:"value"},slot:"value"},[e("u-album",{attrs:{urls:t.info.images}})],1)],1)],1),e("v-uni-view",{staticClass:"btn"},[e("u-button",{attrs:{text:"病历记录",type:"success"},on:{click:function(a){arguments[0]=a=t.$handleEvent(a),t.record.apply(void 0,arguments)}}})],1)],1)},u=[],l={data:function(){return{id:"",info:{images:[],doctor_id:"",doctor:{}},type:""}},onLoad:function(t){this.id=t.id,this.loadData()},onPullDownRefresh:function(){this.loadData()},methods:{loadData:function(){var t=this;this.id&&(uni.showLoading(),this.$ajax.get("/api/client/patient/".concat(this.id)).then((function(a){uni.stopPullDownRefresh(),0==a.status&&(t.info=a.data,t.type=t.info.type?t.info.type.name:"",uni.setNavigationBarTitle({title:t.info.name}))})).catch((function(t){uni.stopPullDownRefresh()})))},record:function(){uni.navigateTo({url:"/pages/record/index?patient=".concat(this.id)})}}},s=l,r=(e(5637),e(1503)),d=(0,r.Z)(s,o,u,!1,null,"67d156ca",null,!1,i,n),c=d.exports},8515:function(t,a,e){"use strict";e.r(a);var n=e(2916),i=e.n(n),o=e(3282),u=e.n(o),l=u()(i());l.push([t.id,".page[data-v-67d156ca]{padding:20px;background:#fff}.u-cell-group[data-v-67d156ca]{background:#fff}.btn[data-v-67d156ca]{padding:0 10px}.btn .u-button[data-v-67d156ca]{margin-top:20px}.page[data-v-67d156ca] .u-upload__wrap{justify-content:flex-end}.text-gray[data-v-67d156ca]{color:gray}",""]),a["default"]=l}}]);
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,2 +1,2 @@
|
||||||
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>宝芝堂</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>宝芝堂</title><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
|
||||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel="stylesheet" href="/h5/static/index.5841170f.css"/><script defer="defer" src="/h5/static/js/chunk-vendors.7eabb1da.js"></script><script defer="defer" src="/h5/static/js/index.7098abf6.js"></script></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div></body></html>
|
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><link rel="stylesheet" href="/h5/static/index.5841170f.css"/><script defer="defer" src="/h5/static/js/chunk-vendors.7eabb1da.js"></script><script defer="defer" src="/h5/static/js/index.a46f5027.js"></script></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div></body></html>
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue