正在显示
3 个修改的文件
包含
15 行增加
和
4 行删除
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | 9 | ||
| 10 | namespace App\Console\Commands\DeleteCategory; | 10 | namespace App\Console\Commands\DeleteCategory; |
| 11 | 11 | ||
| 12 | +use App\Models\Com\NoticeLog; | ||
| 12 | use Illuminate\Console\Command; | 13 | use Illuminate\Console\Command; |
| 13 | 14 | ||
| 14 | /** | 15 | /** |
| @@ -52,6 +53,15 @@ class DeleteProductCategory extends Command | @@ -52,6 +53,15 @@ class DeleteProductCategory extends Command | ||
| 52 | * @time :2024/5/16 15:02 | 53 | * @time :2024/5/16 15:02 |
| 53 | */ | 54 | */ |
| 54 | public function handle(){ | 55 | public function handle(){ |
| 55 | - | 56 | + while (true){ |
| 57 | + $noticeLogModel = new NoticeLog(); | ||
| 58 | + $list = $noticeLogModel->list(['status'=>NoticeLog::STATUS_PENDING,'type'=>NoticeLog::DELETE_PRODUCT_CATEGORY],'id',['*'],'asc','100'); | ||
| 59 | + if(empty($list)){ | ||
| 60 | + sleep(100); | ||
| 61 | + } | ||
| 62 | + foreach ($list as $v){ | ||
| 63 | + | ||
| 64 | + } | ||
| 65 | + } | ||
| 56 | } | 66 | } |
| 57 | } | 67 | } |
| @@ -77,8 +77,8 @@ class NewsController extends BaseController | @@ -77,8 +77,8 @@ class NewsController extends BaseController | ||
| 77 | if(isset($this->map['name']) && !empty($this->map['name'])){ | 77 | if(isset($this->map['name']) && !empty($this->map['name'])){ |
| 78 | $query = $query->where('name',$this->map['name'][0],'%'.$this->map['name'][1].'%'); | 78 | $query = $query->where('name',$this->map['name'][0],'%'.$this->map['name'][1].'%'); |
| 79 | } | 79 | } |
| 80 | - if(!empty($this->map['start_at']) && !empty($this->map['end_at'])){ | ||
| 81 | - $query->whereBetween('created_at', [$this->map['start_at'],$this->map['end_at']]); | 80 | + if(!empty($this->param['start_at']) && !empty($this->param['end_at'])){ |
| 81 | + $query->whereBetween('created_at', [$this->param['start_at'],$this->param['end_at']]); | ||
| 82 | } | 82 | } |
| 83 | return $query; | 83 | return $query; |
| 84 | } | 84 | } |
| @@ -2,9 +2,10 @@ | @@ -2,9 +2,10 @@ | ||
| 2 | namespace App\Models\Com; | 2 | namespace App\Models\Com; |
| 3 | 3 | ||
| 4 | use App\Helper\Arr; | 4 | use App\Helper\Arr; |
| 5 | +use App\Models\Base; | ||
| 5 | use Illuminate\Database\Eloquent\Model; | 6 | use Illuminate\Database\Eloquent\Model; |
| 6 | 7 | ||
| 7 | -class NoticeLog extends Model | 8 | +class NoticeLog extends Base |
| 8 | { | 9 | { |
| 9 | //设置关联表名 | 10 | //设置关联表名 |
| 10 | protected $table = 'gl_notice_log'; | 11 | protected $table = 'gl_notice_log'; |
-
请 注册 或 登录 后发表评论