作者 lyh

gx

... ... @@ -168,7 +168,9 @@ class UpdateRoute extends Command
*/
public function getProductCategory(){
$product = new Product();
$list = $product->list(['status'=>1]);
$num = 5;
while ($num > 0){
$list = $product->lists(['status'=>1],$num,5000);
foreach ($list as $k => $v){
if(empty($v['category_id'])){
continue;
... ... @@ -178,6 +180,8 @@ class UpdateRoute extends Command
$this->saveRelated($v['id'], $category_ids);
echo date('Y-m-d H:i:s') . '产品id:'.$v['id'] . PHP_EOL;
}
$num--;
}
}
/**
... ...