Exemplo n.º 1
1
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule $schedule
  *
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->command('inspire')->hourly();
     // 进入维护模式
     $schedule->command('down')->evenInMaintenanceMode()->dailyAt('23:00');
     //->when(function () {return true;});//
     // 更新用户等级
     $schedule->call(function () {
         $registrations = Registration::where('state', 0)->where(function ($query) {
             $query->where('registration_date', Carbon::yesterday()->toDateString());
         })->get();
         foreach ($registrations as $registration) {
             $user = $registration->user;
             $user->credit_level -= 1;
             $user->save();
         }
     })->evenInMaintenanceMode()->daily();
     //
     // 重置rest_num
     $schedule->call(function () {
         $doctor_schedules = DocSchedule::where('state', 0)->where(function ($query) {
             $week = [1 => 'monday', 2 => 'tuesday', 3 => 'wednesday', 4 => 'thursday', 5 => 'friday', 6 => 'saturday', 7 => 'sunday'];
             $query->where('doctoring_date', $week[Carbon::today()->dayOfWeek]);
         })->get();
         foreach ($doctor_schedules as $doctor_schedule) {
             $doctor_schedule->rest_num = $doctor_schedule->total_num;
             $doctor_schedule->save();
         }
     })->evenInMaintenanceMode()->dailyAt('3:00');
     //
     // 离开维护模式
     $schedule->command('up')->evenInMaintenanceMode()->dailyAt('7:00');
     //
 }
Exemplo n.º 2
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     // $schedule->command('inspire')->hourly();
     // $schedule->call('App\Http\Controllers\WelcomeController@testMail')->everyFiveMinutes();
     $schedule->call('App\\Http\\Controllers\\API\\ShippingAPIController@autoCheckWaybill')->everyFiveMinutes();
     $schedule->call('App\\Http\\Controllers\\API\\MailAPIController@registerInvitationMail')->everyFiveMinutes();
 }
Exemplo n.º 3
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     if (Schema::hasTable('migrations') && Schema::hasTable('users')) {
         $banned = User::banned()->get();
         $all = User::all();
         $schedule->call(function () use($banned) {
             foreach ($banned as $u) {
                 if ($u->banned_until != null) {
                     if ($u->banned_until < Carbon::now()->toDateTimeString()) {
                         $u->update(array('is_banned' => 0, 'banned_until' => null));
                     }
                 }
             }
         })->when(function () use($banned) {
             return $banned->count() > 0;
         })->cron('* * * * *');
         $schedule->call(function () use($all) {
             $now = Carbon::now();
             $now->subMinutes(15);
             // A user is offline if they do nothing for 15 minutes
             foreach ($all as $u) {
                 if ($u->last_active != null && $u->last_active < $now->toDateTimeString()) {
                     $u->update(array('is_online' => 0));
                 }
             }
         })->when(function () use($all) {
             return $all->count() > 0;
         })->cron('* * * * *');
     }
 }
Exemplo n.º 4
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->call(function () {
         Mail::raw('Hi Dries!', function ($message) {
             $message->from(env('MAIL_FROM'), env('MAIL_NAME'));
             $message->to('*****@*****.**')->subject('Test mail!');
         });
     })->daily();
     $schedule->call(function () {
         $expiringAuctions = Auction::getExpiringAuctions();
         foreach ($expiringAuctions as $auction) {
             $bidders = Bid::getBiddersWithId($auction->id);
             $highest = Bid::getHighestBidWithId($auction->id);
             $auction->buyer_id = $highest->id;
             $auction->save();
             foreach ($bidders as $bidWithBidder) {
                 $bidder = $bidWithBidder->user;
                 if ($bidder->id = $highest->id) {
                     Mail::raw('Auction ' . $auction->title . ' ended, you are the highest bidder!', function ($message) use($bidder) {
                         $message->from(env('MAIL_FROM'), env('MAIL_NAME'));
                         $message->to($bidder->email)->subject('You are the highest bidder.');
                     });
                 } else {
                     Mail::raw('Auction ' . $auction->title . ' ended, you did not give the highest bid!', function ($message) use($bidder) {
                         $message->from(env('MAIL_FROM'), env('MAIL_NAME'));
                         $message->to($bidder->email)->subject("Auction ended, you didn't get it.");
                     });
                 }
             }
         }
     })->daily();
 }
