Commit f32612a4 by lujunyi

修改添加店铺逻辑

parent da3620d9
......@@ -128,7 +128,9 @@ protected function form()
$form->timeRange('business_start', 'business_end', '营业时间')->required();
$form->map('lat', 'lng', '经纬度坐标');
// $form->select('user_id')->options(User::all()->pluck('openid', 'id'))->width(6)->help('实际后台操作可以不用关联');
$form->switch('status');
if ($form->isEditing()) {
$form->switch('status');
}
$form->display('created_at');
$form->display('updated_at');
......@@ -143,7 +145,7 @@ protected function form()
});
$form->saving(function (Form $form) {
$status = $form->status;
$pharmacistNum = PharmacistModel::where('status', 1)->count();
$pharmacistNum = PharmacistModel::where('status', PharmacyModel::STATUS_TRUE)->count();
if ($status == 1 && $pharmacistNum <= 0) {
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