Commit 3aedb8c6 by 赵增煜

增加日志

parent 8f77d058
...@@ -198,10 +198,12 @@ public function create(Request $request) ...@@ -198,10 +198,12 @@ public function create(Request $request)
->groupBy('doctor_id') ->groupBy('doctor_id')
->pluck('prescription_count', 'doctor_id'); ->pluck('prescription_count', 'doctor_id');
Log::info('医师开方统计:'.json_encode($prescriptionCounts).'<==sql==>'.$prescriptionCounts->toSql());
// 筛选未达到上限的医师 // 筛选未达到上限的医师
$availableDoctors = collect($doctorIds)->filter(function ($doctorId) use ($prescriptionCounts, $prescription_limit) { $availableDoctors = collect($doctorIds)->filter(function ($doctorId) use ($prescriptionCounts, $prescription_limit) {
return $prescriptionCounts->get($doctorId, 0) < $prescription_limit; return $prescriptionCounts->get($doctorId, 0) < $prescription_limit;
})->values()->all(); })->values()->all();
Log::info('有效的医师:'.json_encode($availableDoctors));
// 随机取一个随机医师 // 随机取一个随机医师
$randomQuery = DoctorModel::query()->where('status', DoctorModel::STATUS_TRUE); $randomQuery = DoctorModel::query()->where('status', DoctorModel::STATUS_TRUE);
if (count($availableDoctors) > 0) { if (count($availableDoctors) > 0) {
......
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