Exemplo n.º 5
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->call(function () {
         $players = DB::connection('game')->table('player_characters')->get();
         foreach ($players as $player) {
             if (!Player::where('id', $player->id)->exists()) {
                 $player_info = ['id' => $player->id, 'name' => $player->given_name, 'level' => $player->level, 'class' => 0, 'gold' => $player->gold, 'family_name' => $player->family_id ? DB::connection('game')->table('family')->where('id', $player->family_id)->first()->name : '-'];
                 Player::create($player_info);
             }
         }
     })->everyTenMinutes();
     $schedule->call(function () {
         $families = DB::connection('game')->table('family')->get();
         foreach ($families as $family) {
             if (!Family::where('id', $family->id)->exists()) {
                 $gold = 0;
                 foreach (DB::connection('game')->table('player_characters')->where('family_id', $family->id)->get() as $player) {
                     $gold += $player->gold;
                 }
                 $family_info = ['id' => $family->id, 'name' => $family->name, 'level' => $family->lv, 'gold' => $gold, 'members' => DB::connection('game')->table('player_characters')->where('family_id', $family->id)->count(), 'leader' => DB::connection('game')->table('player_characters')->where('id', $family->leader_id)->first()->given_name];
                 Family::create($family_info);
             }
         }
     })->everyTenMinutes();
 }
Exemplo n.º 6
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     //Change valid status of all tickets that no longer qualify as valid
     $schedule->call(function () {
         DB::table('tickets')->where('dateofdeparture', '<=', Carbon::now())->update(['valid' => 0]);
     })->everyMinute();
     //Decrement credits from users that have newly invalid tickets that are still tradable and mark them untradable once complete
     $schedule->call(function () {
         $where["valid"] = '0';
         $where["tradable"] = '1';
         $tickets = DB::table('tickets')->where($where)->get();
         foreach ($tickets as $ticket) {
             //Determine the credit value on the class of the ticket to set the decrement amount
             switch ($ticket->class) {
                 case 'Economy':
                     $ticketValue = 1;
                     break;
                 case 'Business':
                     $ticketValue = 2;
                     break;
                 case 'First':
                     $ticketValue = 3;
                     break;
                 case 'Premium':
                     $ticketValue = 4;
                     break;
                 default:
                     $ticketValue = 1;
                     break;
             }
             DB::table('credits')->where('user_id', $ticket->user_id)->decrement('trade', $ticketValue);
             DB::table('tickets')->where('id', $ticket->id)->update(['tradable' => 0]);
         }
     })->everyMinute();
 }
Exemplo n.º 7
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->command('inspire')->hourly();
     $schedule->call(function () {
         Log::info('attaching new verified skills started');
         $skills = Skill::whereNotNull('verified_skill_id')->get();
         foreach ($skills as $skill) {
             $jobs = Job::whereHas('skills', function ($query) use($skill) {
                 $query->where('skill_id', $skill->id);
             })->whereHas('verifiedSkills', function ($query) use($skill) {
                 $query->where('verified_skill_id', $skill->verified_skill_id);
             }, '<', 1)->get();
             foreach ($jobs as $job) {
                 $job->verifiedSkills()->attach($skill->verified_skill_id);
             }
         }
     })->daily();
     $schedule->call(function () {
         Log::info('HH parsing started');
         $hhGrabber = $this->app['App\\Helpers\\HeadHunterGrabber'];
         $job = $this->app['App\\Models\\Job'];
         $parser = new Parser([$hhGrabber], $job);
         $parser->parse();
     })->daily();
 }
Exemplo n.º 8
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     /*
      * Let us know if there is something new :)
      */
     // check if there is a new error
     $schedule->call(function () {
         // get new errors
         $new_errors = Error::cronUnseen()->get();
         if (!$new_errors->isEmpty()) {
             Mail::send('emails.errors', ['errors' => $new_errors], function ($message) {
                 $message->from('*****@*****.**', 'Notification | MyGrades');
                 $message->to("*****@*****.**", $name = null);
                 $message->subject("New errors reported");
             });
             // mark them as seen
             DB::table('errors')->whereNull('cron_seen')->update(['cron_seen' => Carbon::now()]);
         }
     })->hourly();
     // check if there is a new wish
     $schedule->call(function () {
         // get new errors
         $new_wishes = Wish::cronUnseen()->get();
         if (!$new_wishes->isEmpty()) {
             Mail::send('emails.wishes', ['wishes' => $new_wishes], function ($message) {
                 $message->from('*****@*****.**', 'Notification | MyGrades');
                 $message->to("*****@*****.**", $name = null);
                 $message->subject("New wishes");
             });
             // mark them as seen
             DB::table('wishes')->whereNull('cron_seen')->update(['cron_seen' => Carbon::now()]);
         }
     })->hourly();
 }
