正在显示
1 个修改的文件
包含
12 行增加
和
6 行删除
| @@ -28,7 +28,8 @@ class NewsCategoryLogic extends BaseLogic | @@ -28,7 +28,8 @@ class NewsCategoryLogic extends BaseLogic | ||
| 28 | */ | 28 | */ |
| 29 | public function get_category_name($v){ | 29 | public function get_category_name($v){ |
| 30 | //获取用户已读还是未读 | 30 | //获取用户已读还是未读 |
| 31 | - $category_info = $this->model->list(['id'=>['in',explode(',',trim($v['category_id'],','))]],'id',['name']); | 31 | + $category_info = $this->model->list([ |
| 32 | + 'id'=>['in',explode(',',trim($v['category_id'],','))]],'id',['name']); | ||
| 32 | $str = ''; | 33 | $str = ''; |
| 33 | foreach ($category_info as $v1){ | 34 | foreach ($category_info as $v1){ |
| 34 | $str .= $v1['name'].','; | 35 | $str .= $v1['name'].','; |
| @@ -64,14 +65,16 @@ class NewsCategoryLogic extends BaseLogic | @@ -64,14 +65,16 @@ class NewsCategoryLogic extends BaseLogic | ||
| 64 | $cate_id = $this->model->insertGetId($this->param); | 65 | $cate_id = $this->model->insertGetId($this->param); |
| 65 | //当父级分类拥有产品时,处理产品 | 66 | //当父级分类拥有产品时,处理产品 |
| 66 | $this->addProcessingSon($cate_id); | 67 | $this->addProcessingSon($cate_id); |
| 67 | - RouteMap::setRoute($this->param['alias'] ?: $this->param['name'], RouteMap::SOURCE_NEWS_CATE, $cate_id, $this->user['project_id']); | 68 | + RouteMap::setRoute($this->param['alias'] ?: $this->param['name'], |
| 69 | + RouteMap::SOURCE_NEWS_CATE, $cate_id, $this->user['project_id']); | ||
| 68 | DB::commit(); | 70 | DB::commit(); |
| 69 | }catch (\Exception $e){ | 71 | }catch (\Exception $e){ |
| 70 | DB::rollBack(); | 72 | DB::rollBack(); |
| 71 | $this->fail('error'); | 73 | $this->fail('error'); |
| 72 | } | 74 | } |
| 73 | //通知更新 | 75 | //通知更新 |
| 74 | - $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_NEWS_CATE, 'route'=>$this->param['alias']]); | 76 | + $this->updateNotify(['project_id'=>$this->user['project_id'], |
| 77 | + 'type'=>RouteMap::SOURCE_NEWS_CATE, 'route'=>$this->param['alias']]); | ||
| 75 | return $this->success(); | 78 | return $this->success(); |
| 76 | } | 79 | } |
| 77 | 80 | ||
| @@ -87,10 +90,12 @@ class NewsCategoryLogic extends BaseLogic | @@ -87,10 +90,12 @@ class NewsCategoryLogic extends BaseLogic | ||
| 87 | //验证是否可编辑 | 90 | //验证是否可编辑 |
| 88 | $this->verifyEditParam(); | 91 | $this->verifyEditParam(); |
| 89 | $this->param['operator_id'] = $this->user['id']; | 92 | $this->param['operator_id'] = $this->user['id']; |
| 90 | - $this->param['alias'] = RouteMap::setRoute($this->param['alias'] ?: $this->param['name'], RouteMap::SOURCE_NEWS_CATE, $this->param['id'], $this->user['project_id']); | 93 | + $this->param['alias'] = RouteMap::setRoute($this->param['alias'] ?: $this->param['name'], |
| 94 | + RouteMap::SOURCE_NEWS_CATE, $this->param['id'], $this->user['project_id']); | ||
| 91 | $this->edit($this->param,['id'=>$this->param['id']]); | 95 | $this->edit($this->param,['id'=>$this->param['id']]); |
| 92 | //通知更新 | 96 | //通知更新 |
| 93 | - $this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_NEWS_CATE, 'route'=>$this->param['alias']]); | 97 | + $this->updateNotify(['project_id'=>$this->user['project_id'], |
| 98 | + 'type'=>RouteMap::SOURCE_NEWS_CATE, 'route'=>$this->param['alias']]); | ||
| 94 | return $this->success(); | 99 | return $this->success(); |
| 95 | } | 100 | } |
| 96 | 101 | ||
| @@ -213,7 +218,8 @@ class NewsCategoryLogic extends BaseLogic | @@ -213,7 +218,8 @@ class NewsCategoryLogic extends BaseLogic | ||
| 213 | $param['create_id'] = $this->user['id']; | 218 | $param['create_id'] = $this->user['id']; |
| 214 | $param['created_at'] = date('Y-m-d H:i:s'); | 219 | $param['created_at'] = date('Y-m-d H:i:s'); |
| 215 | $param['updated_at'] = date('Y-m-d H:i:s'); | 220 | $param['updated_at'] = date('Y-m-d H:i:s'); |
| 216 | - $param['alias'] = RouteMap::generateRoute($param['alias'], RouteMap::SOURCE_NEWS_CATE, $param['id'], $this->user['project_id']); | 221 | + $param['alias'] = RouteMap::generateRoute($param['alias'], |
| 222 | + RouteMap::SOURCE_NEWS_CATE, $param['id'], $this->user['project_id']); | ||
| 217 | return $this->success($param); | 223 | return $this->success($param); |
| 218 | } | 224 | } |
| 219 | 225 |
-
请 注册 或 登录 后发表评论