Browse Source

订单套餐调整

zhangxiaobin 1 year ago
parent
commit
a32d54fb8c
1 changed files with 7 additions and 4 deletions
  1. 7 4
      application/api/controller/Order.php

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

@@ -25,14 +25,16 @@ class Order extends Api
     public function getList(){
         try {
             $status = input('status',0);//状态:1=待支付,2=待处理,3=已完成,4=已取消
-            $where['user_id'] = $this->auth->id;
-            if (!empty($status)) {
-                $where['status'] = $status;
-            }
+
             $o = 'order';
             $st = 'servicetype';
             $field = $o.'.id,orderno,server_info,server_images,status,user_mobile,'.$o.'.user_car_number,'.
                 $o.'.createtime,cancel_time,cancel_reason,pay_fee,appen_fee,finish_time,'.$st.'.title as `service_title`,paytype';
+            $where[$o.'.user_id'] = $this->auth->id;
+            $where[$o.'.company_id'] = $this->auth->company_id;
+            if (!empty($status)) {
+                $where[$o.'.status'] = $status;
+            }
             $result = $this->model->alias($o)->field($field)
                 ->join($st,$st.'.id = '.$o.'.servicetype_id','LEFT')
                 ->where($where)->order($o.'.createtime desc')->autopage()->select();
@@ -73,6 +75,7 @@ class Order extends Api
             $p.'.images as `package_images`,hexiao_time';
 
             $where[$o.'.user_id'] = $this->auth->id;
+            $where[$o.'.company_id'] = $this->auth->company_id;
             $where[$o.'.ordertype'] = 3;//类型:1=预约下单,2=在线下单,3=套餐订单
             $where[$o.'.status'] = ['in',[2,3]];//状态:2=待处理,3=已完成,4=已取消
             if (!empty($status)) {