feat: chef
This commit is contained in:
@@ -55,6 +55,7 @@ class ChefService extends BaseService
|
||||
{
|
||||
$limit = (int)$this->request->input('limit', 10);
|
||||
$cityId = (int)$this->request->input('query_city_id');
|
||||
$name = $this->request->input('query_chef_name');
|
||||
|
||||
$list = $this
|
||||
->chefModel
|
||||
@@ -65,6 +66,9 @@ class ChefService extends BaseService
|
||||
->when(!empty($cityId), function ($query) use ($cityId) {
|
||||
$query->where('admin_user.city_id', $cityId);
|
||||
})
|
||||
->when(!empty($name), function ($query) use ($name) {
|
||||
$query->where('admin_user.chinese_name', 'like', "$name%");
|
||||
})
|
||||
->paginate($limit,['chef.id','admin_user.avatar','admin_user.chinese_name','chef.profile','chef.specialties'])->toArray();
|
||||
|
||||
if (empty($list)) return $this->return->success('success',['list' => []]);
|
||||
|
||||
Reference in New Issue
Block a user