>>>>>> 9aa477479386789a8615d89285e74706ec72fbab use Illuminate\Support\Facades\Log; class Kernel extends ConsoleKernel { /** * The Artisan commands provided by your application. * * @var array */ protected $commands = [ AutoPayment::class, EveryDayInfo::class, ]; /** * 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 (){ $now=Carbon::now()->timestamp; $data=Goodtest::whereNotNull('show_time')->where('is_deleted',0)->get(); foreach ($data as $k=>$v){ $good=Goodtest::find($v->id); if (strtotime($v->show_time)<$now&&strtotime($v->off_time)>$now){ $good->is_show=3; //<<<<<<< HEAD // }elseif (strtotime($v->show_time)<$now){ // $good->is_show=1; // }elseif (strtotime($v->off_time)<$now){ // $good->is_show=4; //======= }elseif (strtotime($v->show_time)>$now&&strtotime($v->off_time)>$now+3){ $good->is_show=1; }elseif (strtotime($v->off_time)<$now+3){ $good->is_show=4; $good->show_time=null; //>>>>>>> 9aa477479386789a8615d89285e74706ec72fbab } $good->save(); } Log::error('111'); Log::error('111'); })->everyMinute(); $schedule->call(function (){ $data=Ordertest::where('status',3)->where('pay_status',2)->whereNotNull('receive_time')->get(); foreach ($data as $k=>$v){ $now=Carbon::now()->timestamp; if (strtotime($v->receice)>$now){ $order=Ordertest::find($v->id); $order->status=4; $order->save(); Log::error('订单编号为'.$v->order_num.'的商品已经自动收货'); } } })->everyMinute(); //自动支付 $schedule->command('autoPayment')->everyMinute(); $schedule->call(function (){ $re=User::where('cert_status',2)->whereNull('deleted_at')->select('id','mobile')->get(); $s=0; foreach ($re as $k=>$v){ $res=UserCert::where('user_id',$v->id)->get(); foreach ($res as $ke=>$va){ if ($va->recom_audit==1&& $va->agent_audit==1){ Log::error($v->mobile); } } } Log::error('这是相关数据'.$s); })->dailyAt('15:32'); } /** * Register the commands for the application. * * @return void */ protected function commands() { $this->load(__DIR__.'/Commands'); require base_path('routes/console.php'); } }