43 lines
914 B
PHP
43 lines
914 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands\Table;
|
|
|
|
use App\Model\Config;
|
|
use App\Model\Feedback;
|
|
use App\Model\Seller\SellerFeedback;
|
|
use Illuminate\Console\Command;
|
|
|
|
class OptimizeFeedback extends Command
|
|
{
|
|
/**
|
|
* 这个就是命令名称
|
|
*/
|
|
protected $signature = 'optimize:feedback';
|
|
|
|
/**
|
|
* 命令的说明描述
|
|
* @var string
|
|
*/
|
|
protected $description = '优化反馈相关的表,物理删除数据';
|
|
|
|
/**
|
|
* 创建命令的构造方法。
|
|
* @param string $words 传入的字符参数
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
public function handle()
|
|
{
|
|
$currentDate = Config::keepDataDate();
|
|
Feedback::where('created_at', '<', $currentDate)
|
|
->forceDelete();
|
|
|
|
SellerFeedback::where('created_at', '<', $currentDate)
|
|
->forceDelete();
|
|
}
|
|
}
|