Commit 5665ed04 by 赵增煜

增加筛选

parent da3620d9
...@@ -143,7 +143,8 @@ protected function form() ...@@ -143,7 +143,8 @@ protected function form()
}); });
$form->saving(function (Form $form) { $form->saving(function (Form $form) {
$status = $form->status; $status = $form->status;
$pharmacistNum = PharmacistModel::where('status', 1)->count(); $pharmacyId = $form->getKey();
$pharmacistNum = PharmacistModel::where('status', 1)->where('pharmacy_id', $pharmacyId)->count();
if ($status == 1 && $pharmacistNum <= 0) { if ($status == 1 && $pharmacistNum <= 0) {
return $form->response()->error('开启失败,至少添加并且启用一个药师才可以开启药店~'); return $form->response()->error('开启失败,至少添加并且启用一个药师才可以开启药店~');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment