正在显示
2 个修改的文件
包含
2 行增加
和
2 行删除
| @@ -104,7 +104,7 @@ class DeleteBlogCategory extends Command | @@ -104,7 +104,7 @@ class DeleteBlogCategory extends Command | ||
| 104 | $blogModel = new Blog(); | 104 | $blogModel = new Blog(); |
| 105 | while (true){ | 105 | while (true){ |
| 106 | $blogList = $blogModel->lists(['status'=>1],$page,1000,'id',['id','category_id']); | 106 | $blogList = $blogModel->lists(['status'=>1],$page,1000,'id',['id','category_id']); |
| 107 | - if(empty($blogList)){ | 107 | + if(empty($blogList) || empty($blogList['list'])){ |
| 108 | return false; | 108 | return false; |
| 109 | } | 109 | } |
| 110 | foreach ($blogList['list'] as $v){ | 110 | foreach ($blogList['list'] as $v){ |
| @@ -102,7 +102,7 @@ class DeleteNewsCategory extends Command | @@ -102,7 +102,7 @@ class DeleteNewsCategory extends Command | ||
| 102 | $newsModel = new News(); | 102 | $newsModel = new News(); |
| 103 | while (true){ | 103 | while (true){ |
| 104 | $newsList = $newsModel->lists(['status'=>1],$page,1000,'id',['id','category_id']); | 104 | $newsList = $newsModel->lists(['status'=>1],$page,1000,'id',['id','category_id']); |
| 105 | - if(empty($newsList)){ | 105 | + if(empty($newsList) || empty($newsList['list'])){ |
| 106 | return false; | 106 | return false; |
| 107 | } | 107 | } |
| 108 | foreach ($newsList['list'] as $v){ | 108 | foreach ($newsList['list'] as $v){ |
-
请 注册 或 登录 后发表评论