Exemplo n.º 9
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->command('inspire')->hourly();
     //check 'expired' confirmation tokens
     $schedule->call('\\App\\Http\\Controllers\\EmergencyContactsController@expiredTokens')->hourly();
     //check active trips
     $schedule->call('\\App\\Http\\Controllers\\TripPlansController@missedTrips')->everyFiveMinutes();
 }
Exemplo n.º 10
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->call(function () {
         Auction::end();
     })->everyMinute();
     $schedule->call(function () {
         Auction::setPopular();
     })->daily();
 }
Exemplo n.º 11
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     // 5 day notice
     $schedule->call(function () {
         $FiveDaystoGo = \Carbon\Carbon::now()->addDays(5)->format("Y-m-d");
         $usertools = \App\Models\Tool::where("retag_date", "=", $FiveDaystoGo)->where("five_notice", "=", "0")->get();
         foreach ($usertools as $tool) {
             $notification = new \App\Models\Notification();
             $notification->message = '<a href="' . url("industryProject/public/tools/" . $tool->id) . '">' . $tool->name . '</a>' . " is due for re-tagging within the next five days.";
             $notification->user_id = $tool->user_id;
             $notification->save();
             $tool->five_notice = 1;
             $tool->save();
         }
         //send email
         Mail::send('emails.fiveNotice', ['tool' => $tool], function ($m) {
             $m->from('*****@*****.**', 'Tag and Track');
             $m->to('*****@*****.**', 'Leanne')->subject('Tool is due to be re-tagged.');
         });
     })->dailyAt('04:00');
     // 3 day notice
     $schedule->call(function () {
         $ThreeDaystoGo = \Carbon\Carbon::now()->addDays(3)->format("Y-m-d");
         $usertools = \App\Models\Tool::where("retag_date", "=", $ThreeDaystoGo)->where("three_notice", "=", "0")->get();
         foreach ($usertools as $tool) {
             $notification = new \App\Models\Notification();
             $notification->message = '<a href="' . url("industryProject/public/tools/" . $tool->id) . '">' . $tool->name . '</a>' . " is due for re-tagging within the next three days.";
             $notification->user_id = $tool->user_id;
             $notification->save();
             $tool->three_notice = 1;
             $tool->save();
         }
         //send email
         Mail::send('emails.threeNotice', ['tool' => $tool], function ($m) {
             $m->from('*****@*****.**', 'Tag and Track');
             $m->to('*****@*****.**', 'Leanne')->subject('Tool is due to be re-tagged.');
         });
     })->dailyAt('05:00');
     // 1 day notice
     $schedule->call(function () {
         $OneDaytoGo = \Carbon\Carbon::now()->addDays(1)->format("Y-m-d");
         $usertools = \App\Models\Tool::where("retag_date", "=", $OneDaytoGo)->where("one_notice", "=", "0")->get();
         foreach ($usertools as $tool) {
             $notification = new \App\Models\Notification();
             $notification->message = '<a href="' . url("industryProject/public/tools/" . $tool->id) . '">' . $tool->name . '</a>' . " is due for re-tagging tomorrow.";
             $notification->user_id = $tool->user_id;
             $notification->save();
             $tool->one_notice = 1;
             $tool->save();
         }
         //send email
         Mail::send('emails.oneNotice', ['tool' => $tool], function ($m) {
             $m->from('*****@*****.**', 'Tag and Track');
             $m->to('*****@*****.**', 'Leanne')->subject('Tool is due to be re-tagged.');
         });
     })->dailyAt('06:00');
 }
Exemplo n.º 12
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->call(function () {
         DB::table('posts')->where('relevancia', '>', 5)->decrement('relevancia', 5);
         DB::table('posts')->where('relevancia_rate', '>', 100)->decrement('relevancia_rate', 'relevancia_rate/100');
     })->hourly();
     $schedule->call(function () {
         DB::table('posts')->where('relevancia_rate', '>', 5)->decrement('relevancia_rate', 1);
     })->daily();
 }
Exemplo n.º 13
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     // $schedule->command('inspire')
     //          ->hourly();
     $schedule->call(function () {
         dispatch(new \App\Jobs\MTech\EmailEfficiencyReport());
     })->twiceDaily(7, 19);
     $schedule->call(function () {
         dispatch(new \App\Jobs\MTech\LogoutShiftStaff());
     })->twiceDaily(6, 18);
 }
