Commit 5adbab8c by lujunyi

限购数量错误

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