Commit 9fbf9a04 by lujunyi

数量判断加强

parent ebdce402
......@@ -183,9 +183,9 @@ public function drugLimit(Request $request)
}
$buyedCount = $drugCounts[$drug['drug_id']] ?? 0; // 历史已购买数量
$canBuyCount = $drug['limit_num'] - $buyedCount; // 普通药品剩余可购买数量
if (intval($drug['num']) <= 0) {
return $this->failed('数量不能为0', ['add_status' => false], 200);
}
// if (intval($drug['num']) <= 0) {
// return $this->failed('数量不能为0', ['add_status' => false], 200);
// }
if ($canBuyCount < $drug['num']) {
$errMsg = '药品['.$drugModel->name.']已到达购买限额吧~';
......
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