作者 lyh

gx

... ... @@ -59,9 +59,6 @@ class NewsLogic extends BaseLogic
*/
public function newsSave()
{
//拼接参数
// DB::beginTransaction();
// try {
$this->param = $this->paramProcessing($this->param);
if (isset($this->param['id']) && !empty($this->param['id'])) {
$id = $this->param['id'];
... ... @@ -79,12 +76,6 @@ class NewsLogic extends BaseLogic
$route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']);
$this->edit(['url' => $route], ['id' => $id]);
}
// //更新路由
// DB::commit();
// } catch (\Exception $e) {
// DB::rollBack();
// $this->fail('系统错误,请联系管理员');
// }
$this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route);
$this->curlDelRoute(['new_route'=>$route]);
return $this->success(['id'=>$id]);
... ... @@ -223,10 +214,10 @@ class NewsLogic extends BaseLogic
*/
public function getCategory($category){
$str = '';
if(is_array($category) && $category){
$str = ','.implode(',',$category).',';
foreach ($category as $v){
$str .= $v.',';
}
return $str;
return !empty(trim($str,',')) ? ','.$str.',' : '';
}
/**
... ...