Mike 4 yıl önce
ebeveyn
işleme
21981923c2
1 değiştirilmiş dosya ile 13 ekleme ve 6 silme
  1. 13 6
      app/Community/Controllers/ApiController.php

+ 13 - 6
app/Community/Controllers/ApiController.php

xqd xqd xqd
@@ -574,12 +574,7 @@ class ApiController extends Controller
                             if($org_id != $idSum) $newBase[$tType-1]['status'] = 'other';
                         }
 
-                        $self = SelfSchedule::where(['docter_id'=>$docter_id,'schedule_date'=>$scheduleDate,'organization_id'=>$org_id])->get(['type']->GroupBy('type')->toArray();
-                        if(!empty($self)){
-                            foreach($self as $sf){
-                                $newBase[$sf['type']]['status'] = true;
-                            }
-                        }
+
 //
 //                        dump($newBase);
                         $scheduleList[] = [
@@ -589,6 +584,12 @@ class ApiController extends Controller
                             'day'=>$scheduleDate
                         ];
                     }
+                    $self = SelfSchedule::where(['docter_id'=>$docter_id,'schedule_date'=>$scheduleDate,'organization_id'=>$org_id])->get(['type'])->GroupBy('type')->toArray();
+                    if(!empty($self)){
+                        foreach($self as $sf){
+                            $newBase[$sf['type']]['status'] = true;
+                        }
+                    }
                 } else {
                     $today = SchedulePeriod::where(['docter_id'=>$docter_id,'schedule_date'=>$scheduleDate])->where('organization_id','!=',0)->distinct('organization_id')
                         ->distinct('type')->get(['organization_id','type'])->GroupBy('type')->toArray();
@@ -614,6 +615,12 @@ class ApiController extends Controller
                             'day'=>$scheduleDate
                         ];
                     }
+                    $self = SelfSchedule::where(['docter_id'=>$docter_id,'schedule_date'=>$scheduleDate,'organization_id'=>$org_id])->get(['type'])->GroupBy('type')->toArray();
+                    if(!empty($self)){
+                        foreach($self as $sf){
+                            $newBase[$sf['type']]['status'] = true;
+                        }
+                    }
                 }
             }
 ////            if(empty( $schedule_data[$scheduleDate])) continue;