Exemplo n.º 14
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     // $schedule->command('inspire')
     //          ->hourly();
     //It will excute the class SocialWorkerController at midnight and retrieve the user tags from facebook
     $schedule->call("SmartCity\\Http\\Controllers\\SocialWorkerController@index")->daily();
     // ->name("facebooktags")
     // ->withoutOverlapping();
     //It will excute the class FacebookPagesController every saturday and cities' Facebook pages posts
     $schedule->call("SmartCity\\Http\\Controllers\\FacebookPagesController@index")->saturdays();
 }
Exemplo n.º 15
0
 protected function schedule(Schedule $schedule)
 {
     $schedule->call(function () {
         (new WebIOPi())->pin(3, 1);
     })->dailyAt('23:00');
     //5pm cst
     $schedule->call(function () {
         (new WebIOPi())->pin(3, 0);
     })->dailyAt('04:30');
     //10:30pm cst
 }
Exemplo n.º 16
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->call(function () {
         $sniffer = new TFSniffer();
         $sniffer->sniffNextUser();
         $downloader = new TFDownloader();
         $downloader->downloadNextFile();
     })->cron('* * * * *');
     $schedule->call(function () {
         $zipper = new TFZipper();
         $zipper->zipAll();
     })->dailyAt('23:59');
 }
Exemplo n.º 17
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->call(function () {
         $tickets = TicketsController::API()->all(['where' => ['deadline|<|0', 'deadline|>|-60'], 'paginate' => 'false']);
         foreach ($tickets as $ticket) {
             EmailsManager::sendEscalation($ticket->id);
             SlackManager::sendEscalation($ticket);
         }
     })->everyMinute();
     $schedule->call(function () {
         SlackManager::setChannelsTopic();
     })->twiceDaily(7, 15);
 }
Exemplo n.º 18
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->command('export-monster-files test')->cron('00 * * * *')->name('process-feed')->withoutOverlapping();
     $schedule->call(function () {
         $files = \App\FileDeleteQueue::all();
         foreach ($files as $file) {
             $local_file = config('monster.tmp_storage_path') . $file->file_name;
             if (file_exists($local_file)) {
                 $tmp_is_deleted = unlink(realpath($local_file));
                 if (!$tmp_is_deleted) {
                     \App\ExportLog::create(['process' => 'deleting local file', 'filename' => $ftp_file, 'message' => 'cannot be deleted from /tmp/ folder']);
                 } else {
                     $file->delete();
                 }
             }
         }
     })->name('delete-local-files')->twiceDaily(12, 23);
     $schedule->call(function () {
         // deleting expired jobs
         $today = date('Y-m-d', time());
         $jobs = \App\Job::where('end_date', '<', $today)->take(1000)->get();
         if (!$jobs->isEmpty()) {
             $i = 0;
             foreach ($jobs as $j) {
                 $j->delete();
                 $i++;
             }
             \App\ExportLog::create(['process' => 'deleting expired jobs', 'message' => 'Deleted ' . $i . ' jobs']);
         }
     })->cron('5 * * * *')->name('delete-expired-jobs-hourly')->withoutOverlapping();
     $schedule->call(function () {
         $today = date('Y-m-d', time() - 3 * 86400);
         \App\ExportRecordFailure::where('created_at', '<', $today)->take(3000)->delete();
     })->cron('5 * * * *')->name('delete-export-record-failures')->withoutOverlapping();
     $schedule->call(function () {
         $queue = \App\CacheQueue::where(['in_process' => 0])->take(10);
         $records = $queue->get();
         if (!$records->isEmpty()) {
             $queue->update(['in_process' => 1]);
             foreach ($records as $record) {
                 $run = call_user_func($record->model . '::' . $record->method, $record->args);
                 if ($run) {
                     $record->delete();
                 } else {
                     $record->in_process = null;
                     $record->save();
                 }
             }
         }
     })->everyMinute()->name('process-cache-queue-records');
 }
Exemplo n.º 19
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->command('inspire')->hourly();
     // Check the statuses of each faucet every hour.
     $schedule->call(function () {
         Faucets::checkUpdateStatuses();
     })->hourly()->environments('production');
     // Schedule a random tweet of a selected faucet every hour.
     $schedule->call(function () {
         $user = User::where('is_admin', '=', true)->firstOrFail();
         $twitter = new Twitter($user);
         $twitter->sendRandomFaucetTweet();
     })->hourly()->environments('production');
 }
Exemplo n.º 20
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->call(function () {
         $trip_ids = Trip::where('departure_date', Carbon::today())->lists('id')->toArray();
         Booking::where('status', 'reserved')->whereIn('trip_id', $trip_ids)->delete();
     })->everyMinute();
 }
Exemplo n.º 21
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->call(function () {
         Cache::put('last-cron', new Carbon(), 5);
     })->everyMinute();
     $schedule->command('inspire')->hourly();
 }
