feat: chef
This commit is contained in:
@@ -40,7 +40,9 @@ class ChefRequest extends FormRequest
|
|||||||
'query_chef_id'
|
'query_chef_id'
|
||||||
],
|
],
|
||||||
'chef_detail_list' => [
|
'chef_detail_list' => [
|
||||||
|
'limit',
|
||||||
'query_city_id',
|
'query_city_id',
|
||||||
|
'query_chef_name'
|
||||||
],
|
],
|
||||||
'setting_chef' => [
|
'setting_chef' => [
|
||||||
'user_id',
|
'user_id',
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ class ChefService extends BaseService
|
|||||||
{
|
{
|
||||||
$limit = (int)$this->request->input('limit', 10);
|
$limit = (int)$this->request->input('limit', 10);
|
||||||
$cityId = (int)$this->request->input('query_city_id');
|
$cityId = (int)$this->request->input('query_city_id');
|
||||||
|
$name = $this->request->input('query_chef_name');
|
||||||
|
|
||||||
$list = $this
|
$list = $this
|
||||||
->chefModel
|
->chefModel
|
||||||
@@ -65,6 +66,9 @@ class ChefService extends BaseService
|
|||||||
->when(!empty($cityId), function ($query) use ($cityId) {
|
->when(!empty($cityId), function ($query) use ($cityId) {
|
||||||
$query->where('admin_user.city_id', $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();
|
->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' => []]);
|
if (empty($list)) return $this->return->success('success',['list' => []]);
|
||||||
|
|||||||
Reference in New Issue
Block a user