|
@@ -0,0 +1,57 @@
|
|
|
+<?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()]);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|