Explorar o código

完善我的订单

15954078560 %!s(int64=2) %!d(string=hai) anos
pai
achega
11fc4e40e8
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      application/api/controller/User.php

+ 6 - 1
application/api/controller/User.php

@@ -1625,7 +1625,7 @@ class User extends Api
             $this->error('参数错误');
         }
 
-        $list = Db::name('active_order')->where(['user_id' => $this->auth->id])->page($this->page, $this->pagenum)->order('id desc')->select();
+        $list = Db::name('active_order')->where(['user_id' => $this->auth->id, 'status' => $type])->page($this->page, $this->pagenum)->order('id desc')->select();
 
         $active = Db::name('active');
         foreach ($list as &$v) {
@@ -1640,6 +1640,11 @@ class User extends Api
                     $v['button_status'] = 2;
                 }
             }
+            if ($v['active']['maxperson'] <= $v['active']['currentperson']) {
+                $v['is_full'] = 1; //已报满
+            } else {
+                $v['is_full'] = 0; //未报满
+            }
         }
 
         $this->success('我的订单', $list);