Example #1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $this->info('Sync counter date to database');
     $counterSync = new CounterSync();
     $counterSync->syncAll();
     /*$classNames = Config::get('counter.syncClasses');
       foreach($classNames as $className){
           $counterSync->syncAll($className);
       }*/
     $this->info('Sync finished at ' . date('Y-m-d'));
     Log::info('Sync finished at ' . date('Y-m-d'));
 }
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $className = $this->argument('classname');
     $amount = $this->argument('amount');
     $action = $this->option('action');
     if (!in_array($action, $this->options)) {
         $this->error('action not found!');
         return false;
     }
     $this->info('will ' . $action . ' ' . $amount . ' of every view counter');
     $countSync = new CounterSync();
     $countSync->setViewCountBatch($className, $action, $amount);
 }