Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
yanggyein
/
yanggyein
/
yanggyein
/
app
/
Console
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/yanggyein/yanggyein/yanggyein/app/Console/Kernel.php
<?php namespace App\Console; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; class Kernel extends ConsoleKernel { /** * The Artisan commands provided by your application. * * @var array */ protected $commands = [ ]; /** * 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() { // DB::update('update nvrs set is_sock = 0'); // })->everyFiveMinutes(); // $schedule->call(function() { // $title="알람발생"; // $cont="알람발생"; // $tts_cont="도폐사를 입력하세요."; // $event_msg="A동 난리남"; // $mode="warning"; // $istts=1; // $is_sound=0; // $isvib=1; //진동 // $ispopup=1; // $tokens = array(); // $LTMS_FARM_CONTRACT = LTMS_FARM_CONTRACT::where('farm_no', 295)->where('contract_status', 1)->where('ltms_status', 5)->first(); // $LTMS_MEMBER = LTMS_MEMBER::where('farm_no', $LTMS_FARM_CONTRACT->farm_no)->first(); // $test = Farm::where('ltms_farm_no', $LTMS_FARM_CONTRACT->farm_no)->first(); // $cnt = LTMS_FARM_IOT::where('farm_no',$LTMS_FARM_CONTRACT->farm_no)->whereBetween('jtime', ['2020-11-12 14:00:00' ,date('Y-m-d H:i:s')])->where('temp','>',25)->count(); // // dd($cnt); // // dd($LTMS_MEMBER->fcm_token); // $tokens[]="cFGzeCyBli0:APA91bHX5FDgcOxWzYzUevAs1NuO2pif3NUZdPjmh8NuV7MqyJK4T0zLdd8DKRu8I_Znq55RrdX9Wk0ZhggLhBJm8jpgHWhE3P6U_xJBUGsvL1ehJ1egr0XJUO5Z6Q1GSxVvnlccdMNa"; // $notification = array('title'=>'도폐사 경고', 'body'=>'도폐사 입력', 'allowBackup'=>'1'); // // $this->send_notification($tokens, $notification, 2); // // sleep(1000); // // $data = array("message" => $cont,"title" => $title,"mode" => $mode,"sound" => $is_sound=="1"?"1":'0',"tts" => $tts_cont, // // "istts" => $istts=="1"?"1":'-1',"isvib" => $isvib=="1"?"1":'-1',"ispopup" => $ispopup=="1"?"1":'-1'); // $data = array("message" => '도폐사를 입력해 주세요.', "title" => '도폐사 입력 경고.',"mode" => $mode,"sound" => $is_sound=="1"?"1":'0',"tts" => $tts_cont, // "istts" => $istts=="1"?"1":'-1',"isvib" => $isvib=="1"?"1":'-1',"ispopup" => $ispopup=="1"?"1":'-1'); // // dd($message); // if($cnt > 1) { // // $this->send_notification($tokens, $data , 1); // } // })->everyMinute(); // } // protected function send_notification($tokens, $message, $set) { // $url = 'https://fcm.googleapis.com/fcm/send'; // switch ($set) { // case 1: // $fields = array( // 'registration_ids' => $tokens, // 'data' => $message, // ); // break; // case 2: // $fields = array( // 'registration_ids' => $tokens, // 'notification' => $message, // ); // break; // default: // return 0; // break; // } // $key = "AIzaSyCG6QsJex8nT-CVCMaDQL7vKxclJl3_XwI"; // $headers = array( // 'Authorization:key =' . $key, // 'Content-Type: application/json' // ); // $ch = curl_init(); // curl_setopt($ch, CURLOPT_URL, $url); // curl_setopt($ch, CURLOPT_POST, true); // curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0); // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields)); // $response = curl_exec($ch); // curl_close($ch); // $json=json_decode($response,true); //NotRegistered = 앱삭제 } /** * Register the commands for the application. * * @return void */ protected function commands() { $this->load(__DIR__ . '/Commands'); require base_path('routes/console.php'); } }