Commit 833433d1 by 赵增煜

医师开方达到上线提示

parent 37f50341
......@@ -209,6 +209,8 @@ public function create(Request $request)
$randomQuery = DoctorModel::query()->where('status', DoctorModel::STATUS_TRUE);
if (count($availableDoctors) > 0) {
$randomQuery->whereIn('id', $availableDoctors);
} else {
return $this->failed('医师开方数超过限制');
}
$randomDoctor = $randomQuery->inRandomOrder()->first();
// $randomDoctor = DoctorModel::whereIn('id', $availableDoctors)
......@@ -220,7 +222,7 @@ public function create(Request $request)
}
if (! $randomDoctor) {
return $this->failed('医师信息不存在');
return $this->failed('暂无可开方医师');
}
// 记录开方医师信息
Log::info('医师:'.json_encode($randomDoctor));
......
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