Browse Source

餐厅下单支付

Panda 1 month ago
parent
commit
e53c0ee51a

+ 7 - 5
application/api/controller/HotelCanteen.php

@@ -106,11 +106,13 @@ class HotelCanteen extends Api
             return $this->error('参数缺失');
         }
         $user_id = $this->auth->id;
-        $info = HotelCanteenRoomModel::with([
-            'canteen'=>function ($query) {
-                $query->field(['id','name','image','images','price','original_price']);
-            }
-        ])->where('id',$params['room_id'])->where('status',1)->find();
+        $model = new HotelCanteenRoomModel();
+        $info = $model->getDetail(
+            params: ['id'=>$params['room_id']],
+            with: [
+                'canteen'
+            ]
+        );
         if (!$info) {
             return $this->error('餐桌不存在');
         }

+ 2 - 0
application/common/model/HotelCanteenRoomModel.php

@@ -18,6 +18,8 @@ class HotelCanteenRoomModel extends BaseModel
     protected $createTime = false;
     protected $updateTime = false;
     protected $deleteTime = false;
+    protected int $is_status_search = 1;// 默认使用 status = 1 筛选
+    protected int $is_delete_search = 0;// 默认使用 is_delete = 0 筛选
 
     public function getImageAttr($value, $data)
     {