Commit 59a9ef05 by 赵增煜

开方增加日志

parent b2e72082
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
use Carbon\Carbon; use Carbon\Carbon;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
// 问诊人控制器 // 问诊人控制器
class PrescriptionController extends BaseApiController class PrescriptionController extends BaseApiController
{ {
...@@ -98,6 +98,7 @@ public function detail(Request $request) ...@@ -98,6 +98,7 @@ public function detail(Request $request)
public function create(Request $request) public function create(Request $request)
{ {
$authInfo = auth('api')->user(); $authInfo = auth('api')->user();
Log::info("开方请求参数:" . json_encode($request->all()));
$pharmacy_id = $request->input('pharmacy_id', 0); $pharmacy_id = $request->input('pharmacy_id', 0);
$patient_id = $request->input('patient_id'); $patient_id = $request->input('patient_id');
$diagnosis_id = $request->input('diagnosis_id'); $diagnosis_id = $request->input('diagnosis_id');
...@@ -209,7 +210,8 @@ public function create(Request $request) ...@@ -209,7 +210,8 @@ public function create(Request $request)
} else { } else {
$randomDoctor = DoctorModel::inRandomOrder()->where('status', DoctorModel::STATUS_TRUE)->first(); $randomDoctor = DoctorModel::inRandomOrder()->where('status', DoctorModel::STATUS_TRUE)->first();
} }
# 记录开方医师信息
Log::info("医师:" . json_encode($randomDoctor));
$prescription->doctor_id = $randomDoctor->id; $prescription->doctor_id = $randomDoctor->id;
$prescription->doctor_name = $randomDoctor->name; $prescription->doctor_name = $randomDoctor->name;
$prescription->doctor_online_hospital_name = $randomDoctor->online_hospital_name; $prescription->doctor_online_hospital_name = $randomDoctor->online_hospital_name;
...@@ -230,6 +232,7 @@ public function create(Request $request) ...@@ -230,6 +232,7 @@ public function create(Request $request)
}) })
->inRandomOrder() ->inRandomOrder()
->first(); ->first();
Log::info("药师:" . json_encode($pharmacist));
$prescription->pharmacist_id = $pharmacist->id; $prescription->pharmacist_id = $pharmacist->id;
$prescription->pharmacist_name = $pharmacist->name; $prescription->pharmacist_name = $pharmacist->name;
$prescription->pharmacist_license_number = $pharmacist->license_number; $prescription->pharmacist_license_number = $pharmacist->license_number;
......
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