正在显示
1 个修改的文件
包含
2 行增加
和
4 行删除
| @@ -55,7 +55,7 @@ class UpdateProductCategory extends Command | @@ -55,7 +55,7 @@ class UpdateProductCategory extends Command | ||
| 55 | foreach ($list as $v) { | 55 | foreach ($list as $v) { |
| 56 | echo date('Y-m-d H:i:s') . ' start: ' . $v['id'] . PHP_EOL; | 56 | echo date('Y-m-d H:i:s') . ' start: ' . $v['id'] . PHP_EOL; |
| 57 | ProjectServer::useProject($v['id']); | 57 | ProjectServer::useProject($v['id']); |
| 58 | - $this->getUpdateProductCategory($v['id']); | 58 | + $this->getUpdateProductCategory(); |
| 59 | DB::disconnect('custom_mysql'); | 59 | DB::disconnect('custom_mysql'); |
| 60 | } | 60 | } |
| 61 | }catch (\Exception $e){ | 61 | }catch (\Exception $e){ |
| @@ -89,9 +89,7 @@ class UpdateProductCategory extends Command | @@ -89,9 +89,7 @@ class UpdateProductCategory extends Command | ||
| 89 | * @method :post | 89 | * @method :post |
| 90 | * @time :2023/12/6 16:20 | 90 | * @time :2023/12/6 16:20 |
| 91 | */ | 91 | */ |
| 92 | - public function handleCategory($id,$category){ | ||
| 93 | - $category = trim($category,','); | ||
| 94 | - $cate_arr = explode(',',$category); | 92 | + public function handleCategory($id,$cate_arr){ |
| 95 | if(!empty($cate_arr) && is_array($cate_arr)){ | 93 | if(!empty($cate_arr) && is_array($cate_arr)){ |
| 96 | foreach ($cate_arr as $v){ | 94 | foreach ($cate_arr as $v){ |
| 97 | $categoryModel = new Category(); | 95 | $categoryModel = new Category(); |
-
请 注册 或 登录 后发表评论