Browse Source

酒店商家控制台

Panda 1 week ago
parent
commit
d932959992
1 changed files with 34 additions and 0 deletions
  1. 34 0
      application/api/controller/shop/ShopHotel.php

+ 34 - 0
application/api/controller/shop/ShopHotel.php

@@ -84,6 +84,40 @@ class ShopHotel extends Api
         return $this->success('success',$list);
     }
 
+    // 订单详情
+    public function bill_detail()
+    {
+        $params = $this->request->param();
+        $user_id = $this->auth->id;
+
+        $model = new HotelModel();
+        $info = $model->getDetail(
+            params: ['user_id' => $user_id],
+            select: ['id','invite_id','user_id','name','image','images','back_rate','address']
+        );
+        if (!$info){
+            return $this->error('未开通门店');
+        }
+
+        // 全部
+        if (empty($params['status'])){
+            $params['status_in'] = [1,2,3];
+            unset($params['status']);
+        }
+
+        $model = new BillModel();
+        $list = $model->getDetail(
+            params: array_merge(['shop_id'=>$info['id'],'table_name'=>'hotel_order'],$params),
+            with: [
+                'hotelorder' => function ($query) {
+                    $query->field('id,hotel_id,room_id,name,phone');
+                }
+            ]
+        );
+
+        return $this->success('success',$list);
+    }
+
     // 交易统计
     public function statistics()
     {