|
...
|
...
|
@@ -75,6 +75,9 @@ class BlogLogic extends BaseLogic |
|
|
|
$this->param['image'] = $data;
|
|
|
|
}
|
|
|
|
$rs = $this->model->insertGetId($this->param);
|
|
|
|
//分类计数
|
|
|
|
$category_data = explode(',',trim($this->param['category_id'],','));
|
|
|
|
$this->set_num(BlogCategoryModel::class,$category_data);
|
|
|
|
RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $rs, $this->user['project_id']);
|
|
|
|
DB::commit();
|
|
|
|
}catch (\Exception $e){
|
|
...
|
...
|
@@ -86,6 +89,21 @@ class BlogLogic extends BaseLogic |
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param $category_id
|
|
|
|
* @name :产品计数
|
|
|
|
* @return bool
|
|
|
|
* @author :liyuhang
|
|
|
|
* @method
|
|
|
|
*/
|
|
|
|
public function category_set_num($category_id){
|
|
|
|
$category_data = explode(',',trim($category_id,','));
|
|
|
|
foreach ($category_data as $v){
|
|
|
|
BlogCategoryModel::where('id',$v)->increment('num');
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @name : 编辑博客
|
|
|
|
* @return void
|
|
|
|
* @author :liyuhang
|
|
...
|
...
|
@@ -192,6 +210,7 @@ class BlogLogic extends BaseLogic |
|
|
|
$ids = $this->param['id'];
|
|
|
|
$this->param['id'] = ['in',$this->param['id']];
|
|
|
|
$this->del($this->param,$ids);
|
|
|
|
$this->set_num(BlogCategoryModel::class,'id','del',count($ids));
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|