app/Console/Commands/UpdateCache1.php
/**
     * Execute the console command.
     *
     * @return mixed
     */
Execute the console command.
@return mixed
Execute the console command . @return mixed
public function handle()
    {
        $this->info('update cache 1');
        $xs = new XS('indexone');
        $xs->search->setSort('create_date',false);
        $xs->search->setQuery("category:娱乐");
        $xs->search->setLimit(8);
        $recommendation = $xs->search->search();
        Cache::put('movie:recommendation',$recommendation, 60*6+3); 6 小时 + 3分钟
    }
public function handle ( ) { $ this -> info ( 'update cache 1' ) ; $ xs = new XS ( 'indexone' ) ; $ xs -> search -> setSort ( 'create_date' , false ) ; $ xs -> search -> setQuery ( " category:娱乐"); $ xs -> search -> setLimit ( 8 ) ; $ recommendation = $ xs -> search -> search ( ) ; Cache :: put ( 'movie:recommendation' , $ recommendation , 60 * 6 + 3 ) ; }
Execute the console command.
Execute the console command .
// //6 小时 + 3分钟