正在显示
1 个修改的文件
包含
4 行增加
和
0 行删除
| @@ -442,8 +442,12 @@ class NewsLogic extends BaseLogic | @@ -442,8 +442,12 @@ class NewsLogic extends BaseLogic | ||
| 442 | foreach ($this->param['id'] as $id){ | 442 | foreach ($this->param['id'] as $id){ |
| 443 | //获取当前产品的分类 | 443 | //获取当前产品的分类 |
| 444 | $newsInfo = $this->model->read(['id'=>$id],['id','category_id']); | 444 | $newsInfo = $this->model->read(['id'=>$id],['id','category_id']); |
| 445 | + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($newsInfo, true) . PHP_EOL, FILE_APPEND); | ||
| 445 | $category_ids = explode(',',trim($newsInfo['category_id'],',')); | 446 | $category_ids = explode(',',trim($newsInfo['category_id'],',')); |
| 447 | + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($category_ids, true) . PHP_EOL, FILE_APPEND); | ||
| 448 | + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($this->param['category_id'], true) . PHP_EOL, FILE_APPEND); | ||
| 446 | $category_ids_arr = array_values(array_unique(array_merge($category_ids,$this->param['category_id']))); | 449 | $category_ids_arr = array_values(array_unique(array_merge($category_ids,$this->param['category_id']))); |
| 450 | + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($category_ids_arr, true) . PHP_EOL, FILE_APPEND); | ||
| 447 | $category_ids = ','.implode(',',$category_ids_arr).','; | 451 | $category_ids = ','.implode(',',$category_ids_arr).','; |
| 448 | $this->model->edit(['category_id'=>$category_ids],['id'=>$id]); | 452 | $this->model->edit(['category_id'=>$category_ids],['id'=>$id]); |
| 449 | } | 453 | } |
-
请 注册 或 登录 后发表评论