|
@@ -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('餐桌不存在');
|
|
|
}
|