123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace App\Console\Commands;
- use Illuminate\Console\Command;
- use App\Facades\Servers\Redis\RedisLock;
- use App\Facades\Servers\WechatWork\ExternalContact;
- use App\Models\Product as Model;
- class ProductDelist extends Command
- {
- /**
- * 任务名称
- *
- * @var string
- */
- protected $signature = 'product_delist';
- /**
- * 任务描述
- *
- * @var string
- */
- protected $description = '限购产品自动下架';
- /**
- * Create a new command instance.
- *
- * @return void
- */
- public function __construct()
- {
- parent::__construct();
- }
- /**
- * Execute the console command.
- *
- * @return int
- */
- public function handle()
- {
- // 执行任务
- $this->run_task();
- return 0;
- }
- /**
- * 执行任务
- *
- * */
- public function run_task(){
- // 获取数据
- ( New Model() )->query()->where([['quota_end','>',0],['quota_end','<=',time()]])->update(['status'=>1,'update_time'=>time()]);
- }
- }
|