Mike 4 年之前
父节点
当前提交
4e76192725
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      app/Community/Controllers/ApiController.php

+ 5 - 4
app/Community/Controllers/ApiController.php

xqd 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);
 //                    //检查自己排班
@@ -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';