ソースを参照

不确认收货不能提现兑换

lizhen_gitee 1 年間 前
コミット
76ecce6807
1 ファイル変更16 行追加0 行削除
  1. 16 0
      application/api/controller/Money.php

+ 16 - 0
application/api/controller/Money.php

@@ -41,11 +41,27 @@ class Money extends Api
             $this->error('参数错误');
         }
 
+        //检查其他申请
         $check = Db::name('user_withdraw')->where('user_id',$this->auth->id)->where('status',0)->find();
         if($check){
             $this->error('目前还有兑换在审核中,请稍后在兑换');
         }
 
+        //检查是否未确认收货
+        $map2 = [
+            'user_id' => $this->auth->id,
+            'status'  => 1,
+            'have_paid' => ['gt',0],
+            'have_received' => 0,
+        ];
+        $check2 = Db::name('unishop_order')->where($map2)->find();
+        if($check2){
+            if($check2['have_delivered'] == 0){
+                $this->error('您有订单尚未发货,请等待订单完成');
+            }
+            $this->error('您有订单尚未确认收货,请先完成收货');
+        }
+
         //开启事务
         Db::startTrans();