feat:dish
This commit is contained in:
@@ -37,6 +37,7 @@ class DishService extends BaseService
|
|||||||
$chefId = (int)$this->request->input('query_chef_id',0);
|
$chefId = (int)$this->request->input('query_chef_id',0);
|
||||||
|
|
||||||
$list = $this->DishModel
|
$list = $this->DishModel
|
||||||
|
->leftJoin('cycle','dish.cycle_id','=','cycle.id')
|
||||||
->where('is_del',DishCode::IS_NO_DEL)
|
->where('is_del',DishCode::IS_NO_DEL)
|
||||||
->when($id > 0, function ($query) use ($id) {
|
->when($id > 0, function ($query) use ($id) {
|
||||||
$query->where('id', $id);
|
$query->where('id', $id);
|
||||||
@@ -56,7 +57,8 @@ class DishService extends BaseService
|
|||||||
->when($chefId, function ($query) use ($chefId) {
|
->when($chefId, function ($query) use ($chefId) {
|
||||||
$query->where('chef_id', $chefId);
|
$query->where('chef_id', $chefId);
|
||||||
})
|
})
|
||||||
->paginate($limit)->toArray();
|
->orderBy('cycle.dates','desc')
|
||||||
|
->paginate($limit,['dish.*','cycle.dates'])->toArray();
|
||||||
|
|
||||||
return $this->return->success('success',$list);
|
return $this->return->success('success',$list);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,8 +119,10 @@ class DishService extends BaseService
|
|||||||
$limit = (int)$this->request->input('limit');
|
$limit = (int)$this->request->input('limit');
|
||||||
$chef_id = $this->userId;
|
$chef_id = $this->userId;
|
||||||
$list = $this->DishModel
|
$list = $this->DishModel
|
||||||
|
->leftJoin('cycle','dish.cycle_id','=','cycle.id')
|
||||||
->where('chef_id', $chef_id)
|
->where('chef_id', $chef_id)
|
||||||
->paginate($limit)->toArray();
|
->orderBy('cycle.dates','desc')
|
||||||
|
->paginate($limit,['dish.*','cycle.dates'])->toArray();
|
||||||
|
|
||||||
return $this->return->success('success',$list);
|
return $this->return->success('success',$list);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user