Task sheduller laravel di windows server, error saat update data otomatis

![](-pasang url gambar disini(format .png atau .jpg)-)saya menggunakan task scheduller di windows server untuk updata data otomatis setiap hari minggu, akan tetapi untuk shift yg berakhir jam 7 pagi selalu terupdate hari senin. selain itu normal, apakah ada kesalahan di settingan saya. terima kasih

 date_default_timezone_set('Asia/Manila');

      $timenowmin30minutes = Date('H:i',strtotime('-30 minutes'));
      $shift = DB::table('shift')->where('hours_finish',$timenowmin30minutes)->first();
      if ($shift != null && $shift->rolling_shift_automatic == 'active') {
        $dateNow = Date('Y-m-d');
        $codeShift = DB::table('shift')->select('shift_id','code')->get();
        $getShiftId = [];

            for ($i=0; $i < count($codeShift) ; $i++) {
              $getShiftId[$codeShift[$i]->code] = $codeShift[$i]->shift_id;
            }

            foreach ($getShiftId as $key => $value) {
              if ($shift->code == $key) {
                  $code = explode("-",$key);
                    if ($code[1] == 'M') {
                      $lastCode = 'A';
                    }elseif ($code[1] == 'A') {
                      $lastCode = 'N';
                    }elseif ($code[1] == 'N') {
                      $lastCode = 'M';
                    }

                    $shiftid = DB::table('shift')->where('code',$code[0].'-'.$lastCode)->first()->shift_id;
                    DB::table('detail_shift')->where('lastupdate','!=',$dateNow)->where('shift_id',$shift->shift_id)->update([
                      'shift_id' => $shiftid,
                      'lastupdate' => $dateNow,
                      'updated_at' => Carbon::now(),
                    ]);

              }
            }

      }else {
      }

avatar ddika990
@ddika990

14 Kontribusi 0 Poin

Dipost 4 tahun yang lalu

Belum ada Jawaban. Jadi yang pertama Jawaban

Login untuk ikut Jawaban