Explorar el Código

wesmiler 报恩寺项目提交

wesmiler hace 4 años
padre
commit
6ea466b256
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      app/Services/EnshrineService.php

+ 4 - 0
app/Services/EnshrineService.php

@@ -488,6 +488,10 @@ class EnshrineService extends BaseService
         // 扣款奖励处理
         if($goodsInfo->price>0){
 
+            if($memberInfo->coupon < $goodsInfo->price){
+                return message("账户花灯券不足,请先充值", false, [],10003);
+            }
+
             if(!MemberModel::where(['id'=> $userId, 'mark'=> 1])->decrement('coupon', $goodsInfo->price)){
                 \DB::rollBack();
                 return message("更新花灯券账户失败", false);