|
@@ -18,6 +18,7 @@ use App\Models\SchedulePeriod;
|
|
use App\Models\ServicePack;
|
|
use App\Models\ServicePack;
|
|
use App\Models\SystemConfig;
|
|
use App\Models\SystemConfig;
|
|
use App\Models\Team;
|
|
use App\Models\Team;
|
|
|
|
+use App\Models\VaccineAppoint;
|
|
use DB;
|
|
use DB;
|
|
|
|
|
|
class DocterController extends AuthController
|
|
class DocterController extends AuthController
|
|
@@ -240,6 +241,7 @@ class DocterController extends AuthController
|
|
$this->validate(request(), [
|
|
$this->validate(request(), [
|
|
'organization_id' => 'required|integer',
|
|
'organization_id' => 'required|integer',
|
|
'schedule_type' => 'required|integer',
|
|
'schedule_type' => 'required|integer',
|
|
|
|
+ 'vaccine_id' => 'integer',
|
|
'latitude' => 'numeric',
|
|
'latitude' => 'numeric',
|
|
'longitude' => 'numeric',
|
|
'longitude' => 'numeric',
|
|
]);
|
|
]);
|
|
@@ -261,6 +263,23 @@ class DocterController extends AuthController
|
|
$can_appoint_num = $docterSettings['service_num'] - $v1['order_num'];
|
|
$can_appoint_num = $docterSettings['service_num'] - $v1['order_num'];
|
|
$v1['can_appoint_num'] = $can_appoint_num < 0 ? 0 : $can_appoint_num;
|
|
$v1['can_appoint_num'] = $can_appoint_num < 0 ? 0 : $can_appoint_num;
|
|
}
|
|
}
|
|
|
|
+ //疫苗要判断具体时间段可接种
|
|
|
|
+ $v1['can_appoint'] = 1;
|
|
|
|
+ if (!empty($req['vaccine_id'])) {
|
|
|
|
+ $week_appoints = VaccineAppoint::where('vaccine_id', $req['vaccine_id'])->pluck('week_appoint')->toArray();
|
|
|
|
+ if (!empty($week_appoints)) {
|
|
|
|
+ $start_time = strtotime($v1['schedule_date'].' '.$v1['time_period']['start_time_period'].':00');
|
|
|
|
+ $week = date('N', $start_time);
|
|
|
|
+ $period = (int)date('Hi', $start_time);
|
|
|
|
+ $appoint = '1'.$week;
|
|
|
|
+ if ($period >= 1200) {
|
|
|
|
+ $appoint = '2'.$week;
|
|
|
|
+ }
|
|
|
|
+ if (!in_array($appoint, $week_appoints)) {
|
|
|
|
+ $v1['can_appoint'] = 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
//预约时间已经过了,就不展示了
|
|
//预约时间已经过了,就不展示了
|
|
$schedule_time = strtotime($v1['schedule_date'].' '.$v1['time_period']['end_time_period'].':00');
|
|
$schedule_time = strtotime($v1['schedule_date'].' '.$v1['time_period']['end_time_period'].':00');
|
|
if ($schedule_time < time()) {
|
|
if ($schedule_time < time()) {
|