Commit d9687f0f by 赵增煜

一日内限购

parent bdc9169d
......@@ -115,12 +115,13 @@ public function drugLimit(Request $request)
$patient_id = $request->input('patient_id');
$pharmacy_id = $request->input('pharmacy_id');
$sevenDaysAgo = Carbon::now()->subDays(7);
# $sevenDaysAgo = Carbon::now()->subDays(7);
$oneDayAgo = Carbon::now()->subDay();
$prescriptions = PrescriptionModel::where('patient_id', $patient_id)
->where('is_voided', PrescriptionModel::IS_VOIDED_FALSE) // 未作废的处方
->where('status', PrescriptionModel::PRESCRIPTION_STATUS_SUCCESS)
->where('pharmacy_id', $pharmacy_id)
->where('created_at', '>=', $sevenDaysAgo)
# ->where('pharmacy_id', $pharmacy_id)
->where('created_at', '>=', $oneDayAgo)
->get();
$drugCounts = [];
......
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