Swdz-WangHaiJun пре 4 година
родитељ
комит
1557864ee1
1 измењених фајлова са 4 додато и 4 уклоњено
  1. 4 4
      app/Community/Controllers/ApiController.php

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

xqd xqd xqd xqd
@@ -389,7 +389,7 @@ class ApiController extends Controller
         $start = time();
 
         //删除排班
-        $schedule_ids = Schedule::where(['docter_id' => $docterId, 'schedule_type' => $sType])->where('schedule_day', '>', $today)->pluck('id')->toArray();
+        $schedule_ids = Schedule::where(['docter_id' => $docterId, 'schedule_type' => $sType,'organization_id'=>$orgId])->where('schedule_day', '>', $today)->pluck('id')->toArray();
 //        Schedule::where(['docter_id'=>$docterId])->where('schedule_day','>',$today)->delete();
         //删除具体排班
         SchedulePeriod::where('organization_id', $orgId)->where('me_sure', 0)->whereIn('schedule_id', $schedule_ids)->delete();
@@ -414,7 +414,7 @@ class ApiController extends Controller
         if ($allScheduleData) Schedule::insert($allScheduleData);
 
 //        echo '医生id '.$docterId.' 机构id '.$orgId . 'times ';
-        $schedule = Schedule::where(['docter_id' => $docterId, 'schedule_type' => $sType])->where('schedule_date', '>=', date('Y-m-d', time()))
+        $schedule = Schedule::where(['docter_id' => $docterId, 'schedule_type' => $sType,'organization_id'=>$orgId])->where('schedule_date', '>=', date('Y-m-d', time()))
             ->distinct('schedule_date')->pluck('schedule_date', 'id')->toArray();
 
         $allData = [];
@@ -889,7 +889,7 @@ class ApiController extends Controller
             $mesure->delete();
             foreach ($timePeriods as $idt) {
                 if (!empty($mesureIds)) {
-                    $scheduleId = Schedule::where(['docter_id' => $docterId, 'schedule_type' => $sType])->where('schedule_date', $date)->value('id');
+                    $scheduleId = Schedule::where(['docter_id' => $docterId, 'schedule_type' => $sType,'organzation_id'=>$orgId])->where('schedule_date', $date)->value('id');
                     if ($scheduleId == 0) {
                         $numDate = date('Ymd', $todayTimer);
                         $scheduleData['docter_id'] = $docterId;
@@ -920,7 +920,7 @@ class ApiController extends Controller
             if (!empty($real_id)) {
 
                 foreach ($timePeriods as $idt) {
-                    $scheduleId = Schedule::where(['docter_id' => $docterId, 'schedule_type' => $sType])->where('schedule_date', $date)->value('id');
+                    $scheduleId = Schedule::where(['docter_id' => $docterId, 'schedule_type' => $sType,'organization_id' => $orgId])->where('schedule_date', $date)->value('id');
                     if ($scheduleId == 0) {
                         $numDate = date('Ymd', $todayTimer);
                         $scheduleData['docter_id'] = $docterId;