作者 lyh

gx

@@ -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();