Commit 3052565b by 孙龙

up

parent b28228ce
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Foundation\Inspiring;
use DB;
class JingDiaoUser extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'JingDiao:ClearUser';
/**
* The console command description.
*
* @var string
*/
protected $description = '清除静调用户是手机号的';
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$list = DB::Connection("order")->table("lie_user_main")->whereRaw(" is_type = 1 and mobile != '' ")->count();
dump($list);
}
}
<?php <?php
namespace App\Console; namespace App\Console;
use Illuminate\Console\Scheduling\Schedule; use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel class Kernel extends ConsoleKernel
{ {
/** /**
* The Artisan commands provided by your application. * The Artisan commands provided by your application.
* *
* @var array * @var array
*/ */
protected $commands = [ protected $commands = [
Commands\Inspire::class, Commands\Inspire::class,
]; \App\Console\Commands\JingDiaoUser::class,
];
/**
* Define the application's command schedule. /**
* * Define the application's command schedule.
* @param \Illuminate\Console\Scheduling\Schedule $schedule *
* @return void * @param \Illuminate\Console\Scheduling\Schedule $schedule
*/ * @return void
protected function schedule(Schedule $schedule) */
{ protected function schedule(Schedule $schedule)
$schedule->command('inspire') {
->hourly();
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment