From 4b020e9c8884376c50a32d3a66eea6cd823b47f4 Mon Sep 17 00:00:00 2001 From: lccsw <805383944@qq.com> Date: Thu, 7 Apr 2022 17:36:28 +0800 Subject: [PATCH] edit-api-add_order_limit --- api/controllers/wxapp/licheb/CusorderV2.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/controllers/wxapp/licheb/CusorderV2.php b/api/controllers/wxapp/licheb/CusorderV2.php index 09863d46..2f5e267f 100644 --- a/api/controllers/wxapp/licheb/CusorderV2.php +++ b/api/controllers/wxapp/licheb/CusorderV2.php @@ -100,6 +100,15 @@ class CusorderV2 extends Wxapp{ if(!$cardid || !$owner_name || !$owner_mobile || !$owner_cardid){ throw new Exception('参数错误', ERR_PARAMS_ERROR); } + //同个品牌一个身份证只能下一单 + $where = [ + 'brand_id' => $series_row['brand_id'], + "JSON_EXTRACT(info_json,'$.c_cardid')='{$cardid}'" => null, + 'status>=' => 0 + ]; + if($this->orders_model->count($where)){ + throw new Exception('一个客户只能享受一次国补,请联系管理员', ERR_PARAMS_ERROR); + } } if($deposit<2000){ throw new Exception('定金不得少于2000', ERR_PARAMS_ERROR);