正在显示
1 个修改的文件
包含
2 行增加
和
6 行删除
| @@ -163,10 +163,8 @@ class UpdateRoute extends Command | @@ -163,10 +163,8 @@ class UpdateRoute extends Command | ||
| 163 | */ | 163 | */ |
| 164 | public function getProductCategory(){ | 164 | public function getProductCategory(){ |
| 165 | $product = new Product(); | 165 | $product = new Product(); |
| 166 | - $num = 10; | ||
| 167 | - while ($num > 0){ | ||
| 168 | - $list = $product->lists(['status'=>1],$num,1000); | ||
| 169 | - foreach ($list['list'] as $k => $v){ | 166 | + $list = $product->list(['status'=>1]); |
| 167 | + foreach ($list as $k => $v){ | ||
| 170 | if(empty($v['category_id'])){ | 168 | if(empty($v['category_id'])){ |
| 171 | continue; | 169 | continue; |
| 172 | } | 170 | } |
| @@ -176,8 +174,6 @@ class UpdateRoute extends Command | @@ -176,8 +174,6 @@ class UpdateRoute extends Command | ||
| 176 | $this->saveRelated($v['id'], $category_ids); | 174 | $this->saveRelated($v['id'], $category_ids); |
| 177 | echo date('Y-m-d H:i:s') . '产品id:'.$v['id'] . PHP_EOL; | 175 | echo date('Y-m-d H:i:s') . '产品id:'.$v['id'] . PHP_EOL; |
| 178 | } | 176 | } |
| 179 | - $num--; | ||
| 180 | - } | ||
| 181 | } | 177 | } |
| 182 | 178 | ||
| 183 | /** | 179 | /** |
-
请 注册 或 登录 后发表评论