瀏覽代碼

改成线上和收款码并行

lizhen_gitee 2 年之前
父節點
當前提交
4738c30f98
共有 2 個文件被更改,包括 18 次插入8 次删除
  1. 1 1
      application/api/controller/Active.php
  2. 17 7
      application/api/controller/Order.php

+ 1 - 1
application/api/controller/Active.php

@@ -125,7 +125,7 @@ class Active extends Api
             'order_id'=>$order_id,
             'pay_type'=>$pay_type,
         ];
-        $this->success(1,$rs);
+        $this->success(1,$order_id);
 
     }
 

+ 17 - 7
application/api/controller/Order.php

@@ -23,7 +23,7 @@ class order extends Api
 
         ];
 
-        $whereop = '(pay_type = 1 and status = 1) or (pay_type = 2)';
+        $whereop = '(order.pay_type = 1 and order.status = 1) or (order.pay_type = 2)';
 
         if($active_status == 1){
             $where['active.activestarttime'] = ['gt',time()];
@@ -35,6 +35,10 @@ class order extends Api
         if($active_status == 3){
             $where['active.activeendtime'] = ['lt',time()];
         }
+        if($active_status == 4){
+            $where['order.pay_type'] = 2;
+            $where['order.status'] = 0;
+        }
 
         $list = Db::name('order')->field('order.*,active.activestarttime,active.activeendtime,active.name,active.images')
             ->join('active','order.active_id = active.id','LEFT')
@@ -59,15 +63,18 @@ class order extends Api
                     $status = 3;
                 }
 
-                $item['status_text'] = $status_text;
-                $item['active_status'] = $status;
-
                 //是否能传图
                 $item['can_upload'] = 0;
                 if($item['pay_type'] == 2 && $item['status'] == 0){
                     //收款码支付,待支付的
                     $item['can_upload'] = 1;
+                    //待审核状态
+                    $status_text = '待审核';
+                    $status = 4;
                 }
+
+                $item['status_text'] = $status_text;
+                $item['active_status'] = $status;
             }
         }
 
@@ -99,16 +106,19 @@ class order extends Api
             $status = 3;
         }
 
-        $info['status_text'] = $status_text;
-        $info['active_status'] = $status;
-
         //是否能传图
         $info['can_upload'] = 0;
         if($info['pay_type'] == 2 && $info['status'] == 0){
             //收款码支付,待支付的
             $info['can_upload'] = 1;
+            //待审核状态
+            $status_text = '待审核';
+            $status = 4;
         }
 
+        $info['status_text'] = $status_text;
+        $info['active_status'] = $status;
+
         $this->success(1,$info);
     }