添加时要校验用户领取的数量不能大于优惠券发放的限量

This commit is contained in:
evoxwht 2023-03-28 12:08:08 +08:00
parent 8cb9a50b22
commit 1afa4b504d

View File

@ -123,6 +123,12 @@ class StoreCouponIssueServices extends BaseServices
$data['is_permanent'] = 1;
$data['total_count'] = 0;
}
if ($data['is_permanent'] != 1 && $data['receive_limit'] > $data['total_count']) {
throw new AdminException(500031);
}
$data['add_time'] = time();
$res = $this->dao->save($data);
if (($data['product_id'] !== '' || $data['category_id'] !== '') && $res) {