1
0
Fork 0

哈哈哈

master
panliang 2023-09-25 12:24:33 +08:00
parent be5dc58009
commit 658ef67d14
12 changed files with 21 additions and 7 deletions

View File

@ -90,6 +90,7 @@ class PatientRecordController extends AdminController
// ->body(Components::make()->fuEditorControl()->name('content')->label(__('patient-record.content'))),
->body(amisMake()->TextareaControl()->name('content')->label(__('patient-record.content'))),
amisMake()->ImageControl()->multiple()->receiver(admin_url('upload_image') . '?full-url=1')->name('images')->label(__('patient-record.images')),
amisMake()->SwitchControl()->name('is_notified')->label(__('patient-record.is_notified'))->trueValue(0)->falseValue(1),
amisMake()->DateTimeControl()->name('next_treat_at')->label(__('patient-record.next_treat_at')),
amisMake()->SelectControl()->options($this->getAdminUserOptions())->searchable()->name('notify_user_id')->label(__('patient-record.notify_user_id')),
amisMake()->DateControl()->name('notify_at')->label(__('patient-record.notify_at')),
@ -111,6 +112,10 @@ class PatientRecordController extends AdminController
// Components::make()->fuEditorControl()->name('content')->label(__('patient-record.content'))->static(),
amisMake()->TextareaControl()->name('content')->label(__('patient-record.content'))->static(),
amisMake()->TextControl()->name('images')->label(__('patient.images'))->static()->staticSchema(amisMake()->Images()),
amisMake()->TextControl()->name('is_notified')->label(__('patient-record.is_notified'))->static()->staticSchema(amisMake()->Status()->source([
['icon' => 'fa fa-check', 'color' => '#30bf13'],
['icon' => 'fa fa-close', 'color' => '#cc292e'],
])),
amisMake()->DateTimeControl()->name('next_treat_at')->label(__('patient-record.next_treat_at'))->static(),
amisMake()->TextControl()->name('notify_user.name')->label(__('patient-record.notify_user_id'))->static(),
amisMake()->DateControl()->name('notify_at')->label(__('patient-record.notify_at'))->static(),

View File

@ -6,6 +6,7 @@ use App\ModelFilters\PatientRecordFilter;
use App\Models\PatientRecord;
use Illuminate\Support\Facades\Validator;
use Slowlyo\OwlAdmin\Admin;
use Illuminate\Validation\Rule;
class PatientRecordService extends BaseService
{
@ -67,6 +68,9 @@ class PatientRecordService extends BaseService
'origin_price' => ['required', 'decimal:0,2'],
'sell_price' => ['required', 'decimal:0,2'],
'order_status' => 'required',
'next_treat_at' => [Rule::requiredIf(fn () => request('is_notified') == 0)],
'notify_at' => [Rule::requiredIf(fn () => request('is_notified') == 0)],
'notify_user_id' => [Rule::requiredIf(fn () => request('is_notified') == 0)],
];
$updateRules = [
'origin_price' => 'decimal:0,2',
@ -80,6 +84,9 @@ class PatientRecordService extends BaseService
'origin_price.decimal' => __('patient-record.origin_price') . '保留2位小数',
'sell_price.required' => __('patient-record.sell_price') . '必填',
'sell_price.decimal' => __('patient-record.sell_price') . '必填',
'notify_at.required' => __('patient-record.notify_at') . '必填',
'notify_user_id.required' => __('patient-record.notify_user_id') . '必填',
'next_treat_at.required' => __('patient-record.next_treat_at') . '必填',
]);
if ($validator->fails()) {
return $validator->errors()->first();

View File

@ -30,10 +30,11 @@ class PatientRecordNotify extends Command
public function handle()
{
$now = now();
$list = PatientRecord::with(['patient'])->where('is_notified', 0)
$list = PatientRecord::with(['patient'])
->where('is_notified', 0)
->whereNotNull('notify_user_id')
->whereNotNull('next_treat_at')
->whereBetween('notify_at', [$now->copy()->startOfDay(), $now->copy()->endOfDay()])
->where('notify_at', '<=', $now->copy()->endOfDay())
->get();
$app = EasyWeChat::officialAccount();
$app->setAccessToken(new \App\Services\WechatOfficialAccessToken(

View File

@ -13,7 +13,7 @@ return [
'notify_at' => '通知时间',
'notify_user_id' => '通知人',
'notify_remarks' => '通知备注',
'is_notified' => '是否已经通知',
'is_notified' => '开启通知',
'next_treat_at' => '下次就诊时间',
'creator_id' => '操作人',
'created_at' => '录入时间',

View File

@ -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)'))
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.b9d0d66a.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.45ee760b.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