正在显示
1 个修改的文件
包含
2 行增加
和
7 行删除
| @@ -442,16 +442,11 @@ class NewsLogic extends BaseLogic | @@ -442,16 +442,11 @@ 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); | ||
| 446 | $category_ids = explode(',',trim($newsInfo['category_id'],',')); | 445 | $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); | ||
| 449 | $category_ids_arr = array_values(array_unique(array_merge($category_ids,$this->param['category_id']))); | 446 | $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); | ||
| 451 | $category_ids = ','.implode(',',$category_ids_arr).','; | 447 | $category_ids = ','.implode(',',$category_ids_arr).','; |
| 452 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($category_ids, true) . PHP_EOL, FILE_APPEND); | ||
| 453 | - @file_put_contents(storage_path('logs/lyh_error.log'), var_export($id, true) . PHP_EOL, FILE_APPEND); | ||
| 454 | - $this->model->edit(['category_id'=>$category_ids],['id'=>$id]); | 448 | + $rs = $this->model->edit(['category_id'=>$category_ids],['id'=>$id]); |
| 449 | + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($rs, true) . PHP_EOL, FILE_APPEND); | ||
| 455 | } | 450 | } |
| 456 | } | 451 | } |
| 457 | }catch (\Exception $e){ | 452 | }catch (\Exception $e){ |
-
请 注册 或 登录 后发表评论