|
@@ -31,8 +31,6 @@ class DocterController extends AuthController
|
|
'latitude' => 'numeric',
|
|
'latitude' => 'numeric',
|
|
'longitude' => 'numeric',
|
|
'longitude' => 'numeric',
|
|
'sort_type' => 'in:0,1,2,3',
|
|
'sort_type' => 'in:0,1,2,3',
|
|
- 'schedule_date' => 'required_if:list_type,3|date',
|
|
|
|
- 'time_period_id' => 'required_if:list_type,3|integer',
|
|
|
|
'is_pack_docter' => 'in:0,1',
|
|
'is_pack_docter' => 'in:0,1',
|
|
]);
|
|
]);
|
|
$user = $this->user;
|
|
$user = $this->user;
|
|
@@ -79,8 +77,6 @@ class DocterController extends AuthController
|
|
}
|
|
}
|
|
|
|
|
|
if ($list_type == 3) {
|
|
if ($list_type == 3) {
|
|
- $docterIds2 = SchedulePeriod::where('time_period_id', $req['time_period_id'])->where('schedule_date', $req['schedule_date'])->pluck('docter_id')->toArray();
|
|
|
|
- $builder->whereIn('id', $docterIds2);
|
|
|
|
//查询我关注的医生
|
|
//查询我关注的医生
|
|
$docterIds3 = Collection::where('user_id', $user['id'])->where('docter_id', '>', 0)->pluck('docter_id')->toArray();
|
|
$docterIds3 = Collection::where('user_id', $user['id'])->where('docter_id', '>', 0)->pluck('docter_id')->toArray();
|
|
$builder->whereNotIn('id', $docterIds3);
|
|
$builder->whereNotIn('id', $docterIds3);
|
|
@@ -123,7 +119,7 @@ class DocterController extends AuthController
|
|
//组合我关注的医生,放在最前面
|
|
//组合我关注的医生,放在最前面
|
|
$page = empty($req['page']) ? 1 : $req['page'];
|
|
$page = empty($req['page']) ? 1 : $req['page'];
|
|
if ($list_type == 3 && $page == 1) {
|
|
if ($list_type == 3 && $page == 1) {
|
|
- $builder2 = Docter::with('office', 'qualification')->select(['id', 'type', 'name', 'phone', 'sex', 'birthday', 'avatar', 'status', 'label', 'sign', 'intro', 'office_id', 'qualification_id', 'score', 'service_persons', 'eva_num', 'service_days', 'phone_minutes', 'chat_price', 'phone_price', 'appoint_price', 'is_chat', 'is_phone', 'is_appoint', 'latitude', 'longitude', DB::raw($distance_field)])->whereIn('id', $docterIds3)->whereIn('id', $docterIds2)->where('status', 1)->where('is_then', 1)->where('phone', '<>', '')->where('is_appoint', 1);
|
|
|
|
|
|
+ $builder2 = Docter::with('office', 'qualification')->select(['id', 'type', 'name', 'phone', 'sex', 'birthday', 'avatar', 'status', 'label', 'sign', 'intro', 'office_id', 'qualification_id', 'score', 'service_persons', 'eva_num', 'service_days', 'phone_minutes', 'chat_price', 'phone_price', 'appoint_price', 'is_chat', 'is_phone', 'is_appoint', 'latitude', 'longitude', DB::raw($distance_field)])->whereIn('id', $docterIds3)->where('status', 1)->where('is_then', 1)->where('phone', '<>', '')->where('is_appoint', 1);
|
|
if (!empty($req['name'])) {
|
|
if (!empty($req['name'])) {
|
|
$builder2->where(function ($query) use($name, $orgDocterIds) {
|
|
$builder2->where(function ($query) use($name, $orgDocterIds) {
|
|
$query->where('name', 'like', '%'.$name.'%')->orWhereIn('id', $orgDocterIds);
|
|
$query->where('name', 'like', '%'.$name.'%')->orWhereIn('id', $orgDocterIds);
|
|
@@ -162,8 +158,6 @@ class DocterController extends AuthController
|
|
$this->validate(request(), [
|
|
$this->validate(request(), [
|
|
'docter_id' => 'required|integer',
|
|
'docter_id' => 'required|integer',
|
|
'list_type' => 'in:0,1,2,3',
|
|
'list_type' => 'in:0,1,2,3',
|
|
- 'schedule_date' => 'required_if:list_type,3|date',
|
|
|
|
- 'time_period_id' => 'required_if:list_type,3|integer',
|
|
|
|
'latitude' => 'numeric',
|
|
'latitude' => 'numeric',
|
|
'longitude' => 'numeric',
|
|
'longitude' => 'numeric',
|
|
]);
|
|
]);
|
|
@@ -175,7 +169,7 @@ class DocterController extends AuthController
|
|
|
|
|
|
$data['organization'] = null;
|
|
$data['organization'] = null;
|
|
if (!empty($req['list_type']) && $req['list_type'] == 3) {
|
|
if (!empty($req['list_type']) && $req['list_type'] == 3) {
|
|
- $schedulePeriod = SchedulePeriod::with('organization')->select(['organization_id'])->where('docter_id', $req['docter_id'])->where('time_period_id', $req['time_period_id'])->where('schedule_date', $req['schedule_date'])->first()->toArray();
|
|
|
|
|
|
+ $schedulePeriod = SchedulePeriod::with('organization')->select(['organization_id'])->where('docter_id', $req['docter_id'])->where('schedule_date', date('Y-m-d'))->first()->toArray();
|
|
$data['organization'] = $schedulePeriod['organization'];
|
|
$data['organization'] = $schedulePeriod['organization'];
|
|
}
|
|
}
|
|
|
|
|