Exemplo n.º 22
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->call(function () {
         $handler = new App\AlertHandler(new App\Curl());
         $handler->sendAlertEmails(env('ALERT_FETCH_RANGE'));
     })->thenPing(env('ALERT_SEND_HEARTBEAT'))->everyMinute();
 }
Exemplo n.º 23
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     // $schedule->command('inspire')
     //          ->hourly();
     /** 
      * Ranking system to calculate Ranks in the 
      * test 7 minutes after the test is completed.
      * This cron job will be called hourly.
      */
     $schedule->call(function () {
         $rounds = Round::where('end_date_time', '<', Carbon::now()->subMinutes(7))->where('ranked', false)->get();
         foreach ($rounds as $round) {
             $qualifiers = Qualifier::where('round_id', $round->id)->orderBy('score', 'desc')->orderBy('completion_time', 'asc')->get();
             $i = 1;
             foreach ($qualifiers as $qualifier) {
                 $qualifier->rank = $i;
                 $qualifier->save();
                 $i++;
             }
             if ($round->cutoff) {
                 $next_qualifiers = Qualifier::where('round_id', $round->id)->where('rank', '<=', $round->cutoff)->get();
                 $next_round = $round->event->rounds->where('no', strval($round->no + 1))->first();
                 foreach ($next_qualifiers as $next_qualifier) {
                     $qualifier = new Qualifier();
                     $qualifier->save();
                     $next_round->qualifiers()->save($qualifier);
                     $next_qualifier->student->qualifiers()->save($qualifier);
                 }
             }
             $round->ranked = true;
             $round->save();
         }
     })->everyMinute();
 }
Exemplo n.º 24
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->call(function () {
         $twitterController = new TwitterController();
         $twitterController . daemonServiceTrends();
     })->everyFiveMinutes();
 }
Exemplo n.º 25
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->call(function () {
         ShippingIntegrationController::checkTrackingNumbers();
     })->everyMinute();
     $schedule->call(function () {
         Log::info('In cron job');
         $now = Carbon::now();
         if (Campaign::where('status', 0)->where('scheduled_at', '<', $now)->count() > 0) {
             $campaigns = Campaign::where('status', 0)->where('scheduled_at', '<', $now)->get();
             foreach ($campaigns as $campaign) {
                 $campaign->doSendAll();
             }
         }
     })->everyMinute();
 }
Exemplo n.º 26
0
 /**
  * Define the application's command schedule.
  *
  * @param \Illuminate\Console\Scheduling\Schedule $schedule        	
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->call(function () {
         $manager = new NoFManager();
         $manager->run();
     })->cron('* * * * *');
 }
Exemplo n.º 27
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->command('inspire')->hourly();
     //tsipizic check
     $schedule->call(function () {
     })->everyFiveMinutes();
 }
Exemplo n.º 28
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->call(function () {
         $hoje = getdate();
         $hoje2 = $hoje['year'] . '-' . $hoje['mon'] . '-' . $hoje['mday'];
         $acoes = DB::table('acaos')->where('data_sorteio', '=', $hoje2)->where('numrifado', null)->get();
         Log::info("antes");
         foreach ($acoes as $acoes) {
             $rifas = DB::table('acaos')->join('rifas', 'acaos.id', '=', 'rifas.acao_id')->where('rifas.acao_id', $acoes->id)->whereNotNull('rifas.user_id')->where('acaos.data_sorteio', '=', $hoje2)->get();
             $sorteado = array_rand($rifas, 1);
             //variavel com uma posição randomica do array
             Log::info("depois");
             $numero = $rifas[$sorteado];
             //rifa especifica do array com a posição sorteada
             $acao = Acao::find($acoes->id);
             $acao->numrifado = $numero->nome_rifa;
             //atualiza campo de numero rifado da tabele acaos
             Log::info($numero->user_id);
             $acao->winner_id = $numero->user_id;
             //atualiza o campo id do vencedor em acaos
             // Log::info($acao);
             $acao->save();
         }
     })->everyMinute();
 }
Exemplo n.º 29
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->command('inspire')->hourly();
     $schedule->call(function () {
         \App\Http\Controllers\DepressionController::sendEmail();
     })->cron('0 0,4,8,12,16,20 * * *');
 }
Exemplo n.º 30
0
 /**
  * Define the application's command schedule.
  *
  * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
  * @return void
  */
 protected function schedule(Schedule $schedule)
 {
     $schedule->call(function () {
         $command = new ResolveTurn();
         $command->handle();
     })->everyMinute();
 }