|
...
|
...
|
@@ -95,14 +95,14 @@ class DeleteProductCategory extends Command |
|
|
|
* @time :2024/5/16 15:38
|
|
|
|
*/
|
|
|
|
public function updateCategory(){
|
|
|
|
$productModel = new Product();
|
|
|
|
$page = 1;
|
|
|
|
while (true){
|
|
|
|
$productModel = new Product();
|
|
|
|
$productList = $productModel->lists(['status'=>1],$page,1000,'id',['id','category_id']);
|
|
|
|
if(empty($productList)){
|
|
|
|
if(empty($productList) || empty($productList['list'])){
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
foreach ($productList as $v){
|
|
|
|
foreach ($productList['list'] as $v){
|
|
|
|
$categoryRelatedModel = new CategoryRelated();
|
|
|
|
if(empty($v['category_id'])){
|
|
|
|
echo json_encode($v);
|
...
|
...
|
|