wesmiler 2 anos atrás
pai
commit
6da98b4acf
1 arquivos alterados com 3 adições e 2 exclusões
  1. 3 2
      app/Console/Commands/SwooleTask.php

+ 3 - 2
app/Console/Commands/SwooleTask.php

@@ -314,8 +314,9 @@ class SwooleTask extends Command
             $time++;
             $cateIds = GoodsCategoryService::make()->getCateIds();
             if($cateIds){
-                foreach($cateIds as $pid){
-                    if(!RedisService::get("caches:task:lock:goods_category_sub_loaded_{$pid}")){
+                foreach($cateIds as $item){
+                    $pid = isset($item['cate_id'])? $item['cate_id'] : 0;
+                    if($pid && !RedisService::get("caches:task:lock:goods_category_sub_loaded_{$pid}")){
                         $taskData = [
                             'taskName' => 'UpdateGoodsCategorySub',
                             'name' => "更新商品分类【{$pid}】的子分类数据",