正在显示
2 个修改的文件
包含
3 行增加
和
12 行删除
| @@ -59,9 +59,6 @@ class NewsLogic extends BaseLogic | @@ -59,9 +59,6 @@ class NewsLogic extends BaseLogic | ||
| 59 | */ | 59 | */ |
| 60 | public function newsSave() | 60 | public function newsSave() |
| 61 | { | 61 | { |
| 62 | - //拼接参数 | ||
| 63 | -// DB::beginTransaction(); | ||
| 64 | -// try { | ||
| 65 | $this->param = $this->paramProcessing($this->param); | 62 | $this->param = $this->paramProcessing($this->param); |
| 66 | if (isset($this->param['id']) && !empty($this->param['id'])) { | 63 | if (isset($this->param['id']) && !empty($this->param['id'])) { |
| 67 | $id = $this->param['id']; | 64 | $id = $this->param['id']; |
| @@ -79,12 +76,6 @@ class NewsLogic extends BaseLogic | @@ -79,12 +76,6 @@ class NewsLogic extends BaseLogic | ||
| 79 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']); | 76 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']); |
| 80 | $this->edit(['url' => $route], ['id' => $id]); | 77 | $this->edit(['url' => $route], ['id' => $id]); |
| 81 | } | 78 | } |
| 82 | -// //更新路由 | ||
| 83 | -// DB::commit(); | ||
| 84 | -// } catch (\Exception $e) { | ||
| 85 | -// DB::rollBack(); | ||
| 86 | -// $this->fail('系统错误,请联系管理员'); | ||
| 87 | -// } | ||
| 88 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route); | 79 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route); |
| 89 | $this->curlDelRoute(['new_route'=>$route]); | 80 | $this->curlDelRoute(['new_route'=>$route]); |
| 90 | return $this->success(['id'=>$id]); | 81 | return $this->success(['id'=>$id]); |
| @@ -223,10 +214,10 @@ class NewsLogic extends BaseLogic | @@ -223,10 +214,10 @@ class NewsLogic extends BaseLogic | ||
| 223 | */ | 214 | */ |
| 224 | public function getCategory($category){ | 215 | public function getCategory($category){ |
| 225 | $str = ''; | 216 | $str = ''; |
| 226 | - if(is_array($category) && $category){ | ||
| 227 | - $str = ','.implode(',',$category).','; | 217 | + foreach ($category as $v){ |
| 218 | + $str .= $v.','; | ||
| 228 | } | 219 | } |
| 229 | - return $str; | 220 | + return !empty(trim($str,',')) ? ','.$str.',' : ''; |
| 230 | } | 221 | } |
| 231 | 222 | ||
| 232 | /** | 223 | /** |
-
请 注册 或 登录 后发表评论