| xqd
@@ -547,10 +547,9 @@ class ApiController extends Controller
|
|
|
|
|
|
|
|
|
if($type == 1){//门诊
|
|
|
- $today = SchedulePeriod::where(['docter_id'=>$docter_id,'schedule_date'=>$scheduleDate,'organization_id','=',$org_id])->distinct('organization_id')
|
|
|
+ $today = SchedulePeriod::where(['docter_id'=>$docter_id,'schedule_date'=>$scheduleDate,'organization_id'=>$org_id])->distinct('organization_id')
|
|
|
->distinct('type')->get(['organization_id','type'])->GroupBy('type')->toArray();
|
|
|
- $self = SelfSchedule::where(['docter_id'=>$docter_id,'schedule_date'=>$scheduleDate,'organization_id','=',$org_id])
|
|
|
- ->pluck('type','organization_id')->toArray();
|
|
|
+
|
|
|
// //检查排班详情
|
|
|
// self::checkDaySchedule($date,$type,$docter_id,$org_id);
|
|
|
// //检查自己排班
|
| xqd
@@ -573,7 +572,9 @@ class ApiController extends Controller
|
|
|
$idSum = array_sum($orgids);
|
|
|
if($org_id == $idSum) $newBase[$tType-1]['status'] = true;
|
|
|
if($org_id != $idSum) $newBase[$tType-1]['status'] = 'other';
|
|
|
- if(in_array($tType,$self))
|
|
|
+
|
|
|
+ $self = SelfSchedule::where(['docter_id'=>$docter_id,'schedule_date'=>$scheduleDate,'organization_id'=>$org_id,'type'=>$tType])->first();
|
|
|
+ if(!empty($self))
|
|
|
foreach($self as $key=>$org){
|
|
|
$newBase[$tType-1]['status'] = true;
|
|
|
if($org != $org_id) $newBase[$tType-1]['status'] = 'other';
|