浏览代码

优惠券查询问题

whitefang 1 年之前
父节点
当前提交
d9a2335510
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      app/api/logic/UserCouponLogic.php

+ 4 - 0
app/api/logic/UserCouponLogic.php

@@ -25,6 +25,10 @@ class UserCouponLogic extends BaseLogic
                 ->whereIn('code',$params['codes'])
                 ->where('voucher_count','>',0)
                 ->select();
+
+            if($rules->isEmpty()){
+                $errMsgArr[] = '优惠券不存在';
+            }
             $updateData = [];
             $createData = [];
             foreach($rules as $v) {