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

+ 1 - 2
app/Community/Controllers/ApiController.php

xqd
@@ -890,14 +890,13 @@ class ApiController extends Controller
             foreach ($timePeriods as $idt) {
                 if (!empty($mesureIds)) {
                     $scheduleId = Schedule::where(['docter_id' => $docterId, 'schedule_type' => $sType,'organization_id'=>$orgId])->where('schedule_date', $date)->value('id');
-                    if ($scheduleId == 0) {
+                    if (empty($scheduleId)) {
                         $numDate = date('Ymd', $todayTimer);
                         $scheduleData['docter_id'] = $docterId;
                         $scheduleData['schedule_date'] = $date;
                         $scheduleData['schedule_day'] = $numDate;
                         $scheduleData['schedule_type'] = $sType;
                         if ($sType != 1) $scheduleData['organization_id'] = $orgId;
-//                        dd($scheduleData);
                         $scheduleId = Schedule::insertGetId($scheduleData);
                     }
                     $s_t = [