正在显示
4 个修改的文件
包含
40 行增加
和
9 行删除
| @@ -96,6 +96,7 @@ class OptimizeController extends BaseController | @@ -96,6 +96,7 @@ class OptimizeController extends BaseController | ||
| 96 | $select = [ | 96 | $select = [ |
| 97 | 'gl_project.id AS id', | 97 | 'gl_project.id AS id', |
| 98 | 'gl_project.title AS title', | 98 | 'gl_project.title AS title', |
| 99 | + 'gl_project_online_check.level AS level', | ||
| 99 | 'gl_project.channel AS channel', | 100 | 'gl_project.channel AS channel', |
| 100 | 'gl_project.company AS company', | 101 | 'gl_project.company AS company', |
| 101 | 'gl_project.type AS type', | 102 | 'gl_project.type AS type', |
| @@ -111,6 +112,7 @@ class OptimizeController extends BaseController | @@ -111,6 +112,7 @@ class OptimizeController extends BaseController | ||
| 111 | 'gl_project_online_check.go_question AS go_question', | 112 | 'gl_project_online_check.go_question AS go_question', |
| 112 | 'gl_project_online_check.optimist_status AS optimist_status', | 113 | 'gl_project_online_check.optimist_status AS optimist_status', |
| 113 | 'gl_project_online_check.qa_status AS qa_status', | 114 | 'gl_project_online_check.qa_status AS qa_status', |
| 115 | + 'gl_project_online_check.created_at AS online_created_at', | ||
| 114 | 'gl_project_payment.amount AS amount', | 116 | 'gl_project_payment.amount AS amount', |
| 115 | 'gl_project_deploy_build.dept_id AS dept_id', | 117 | 'gl_project_deploy_build.dept_id AS dept_id', |
| 116 | 'gl_project_deploy_build.keyword_num AS key', | 118 | 'gl_project_deploy_build.keyword_num AS key', |
| @@ -148,6 +150,9 @@ class OptimizeController extends BaseController | @@ -148,6 +150,9 @@ class OptimizeController extends BaseController | ||
| 148 | if(isset($this->map['title']) && !empty($this->map['title'])){ | 150 | if(isset($this->map['title']) && !empty($this->map['title'])){ |
| 149 | $query = $query->where('gl_project.title','like','%'.$this->map['title'].'%'); | 151 | $query = $query->where('gl_project.title','like','%'.$this->map['title'].'%'); |
| 150 | } | 152 | } |
| 153 | + if(isset($this->map['level']) && !empty($this->map['level'])){ | ||
| 154 | + $query = $query->whereRaw("FIND_IN_SET(?, gl_project.level) > 0", [$this->map['level']]); | ||
| 155 | + } | ||
| 151 | if(isset($this->map['special']) && !empty($this->map['special'])){ | 156 | if(isset($this->map['special']) && !empty($this->map['special'])){ |
| 152 | $query = $query->where('gl_project_deploy_optimize.special','like','%'.$this->map['special'].'%'); | 157 | $query = $query->where('gl_project_deploy_optimize.special','like','%'.$this->map['special'].'%'); |
| 153 | } | 158 | } |
| @@ -389,13 +389,11 @@ class ProjectController extends BaseController | @@ -389,13 +389,11 @@ class ProjectController extends BaseController | ||
| 389 | 389 | ||
| 390 | 390 | ||
| 391 | /** | 391 | /** |
| 392 | - * 数据源 | ||
| 393 | - * @param ProjectLogic $logic | ||
| 394 | - * @return \Illuminate\Http\JsonResponse | ||
| 395 | - * @throws \Psr\Container\ContainerExceptionInterface | ||
| 396 | - * @throws \Psr\Container\NotFoundExceptionInterface | ||
| 397 | - * @author zbj | ||
| 398 | - * @date 2023/6/20 | 392 | + * @remark :项目相关数据 |
| 393 | + * @name :data_source | ||
| 394 | + * @author :lyh | ||
| 395 | + * @method :post | ||
| 396 | + * @time :2023/12/7 10:41 | ||
| 399 | */ | 397 | */ |
| 400 | public function data_source(ProjectLogic $logic){ | 398 | public function data_source(ProjectLogic $logic){ |
| 401 | $data = $logic->dataSource(); | 399 | $data = $logic->dataSource(); |
| @@ -117,6 +117,8 @@ class CustomModuleCategoryLogic extends BaseLogic | @@ -117,6 +117,8 @@ class CustomModuleCategoryLogic extends BaseLogic | ||
| 117 | $this->addUpdateNotify(RouteMap::SOURCE_MODULE_CATE.$this->param['module_id'],$route); | 117 | $this->addUpdateNotify(RouteMap::SOURCE_MODULE_CATE.$this->param['module_id'],$route); |
| 118 | $this->curlDelRoute(['new_route'=>$route]); | 118 | $this->curlDelRoute(['new_route'=>$route]); |
| 119 | $this->edit(['url' => $route], ['id' => $id]); | 119 | $this->edit(['url' => $route], ['id' => $id]); |
| 120 | + //处理上级分类商品 | ||
| 121 | + $this->handleAddSon($id); | ||
| 120 | }catch (\Exception $e){ | 122 | }catch (\Exception $e){ |
| 121 | $this->fail('系统错误,请联系管理员'); | 123 | $this->fail('系统错误,请联系管理员'); |
| 122 | } | 124 | } |
| @@ -142,6 +144,32 @@ class CustomModuleCategoryLogic extends BaseLogic | @@ -142,6 +144,32 @@ class CustomModuleCategoryLogic extends BaseLogic | ||
| 142 | } | 144 | } |
| 143 | 145 | ||
| 144 | /** | 146 | /** |
| 147 | + * @remark :编辑分类,处理博客数据 | ||
| 148 | + * @name :editCategory | ||
| 149 | + * @author :lyh | ||
| 150 | + * @method :post | ||
| 151 | + * @time :2023/10/20 9:32 | ||
| 152 | + */ | ||
| 153 | + public function editHandleCategory($id,$pid){ | ||
| 154 | + $info = $this->model->read(['id'=>$id],['id','pid']); | ||
| 155 | + if($info['pid'] != $pid){ | ||
| 156 | + //修改勒上级,先查看上级是否拥有博客 | ||
| 157 | + $contentModel = new CustomModuleContent(); | ||
| 158 | + $newsCount = $contentModel->formatQuery(['category_id'=>['like','%,'.$pid.',%']])->count(); | ||
| 159 | + //随机获取最后一级id | ||
| 160 | + $replacement = $this->getLastId($id); | ||
| 161 | + if($newsCount > 0){ | ||
| 162 | + //存在博客时,移动所有博客到当前分类最后一级 | ||
| 163 | + $newsCount->where('category_id', 'like', '%,' . $pid . ',%')->where('category_id', 'like', '%,' . $replacement . ',%') | ||
| 164 | + ->update(['category_id' => DB::raw("REPLACE(category_id, ',$pid,', ',')")]); | ||
| 165 | + $newsCount->where('category_id', 'like', '%,' . $pid . ',%') | ||
| 166 | + ->update(['category_id' => DB::raw("REPLACE(category_id, ',$pid,', ',$replacement,')")]); | ||
| 167 | + } | ||
| 168 | + } | ||
| 169 | + return $this->success(); | ||
| 170 | + } | ||
| 171 | + | ||
| 172 | + /** | ||
| 145 | * @remark :查看是否编辑路由 | 173 | * @remark :查看是否编辑路由 |
| 146 | * @name :editCategoryRoute | 174 | * @name :editCategoryRoute |
| 147 | * @author :lyh | 175 | * @author :lyh |
| @@ -87,9 +87,9 @@ class NewsCategoryLogic extends BaseLogic | @@ -87,9 +87,9 @@ class NewsCategoryLogic extends BaseLogic | ||
| 87 | $replacement = $this->getLastId($id); | 87 | $replacement = $this->getLastId($id); |
| 88 | if($newsCount > 0){ | 88 | if($newsCount > 0){ |
| 89 | //存在博客时,移动所有博客到当前分类最后一级 | 89 | //存在博客时,移动所有博客到当前分类最后一级 |
| 90 | - $newsCount->where('category_id', 'like', '%,' . $pid . ',%')->where('category_id', 'like', '%,' . $replacement . ',%') | 90 | + $newsModel->where('category_id', 'like', '%,' . $pid . ',%')->where('category_id', 'like', '%,' . $replacement . ',%') |
| 91 | ->update(['category_id' => DB::raw("REPLACE(category_id, ',$pid,', ',')")]); | 91 | ->update(['category_id' => DB::raw("REPLACE(category_id, ',$pid,', ',')")]); |
| 92 | - $newsCount->where('category_id', 'like', '%,' . $pid . ',%') | 92 | + $newsModel->where('category_id', 'like', '%,' . $pid . ',%') |
| 93 | ->update(['category_id' => DB::raw("REPLACE(category_id, ',$pid,', ',$replacement,')")]); | 93 | ->update(['category_id' => DB::raw("REPLACE(category_id, ',$pid,', ',$replacement,')")]); |
| 94 | } | 94 | } |
| 95 | } | 95 | } |
-
请 注册 或 登录 后发表评论