Commit 7a37a5c6 by 赵增煜

fix druglimit

parent 0fd4dde9
......@@ -108,7 +108,8 @@ public function drugLimit(Request $request)
// 判断搜索出来的处方不为空
if ($prescriptions->count() > 0) {
foreach ($prescriptions as $prescription) {
$drugs = json_decode($prescription->drug_info, true); // Parse JSON data
// $drugs = json_decode($prescription->drug_info, true); // Parse JSON data
$drugs = $prescription->drugInfo;
foreach ($drugs as $drug) {
$drugId = $drug['drug_id'];
$drugCounts[$drugId] = ($drugCounts[$drugId] ?? 0) + $drug['num'];
......
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