Merge remote-tracking branch 'origin/master' into akun
正在显示
34 个修改的文件
包含
251 行增加
和
109 行删除
| @@ -63,7 +63,7 @@ class DeleteBlogCategory extends Command | @@ -63,7 +63,7 @@ class DeleteBlogCategory extends Command | ||
| 63 | $noticeLogModel = new NoticeLog(); | 63 | $noticeLogModel = new NoticeLog(); |
| 64 | $list = $noticeLogModel->list(['status'=>NoticeLog::STATUS_PENDING,'type'=>NoticeLog::DELETE_BLOG_CATEGORY],'id',['*'],'asc',100); | 64 | $list = $noticeLogModel->list(['status'=>NoticeLog::STATUS_PENDING,'type'=>NoticeLog::DELETE_BLOG_CATEGORY],'id',['*'],'asc',100); |
| 65 | if(empty($list)){ | 65 | if(empty($list)){ |
| 66 | - sleep(100); | 66 | + sleep(10); |
| 67 | continue; | 67 | continue; |
| 68 | } | 68 | } |
| 69 | foreach ($list as $item){ | 69 | foreach ($list as $item){ |
| @@ -63,7 +63,7 @@ class DeleteCustomCategory extends Command | @@ -63,7 +63,7 @@ class DeleteCustomCategory extends Command | ||
| 63 | $noticeLogModel = new NoticeLog(); | 63 | $noticeLogModel = new NoticeLog(); |
| 64 | $list = $noticeLogModel->list(['status'=>NoticeLog::STATUS_PENDING,'type'=>NoticeLog::DELETE_CUSTOM_CATEGORY],'id',['*'],'asc',100); | 64 | $list = $noticeLogModel->list(['status'=>NoticeLog::STATUS_PENDING,'type'=>NoticeLog::DELETE_CUSTOM_CATEGORY],'id',['*'],'asc',100); |
| 65 | if(empty($list)){ | 65 | if(empty($list)){ |
| 66 | - sleep(100); | 66 | + sleep(10); |
| 67 | continue; | 67 | continue; |
| 68 | } | 68 | } |
| 69 | foreach ($list as $item){ | 69 | foreach ($list as $item){ |
| @@ -63,7 +63,7 @@ class DeleteNewsCategory extends Command | @@ -63,7 +63,7 @@ class DeleteNewsCategory extends Command | ||
| 63 | $noticeLogModel = new NoticeLog(); | 63 | $noticeLogModel = new NoticeLog(); |
| 64 | $list = $noticeLogModel->list(['status'=>NoticeLog::STATUS_PENDING,'type'=>NoticeLog::DELETE_NEWS_CATEGORY],'id',['*'],'asc',100); | 64 | $list = $noticeLogModel->list(['status'=>NoticeLog::STATUS_PENDING,'type'=>NoticeLog::DELETE_NEWS_CATEGORY],'id',['*'],'asc',100); |
| 65 | if(empty($list)){ | 65 | if(empty($list)){ |
| 66 | - sleep(100); | 66 | + sleep(10); |
| 67 | continue; | 67 | continue; |
| 68 | } | 68 | } |
| 69 | foreach ($list as $item){ | 69 | foreach ($list as $item){ |
| @@ -64,7 +64,7 @@ class DeleteProductCategory extends Command | @@ -64,7 +64,7 @@ class DeleteProductCategory extends Command | ||
| 64 | $noticeLogModel = new NoticeLog(); | 64 | $noticeLogModel = new NoticeLog(); |
| 65 | $list = $noticeLogModel->list(['status'=>NoticeLog::STATUS_PENDING,'type'=>NoticeLog::DELETE_PRODUCT_CATEGORY],'id',['*'],'asc',100); | 65 | $list = $noticeLogModel->list(['status'=>NoticeLog::STATUS_PENDING,'type'=>NoticeLog::DELETE_PRODUCT_CATEGORY],'id',['*'],'asc',100); |
| 66 | if(empty($list)){ | 66 | if(empty($list)){ |
| 67 | - sleep(100); | 67 | + sleep(10); |
| 68 | continue; | 68 | continue; |
| 69 | } | 69 | } |
| 70 | foreach ($list as $item){ | 70 | foreach ($list as $item){ |
| @@ -119,14 +119,18 @@ class VideoTask extends Command | @@ -119,14 +119,18 @@ class VideoTask extends Command | ||
| 119 | 'updated_at' => date('Y-m-d H:i:s'), | 119 | 'updated_at' => date('Y-m-d H:i:s'), |
| 120 | 'created_at' => date('Y-m-d H:i:s'), | 120 | 'created_at' => date('Y-m-d H:i:s'), |
| 121 | ]; | 121 | ]; |
| 122 | - KeywordVideoTaskLog::insert($array); | ||
| 123 | - $num--; | ||
| 124 | - $sub_task_num--; | 122 | + $rs = KeywordVideoTaskLog::insert($array); |
| 123 | + if($rs){ | ||
| 124 | + $num--; | ||
| 125 | + $sub_task_num--; | ||
| 126 | + } | ||
| 125 | } | 127 | } |
| 126 | } | 128 | } |
| 127 | if($sub_task_num != 0){ | 129 | if($sub_task_num != 0){ |
| 128 | - $task_project->num = 0; | ||
| 129 | - $task_project->status = KeywordVideoTask::STATUS_CLOSE; | 130 | + $task_project->num = $num; |
| 131 | + if($num == 0){ | ||
| 132 | + $task_project->status = KeywordVideoTask::STATUS_CLOSE; | ||
| 133 | + } | ||
| 130 | $task_project->save(); | 134 | $task_project->save(); |
| 131 | } | 135 | } |
| 132 | } | 136 | } |
| @@ -184,10 +188,11 @@ class VideoTask extends Command | @@ -184,10 +188,11 @@ class VideoTask extends Command | ||
| 184 | if(count($keyword_arr_id) == 0){ | 188 | if(count($keyword_arr_id) == 0){ |
| 185 | return []; | 189 | return []; |
| 186 | } | 190 | } |
| 187 | - if(count($keyword_arr_id) < $number){ | ||
| 188 | - $number = count($keyword_arr_id); | 191 | + if(count($keyword_arr_id) <= $number){ |
| 192 | + $keyword_id = array_rand($keyword_arr_id, count($keyword_arr_id)); | ||
| 193 | + }else{ | ||
| 194 | + $keyword_id = array_rand($keyword_arr_id, $number); | ||
| 189 | } | 195 | } |
| 190 | - $keyword_id = array_rand($keyword_arr_id, $number); | ||
| 191 | $keyword = Keyword::whereIn("id", $keyword_id)->get(); | 196 | $keyword = Keyword::whereIn("id", $keyword_id)->get(); |
| 192 | return $keyword; | 197 | return $keyword; |
| 193 | } | 198 | } |
| @@ -63,7 +63,7 @@ class ReplaceHtml extends Command | @@ -63,7 +63,7 @@ class ReplaceHtml extends Command | ||
| 63 | $replaceHtmlModel = new TemplateReplaceHtml(); | 63 | $replaceHtmlModel = new TemplateReplaceHtml(); |
| 64 | $replaceHtmlList = $replaceHtmlModel->list(['status'=>$replaceHtmlModel::STATUS]); | 64 | $replaceHtmlList = $replaceHtmlModel->list(['status'=>$replaceHtmlModel::STATUS]); |
| 65 | if(empty($replaceHtmlList)){ | 65 | if(empty($replaceHtmlList)){ |
| 66 | - sleep(100); | 66 | + sleep(20); |
| 67 | continue; | 67 | continue; |
| 68 | } | 68 | } |
| 69 | foreach ($replaceHtmlList as $v){ | 69 | foreach ($replaceHtmlList as $v){ |
| @@ -79,7 +79,7 @@ class ReplaceHtml extends Command | @@ -79,7 +79,7 @@ class ReplaceHtml extends Command | ||
| 79 | echo '结束'.PHP_EOL; | 79 | echo '结束'.PHP_EOL; |
| 80 | DB::disconnect('custom_mysql'); | 80 | DB::disconnect('custom_mysql'); |
| 81 | } | 81 | } |
| 82 | - sleep(50); | 82 | + sleep(10); |
| 83 | return true; | 83 | return true; |
| 84 | } | 84 | } |
| 85 | } | 85 | } |
| @@ -131,6 +131,7 @@ class ReplaceHtml extends Command | @@ -131,6 +131,7 @@ class ReplaceHtml extends Command | ||
| 131 | $templateHtmlLogModel = new TemplateReplaceHtmlLog(); | 131 | $templateHtmlLogModel = new TemplateReplaceHtmlLog(); |
| 132 | $list = $templateHtmlLogModel->list(['replace_id'=>$info['rollback_id']]); | 132 | $list = $templateHtmlLogModel->list(['replace_id'=>$info['rollback_id']]); |
| 133 | foreach ($list as $value){ | 133 | foreach ($list as $value){ |
| 134 | + unset($value['id']); | ||
| 134 | $value['replace_id'] = $info['id']; | 135 | $value['replace_id'] = $info['id']; |
| 135 | $value['is_rollback'] = $info['is_rollback']; | 136 | $value['is_rollback'] = $info['is_rollback']; |
| 136 | $value['old_html'] = $info['old_html']; | 137 | $value['old_html'] = $info['old_html']; |
| @@ -155,7 +156,9 @@ class ReplaceHtml extends Command | @@ -155,7 +156,9 @@ class ReplaceHtml extends Command | ||
| 155 | foreach ($bTemplateList as $v){ | 156 | foreach ($bTemplateList as $v){ |
| 156 | $source_id = $v['source'] == 1 ? 0 : $v['source_id']; | 157 | $source_id = $v['source'] == 1 ? 0 : $v['source_id']; |
| 157 | $name_route = $this->getSourceName($v['source'],$source_id,$v['is_list'],$v['is_custom']); | 158 | $name_route = $this->getSourceName($v['source'],$source_id,$v['is_list'],$v['is_custom']); |
| 158 | - $saveData[] = $this->saveData($info,$v,$source_id,$name_route); | 159 | + if($name_route !== false){ |
| 160 | + $saveData[] = $this->saveData($info,$v,$source_id,$name_route); | ||
| 161 | + } | ||
| 159 | } | 162 | } |
| 160 | } | 163 | } |
| 161 | if(!empty($saveData)){ | 164 | if(!empty($saveData)){ |
| @@ -204,7 +207,7 @@ class ReplaceHtml extends Command | @@ -204,7 +207,7 @@ class ReplaceHtml extends Command | ||
| 204 | return $this->getCustomName($source,$source_id,$is_list); | 207 | return $this->getCustomName($source,$source_id,$is_list); |
| 205 | } | 208 | } |
| 206 | if($source == BTemplate::SOURCE_HOME){ | 209 | if($source == BTemplate::SOURCE_HOME){ |
| 207 | - return ''; | 210 | + return ['name'=>'','route'=>''];; |
| 208 | }elseif ($source == BTemplate::SOURCE_PRODUCT){ | 211 | }elseif ($source == BTemplate::SOURCE_PRODUCT){ |
| 209 | return $this->getProductName($source_id,$is_list); | 212 | return $this->getProductName($source_id,$is_list); |
| 210 | }elseif ($source == BTemplate::SOURCE_BLOG){ | 213 | }elseif ($source == BTemplate::SOURCE_BLOG){ |
| @@ -42,27 +42,27 @@ class Demo extends Command | @@ -42,27 +42,27 @@ class Demo extends Command | ||
| 42 | { | 42 | { |
| 43 | $this->param['project_id'] = 181; | 43 | $this->param['project_id'] = 181; |
| 44 | $imageModel = new ImageModel(); | 44 | $imageModel = new ImageModel(); |
| 45 | -// //获取当前项目的所有图片 | ||
| 46 | -// $imageList = $imageModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos','size']); | ||
| 47 | -// if(!empty($imageList)){ | ||
| 48 | -// $amazonS3Service = new AmazonS3Service(); | ||
| 49 | -// foreach ($imageList as $k => $v){ | ||
| 50 | -// $amazonS3Service->syncImageFiles(getImageUrl($v['path'])); | ||
| 51 | -// $imageModel->edit(['is_cos'=>0],['id'=>$v['id']]); | ||
| 52 | -// } | ||
| 53 | -// } | ||
| 54 | - | ||
| 55 | - $fileModel = new FileModel(); | ||
| 56 | - $fileList = $fileModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos','name']); | ||
| 57 | - if(!empty($fileList)){ | 45 | + //获取当前项目的所有图片 |
| 46 | + $imageList = $imageModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos','size']); | ||
| 47 | + if(!empty($imageList)){ | ||
| 58 | $amazonS3Service = new AmazonS3Service(); | 48 | $amazonS3Service = new AmazonS3Service(); |
| 59 | - foreach ($fileList as $k => $v){ | ||
| 60 | - echo date('Y-m-d H:i:s') . '执行的数据id:' . $v['id'] . '名称:'.$v['name'] . PHP_EOL; | ||
| 61 | - $amazonS3Service->syncImageFiles(getFileUrl($v['path'])); | ||
| 62 | - $fileModel->edit(['is_cos'=>0],['id'=>$v['id']]); | ||
| 63 | - gc_collect_cycles(); | 49 | + foreach ($imageList as $k => $v){ |
| 50 | + $amazonS3Service->syncImageFiles(getImageUrl($v['path'])); | ||
| 51 | + $imageModel->edit(['is_cos'=>0],['id'=>$v['id']]); | ||
| 64 | } | 52 | } |
| 65 | } | 53 | } |
| 54 | + | ||
| 55 | +// $fileModel = new FileModel(); | ||
| 56 | +// $fileList = $fileModel->list(['project_id'=>$this->param['project_id'],'is_cos'=>1],'id',['id','path','is_cos','name']); | ||
| 57 | +// if(!empty($fileList)){ | ||
| 58 | +// $amazonS3Service = new AmazonS3Service(); | ||
| 59 | +// foreach ($fileList as $k => $v){ | ||
| 60 | +// echo date('Y-m-d H:i:s') . '执行的数据id:' . $v['id'] . '名称:'.$v['name'] . PHP_EOL; | ||
| 61 | +// $amazonS3Service->syncImageFiles(getFileUrl($v['path'])); | ||
| 62 | +// $fileModel->edit(['is_cos'=>0],['id'=>$v['id']]); | ||
| 63 | +// gc_collect_cycles(); | ||
| 64 | +// } | ||
| 65 | +// } | ||
| 66 | return true; | 66 | return true; |
| 67 | } | 67 | } |
| 68 | 68 |
| @@ -39,7 +39,6 @@ class CustomModuleController extends BaseController | @@ -39,7 +39,6 @@ class CustomModuleController extends BaseController | ||
| 39 | $this->response('success'); | 39 | $this->response('success'); |
| 40 | } | 40 | } |
| 41 | $customModule = new CustomModule(); | 41 | $customModule = new CustomModule(); |
| 42 | - $this->map['status'] = 0; | ||
| 43 | $lists = $customModule->lists($this->map,$this->page,$this->row,$this->order = ['topping_time','sort','id']); | 42 | $lists = $customModule->lists($this->map,$this->page,$this->row,$this->order = ['topping_time','sort','id']); |
| 44 | DB::disconnect('custom_mysql'); | 43 | DB::disconnect('custom_mysql'); |
| 45 | $this->response('success',Code::SUCCESS,$lists); | 44 | $this->response('success',Code::SUCCESS,$lists); |
| @@ -245,4 +245,20 @@ class ATemplateController extends BaseController | @@ -245,4 +245,20 @@ class ATemplateController extends BaseController | ||
| 245 | $this->response('success',Code::SUCCESS,$lists); | 245 | $this->response('success',Code::SUCCESS,$lists); |
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | + /** | ||
| 249 | + * @remark :修改审核状态 | ||
| 250 | + * @name :auditingStatus | ||
| 251 | + * @author :lyh | ||
| 252 | + * @method :post | ||
| 253 | + * @time :2024/5/23 16:42 | ||
| 254 | + */ | ||
| 255 | + public function auditingStatus(ATemplateLogic $aTemplateLogic){ | ||
| 256 | + $this->request->validate([ | ||
| 257 | + 'id'=>'required' | ||
| 258 | + ],[ | ||
| 259 | + 'id.required' => 'ID不能为空' | ||
| 260 | + ]); | ||
| 261 | + $data = $aTemplateLogic->auditingStatus(); | ||
| 262 | + $this->response('success',Code::SUCCESS,$data); | ||
| 263 | + } | ||
| 248 | } | 264 | } |
| @@ -25,9 +25,6 @@ class ATemplateModuleController extends BaseController | @@ -25,9 +25,6 @@ class ATemplateModuleController extends BaseController | ||
| 25 | * @time :2023/6/28 16:54 | 25 | * @time :2023/6/28 16:54 |
| 26 | */ | 26 | */ |
| 27 | public function lists(ATemplateModuleLogic $ATemplateModuleLogic){ | 27 | public function lists(ATemplateModuleLogic $ATemplateModuleLogic){ |
| 28 | - if(isset($this->map['type']) && ($this->map['type'] == 99)){ | ||
| 29 | - $this->map['type'] = 99; | ||
| 30 | - } | ||
| 31 | $lists = $ATemplateModuleLogic->aTemplateModuleLists($this->map,$this->page,$this->row,$this->order); | 28 | $lists = $ATemplateModuleLogic->aTemplateModuleLists($this->map,$this->page,$this->row,$this->order); |
| 32 | $this->response('success',Code::SUCCESS,$lists); | 29 | $this->response('success',Code::SUCCESS,$lists); |
| 33 | } | 30 | } |
| @@ -13,6 +13,7 @@ use App\Enums\Common\Code; | @@ -13,6 +13,7 @@ use App\Enums\Common\Code; | ||
| 13 | use App\Http\Controllers\Aside\BaseController; | 13 | use App\Http\Controllers\Aside\BaseController; |
| 14 | use App\Http\Logic\Aside\Template\ReplaceHtmlLogic; | 14 | use App\Http\Logic\Aside\Template\ReplaceHtmlLogic; |
| 15 | use App\Models\Manage\Manage; | 15 | use App\Models\Manage\Manage; |
| 16 | +use App\Models\Project\DeployBuild; | ||
| 16 | use App\Models\Project\Project; | 17 | use App\Models\Project\Project; |
| 17 | use App\Models\Template\TemplateReplaceHtml; | 18 | use App\Models\Template\TemplateReplaceHtml; |
| 18 | use App\Models\Template\TemplateReplaceHtmlLog; | 19 | use App\Models\Template\TemplateReplaceHtmlLog; |
| @@ -71,7 +72,7 @@ class ReplaceHtmlController extends BaseController | @@ -71,7 +72,7 @@ class ReplaceHtmlController extends BaseController | ||
| 71 | foreach ($lists['list'] as $k => $v){ | 72 | foreach ($lists['list'] as $k => $v){ |
| 72 | $v['project_name'] = (new Project())->getProjectName($v['project_id']); | 73 | $v['project_name'] = (new Project())->getProjectName($v['project_id']); |
| 73 | $v['operator_name'] = (new Manage())->getName($v['operator_id']); | 74 | $v['operator_name'] = (new Manage())->getName($v['operator_id']); |
| 74 | - $v['source_name'] = $logic->getSourceName($v['source'],$v['is_list'],$v['is_custom'],$v['project_id']); | 75 | + $v['page_name'] = $logic->getSourceName($v['source'],$v['is_list'],$v['is_custom'],$v['project_id']); |
| 75 | $lists['list'][$k] = $v; | 76 | $lists['list'][$k] = $v; |
| 76 | } | 77 | } |
| 77 | } | 78 | } |
| @@ -92,6 +93,19 @@ class ReplaceHtmlController extends BaseController | @@ -92,6 +93,19 @@ class ReplaceHtmlController extends BaseController | ||
| 92 | 'replace_id.required' => '主id不能为空', | 93 | 'replace_id.required' => '主id不能为空', |
| 93 | ]); | 94 | ]); |
| 94 | $lists = $replaceHtmlLog->lists($this->map,$this->page,$this->row,$this->order); | 95 | $lists = $replaceHtmlLog->lists($this->map,$this->page,$this->row,$this->order); |
| 96 | + $projectModel = new DeployBuild(); | ||
| 97 | + $domain = ''; | ||
| 98 | + if(!empty($lists) && !empty($lists['list'])){ | ||
| 99 | + foreach ($lists['list'] as $k => $v){ | ||
| 100 | + if($k == 0){ | ||
| 101 | + $projectInfo = $projectModel->read(['project_id'=>$v['project_id']]); | ||
| 102 | + $domain = $projectInfo['test_domain']; | ||
| 103 | + } | ||
| 104 | + $v['page_name'] = $logic->getSourceName($v['source'],$v['is_list'],$v['is_custom'],$v['project_id']); | ||
| 105 | + $v['route'] = $domain.$v['route']; | ||
| 106 | + $lists['list'][$k] = $v; | ||
| 107 | + } | ||
| 108 | + } | ||
| 95 | $this->response('success',Code::SUCCESS,$lists); | 109 | $this->response('success',Code::SUCCESS,$lists); |
| 96 | } | 110 | } |
| 97 | 111 |
| @@ -101,13 +101,6 @@ class ProjectUserController extends BaseController | @@ -101,13 +101,6 @@ class ProjectUserController extends BaseController | ||
| 101 | */ | 101 | */ |
| 102 | public function save(UserRequest $request,UserLogic $userLogic){ | 102 | public function save(UserRequest $request,UserLogic $userLogic){ |
| 103 | $request->validated(); | 103 | $request->validated(); |
| 104 | - if(!isset($this->param['id'])){ | ||
| 105 | - $this->request->validate([ | ||
| 106 | - 'password'=>'required', | ||
| 107 | - ],[ | ||
| 108 | - 'password.required' => '密码不能为空', | ||
| 109 | - ]); | ||
| 110 | - } | ||
| 111 | $userLogic->projectUserSave(); | 104 | $userLogic->projectUserSave(); |
| 112 | $this->response('success'); | 105 | $this->response('success'); |
| 113 | } | 106 | } |
| @@ -64,8 +64,16 @@ class FileManageController extends BaseController | @@ -64,8 +64,16 @@ class FileManageController extends BaseController | ||
| 64 | * @time :2023/12/28 17:18 | 64 | * @time :2023/12/28 17:18 |
| 65 | */ | 65 | */ |
| 66 | public function downLoad(){ | 66 | public function downLoad(){ |
| 67 | + if(!isset($this->param['path']) || empty($this->param['path'])){ | ||
| 68 | + $this->response('参数错误',Code::SYSTEM_ERROR); | ||
| 69 | + } | ||
| 67 | $username = basename($this->param['path']); | 70 | $username = basename($this->param['path']); |
| 68 | - $fileUrl = 'https://file.globalso.com'.$this->param['path']; | 71 | + $parsed_url = parse_url($this->param['path']); |
| 72 | + if(isset($parsed_url['scheme'])){ | ||
| 73 | + $fileUrl = $this->param['path']; | ||
| 74 | + } else { | ||
| 75 | + $fileUrl = 'https://file.globalso.com'.$this->param['path']; | ||
| 76 | + } | ||
| 69 | // 设置响应头 | 77 | // 设置响应头 |
| 70 | header('Content-Description: File Transfer'); | 78 | header('Content-Description: File Transfer'); |
| 71 | header('Content-Type: application/octet-stream'); | 79 | header('Content-Type: application/octet-stream'); |
| @@ -8,6 +8,7 @@ use App\Http\Logic\Bside\BTemplate\BTemplateLogic; | @@ -8,6 +8,7 @@ use App\Http\Logic\Bside\BTemplate\BTemplateLogic; | ||
| 8 | use App\Http\Requests\Bside\Template\TemplateRequest; | 8 | use App\Http\Requests\Bside\Template\TemplateRequest; |
| 9 | use App\Models\Template\BTemplate; | 9 | use App\Models\Template\BTemplate; |
| 10 | use App\Models\Template\Setting; | 10 | use App\Models\Template\Setting; |
| 11 | +use App\Models\Template\Template; | ||
| 11 | 12 | ||
| 12 | class BTemplateController extends BaseController | 13 | class BTemplateController extends BaseController |
| 13 | { | 14 | { |
| @@ -159,15 +160,21 @@ class BTemplateController extends BaseController | @@ -159,15 +160,21 @@ class BTemplateController extends BaseController | ||
| 159 | } | 160 | } |
| 160 | 161 | ||
| 161 | /** | 162 | /** |
| 162 | - * @remark :获取source类型 | ||
| 163 | - * @name :getSource | 163 | + * @remark :选择内页模版 |
| 164 | + * @name :setPublicTemplate | ||
| 164 | * @author :lyh | 165 | * @author :lyh |
| 165 | * @method :post | 166 | * @method :post |
| 166 | - * @time :2024/1/3 9:06 | 167 | + * @time :2024/5/24 15:08 |
| 167 | */ | 168 | */ |
| 168 | - public function getSource(){ | ||
| 169 | - $bTemplateModel = new BTemplate(); | ||
| 170 | - $info = $bTemplateModel->sourceMap(); | ||
| 171 | - $this->response('success',Code::SUCCESS,$info); | 169 | + public function setPublicTemplate(BTemplateLogic $BTemplateLogic){ |
| 170 | + $this->request->validate([ | ||
| 171 | + 'id'=>'required', | ||
| 172 | + 'template_id'=>'required', | ||
| 173 | + ],[ | ||
| 174 | + 'id.required' => '当前数据id不能为空', | ||
| 175 | + 'template_id.required' => '模版id不能为空', | ||
| 176 | + ]); | ||
| 177 | + $BTemplateLogic->setCustomTemplate(); | ||
| 178 | + $this->response('保存成功'); | ||
| 172 | } | 179 | } |
| 173 | } | 180 | } |
| @@ -42,7 +42,8 @@ class BTemplateLogController extends BaseController | @@ -42,7 +42,8 @@ class BTemplateLogController extends BaseController | ||
| 42 | $userModel = new User(); | 42 | $userModel = new User(); |
| 43 | foreach ($lists['list'] as $k => $v){ | 43 | foreach ($lists['list'] as $k => $v){ |
| 44 | if(!empty($v['template_id'])){ | 44 | if(!empty($v['template_id'])){ |
| 45 | - $v['template_name'] = $templateModel->read(['id'=>$v['template_id']],['name'])['name']; | 45 | + $template_name = $templateModel->read(['id'=>$v['template_id']],['name']); |
| 46 | + $v['template_name'] = $template_name !== false ? $templateModel['name'] : ''; | ||
| 46 | } | 47 | } |
| 47 | $v['operator_name'] = $userModel->getName($v['operator_id']); | 48 | $v['operator_name'] = $userModel->getName($v['operator_id']); |
| 48 | $lists['list'][$k] = $v; | 49 | $lists['list'][$k] = $v; |
| @@ -170,7 +170,7 @@ class CustomTemplateController extends BaseController | @@ -170,7 +170,7 @@ class CustomTemplateController extends BaseController | ||
| 170 | ],[ | 170 | ],[ |
| 171 | 'id.required' => 'ID不能为空', | 171 | 'id.required' => 'ID不能为空', |
| 172 | ]); | 172 | ]); |
| 173 | - $logic->copyCustomTemplateInfo(); | ||
| 174 | - $this->response('success'); | 173 | + $data = $logic->copyCustomTemplateInfo(); |
| 174 | + $this->response('success',Code::SUCCESS,$data); | ||
| 175 | } | 175 | } |
| 176 | } | 176 | } |
| @@ -347,7 +347,7 @@ class FileController | @@ -347,7 +347,7 @@ class FileController | ||
| 347 | // 设置响应头 | 347 | // 设置响应头 |
| 348 | header('Content-Description: File Transfer'); | 348 | header('Content-Description: File Transfer'); |
| 349 | header('Content-Type: application/octet-stream'); | 349 | header('Content-Type: application/octet-stream'); |
| 350 | - header('Content-Disposition: attachment; filename="' . $info['name'] . '"'); | 350 | + header('Content-Disposition: attachment; filename="' . !empty($info['name']) ? $info['name'] : '未命名'.basename($info['path']) . '"'); |
| 351 | // 下载文件 | 351 | // 下载文件 |
| 352 | readfile($fileUrl); | 352 | readfile($fileUrl); |
| 353 | } | 353 | } |
| @@ -290,9 +290,13 @@ class ImageController extends Controller | @@ -290,9 +290,13 @@ class ImageController extends Controller | ||
| 290 | 'name'=>$name, | 290 | 'name'=>$name, |
| 291 | 'en_name'=>$fileName | 291 | 'en_name'=>$fileName |
| 292 | ]; | 292 | ]; |
| 293 | - $rs = $imageModel->add($data); | ||
| 294 | - if ($rs === false) { | ||
| 295 | - return $this->response('添加失败', Code::USER_ERROR); | 293 | + $imageModel = new ImageModel(); |
| 294 | + $info = $imageModel->read(['hash'=>$hash,'project_id'=>$this->cache['project_id'] ?? 0]); | ||
| 295 | + if($info === false){ | ||
| 296 | + $rs = $imageModel->add($data); | ||
| 297 | + if ($rs === false) { | ||
| 298 | + return $this->response('添加失败', Code::USER_ERROR); | ||
| 299 | + } | ||
| 296 | } | 300 | } |
| 297 | return true; | 301 | return true; |
| 298 | } | 302 | } |
| @@ -143,10 +143,6 @@ class HrLogic extends BaseLogic | @@ -143,10 +143,6 @@ class HrLogic extends BaseLogic | ||
| 143 | $user->type = User::TYPE_ONE; | 143 | $user->type = User::TYPE_ONE; |
| 144 | $user->role_id = 38; //技术总部 | 144 | $user->role_id = 38; //技术总部 |
| 145 | $user->save(); | 145 | $user->save(); |
| 146 | - }else{ | ||
| 147 | - $user->mobile = $mobile; | ||
| 148 | - $user->name = $name; | ||
| 149 | - $user->save(); | ||
| 150 | } | 146 | } |
| 151 | }else{ | 147 | }else{ |
| 152 | //离职 | 148 | //离职 |
| @@ -131,9 +131,8 @@ class ProjectLogic extends BaseLogic | @@ -131,9 +131,8 @@ class ProjectLogic extends BaseLogic | ||
| 131 | * @time :2023/8/30 11:57 | 131 | * @time :2023/8/30 11:57 |
| 132 | */ | 132 | */ |
| 133 | public function projectSave(){ | 133 | public function projectSave(){ |
| 134 | - DB::beginTransaction(); | ||
| 135 | - try { | ||
| 136 | -// $this->param['project_location'] = 0;//TODO::图片文件存储不同地方,上线后删除 | 134 | +// DB::beginTransaction(); |
| 135 | +// try { | ||
| 137 | if($this->param['type'] == Project::TYPE_SEVEN){ | 136 | if($this->param['type'] == Project::TYPE_SEVEN){ |
| 138 | //错误单直接返回,单独处理 | 137 | //错误单直接返回,单独处理 |
| 139 | $this->setTypeSevenEdit($this->param); | 138 | $this->setTypeSevenEdit($this->param); |
| @@ -154,11 +153,11 @@ class ProjectLogic extends BaseLogic | @@ -154,11 +153,11 @@ class ProjectLogic extends BaseLogic | ||
| 154 | $this->syncImageFile($this->param['project_location'],$this->param['id']); | 153 | $this->syncImageFile($this->param['project_location'],$this->param['id']); |
| 155 | (new SyncService())->projectAcceptAddress($this->param['id']); | 154 | (new SyncService())->projectAcceptAddress($this->param['id']); |
| 156 | } | 155 | } |
| 157 | - DB::commit(); | ||
| 158 | - }catch (\Exception $e){ | ||
| 159 | - DB::rollBack(); | ||
| 160 | - $this->fail('保存失败,请联系管理员'); | ||
| 161 | - } | 156 | +// DB::commit(); |
| 157 | +// }catch (\Exception $e){ | ||
| 158 | +// DB::rollBack(); | ||
| 159 | +// $this->fail('保存失败,请联系管理员'); | ||
| 160 | +// } | ||
| 162 | return $this->success(); | 161 | return $this->success(); |
| 163 | } | 162 | } |
| 164 | 163 | ||
| @@ -177,16 +176,16 @@ class ProjectLogic extends BaseLogic | @@ -177,16 +176,16 @@ class ProjectLogic extends BaseLogic | ||
| 177 | * @time :2023/8/30 12:14 | 176 | * @time :2023/8/30 12:14 |
| 178 | */ | 177 | */ |
| 179 | public function saveProject($param){ | 178 | public function saveProject($param){ |
| 180 | - if($param['type'] == Project::TYPE_FIVE){ | ||
| 181 | - $param['extend_type'] = Project::TYPE_FIVE; | ||
| 182 | - unset($param['type']); | ||
| 183 | - } | ||
| 184 | if($param['type'] == Project::TYPE_ONE){ | 179 | if($param['type'] == Project::TYPE_ONE){ |
| 185 | $param['serve_id'] = 9; | 180 | $param['serve_id'] = 9; |
| 186 | } | 181 | } |
| 187 | if((($param['type'] == Project::TYPE_TWO) || ($param['type'] == Project::TYPE_THREE)) && empty($param['uptime'])){ | 182 | if((($param['type'] == Project::TYPE_TWO) || ($param['type'] == Project::TYPE_THREE)) && empty($param['uptime'])){ |
| 188 | $param['uptime'] = date('Y-m-d H:i:s'); | 183 | $param['uptime'] = date('Y-m-d H:i:s'); |
| 189 | } | 184 | } |
| 185 | + if($param['type'] == Project::TYPE_FIVE){ | ||
| 186 | + $param['extend_type'] = Project::TYPE_FIVE; | ||
| 187 | + unset($param['type']); | ||
| 188 | + } | ||
| 190 | if(isset($param['level']) && !empty($param['level'])){ | 189 | if(isset($param['level']) && !empty($param['level'])){ |
| 191 | $param['level'] = Arr::arrToSet($param['level']); | 190 | $param['level'] = Arr::arrToSet($param['level']); |
| 192 | } | 191 | } |
| @@ -679,7 +678,7 @@ class ProjectLogic extends BaseLogic | @@ -679,7 +678,7 @@ class ProjectLogic extends BaseLogic | ||
| 679 | */ | 678 | */ |
| 680 | public function copyProject(){ | 679 | public function copyProject(){ |
| 681 | CopyProjectJob::dispatch(['project_id'=>$this->param['project_id']]); | 680 | CopyProjectJob::dispatch(['project_id'=>$this->param['project_id']]); |
| 682 | - return $this->success(); | 681 | + return $this->success('项目复制中,请稍后前往初始化项目查看;'); |
| 683 | } | 682 | } |
| 684 | 683 | ||
| 685 | /** | 684 | /** |
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | namespace App\Http\Logic\Aside\Template; | 3 | namespace App\Http\Logic\Aside\Template; |
| 4 | 4 | ||
| 5 | use App\Http\Logic\Aside\BaseLogic; | 5 | use App\Http\Logic\Aside\BaseLogic; |
| 6 | +use App\Models\Manage\Manage; | ||
| 6 | use App\Models\RouteMap\RouteMap; | 7 | use App\Models\RouteMap\RouteMap; |
| 7 | use App\Models\Service\Service as ServiceSettingModel; | 8 | use App\Models\Service\Service as ServiceSettingModel; |
| 8 | use App\Models\Template\BTemplate; | 9 | use App\Models\Template\BTemplate; |
| @@ -123,6 +124,12 @@ class ATemplateLogic extends BaseLogic | @@ -123,6 +124,12 @@ class ATemplateLogic extends BaseLogic | ||
| 123 | if(!empty($info['image'])){ | 124 | if(!empty($info['image'])){ |
| 124 | $info['image_link'] = getImageUrl($info['image']); | 125 | $info['image_link'] = getImageUrl($info['image']); |
| 125 | } | 126 | } |
| 127 | + if(!empty($info['design_manager'])){ | ||
| 128 | + $info['design_manager'] = (new Manage())->getName($info['design_manager']); | ||
| 129 | + } | ||
| 130 | + if(!empty($info['front_manager'])){ | ||
| 131 | + $info['front_manager'] = (new Manage())->getName($info['front_manager']); | ||
| 132 | + } | ||
| 126 | return $this->success($info); | 133 | return $this->success($info); |
| 127 | } | 134 | } |
| 128 | 135 | ||
| @@ -244,4 +251,30 @@ class ATemplateLogic extends BaseLogic | @@ -244,4 +251,30 @@ class ATemplateLogic extends BaseLogic | ||
| 244 | } | 251 | } |
| 245 | return $this->success($data); | 252 | return $this->success($data); |
| 246 | } | 253 | } |
| 254 | + | ||
| 255 | + /** | ||
| 256 | + * @remark :修改状态 | ||
| 257 | + * @name :auditingStatus | ||
| 258 | + * @author :lyh | ||
| 259 | + * @method :post | ||
| 260 | + * @time :2024/5/23 16:44 | ||
| 261 | + */ | ||
| 262 | + public function auditingStatus(){ | ||
| 263 | + //获取当前数据详情 | ||
| 264 | + $info = $this->model->read(['id'=>$this->param['id']]); | ||
| 265 | + if(isset($this->param['front_status']) && $this->param['front_status'] == 1){ | ||
| 266 | + if($info['design_status'] == 0){ | ||
| 267 | + $this->fail('请先提交设计审核'); | ||
| 268 | + } | ||
| 269 | + $this->param['design_manager'] = $this->manager['id']; | ||
| 270 | + $this->param['test_model'] = 0; | ||
| 271 | + }else{ | ||
| 272 | + $this->param['front_manager'] = $this->manager['id']; | ||
| 273 | + } | ||
| 274 | + $rs = $this->model->edit($this->param,['id'=>$this->param['id']]); | ||
| 275 | + if($rs === false){ | ||
| 276 | + $this->fail('修改失败,请联系管理员'); | ||
| 277 | + } | ||
| 278 | + return $this->success(['id'=>$this->param['id']]); | ||
| 279 | + } | ||
| 247 | } | 280 | } |
| @@ -60,10 +60,8 @@ class UserLogic extends BaseLogic | @@ -60,10 +60,8 @@ class UserLogic extends BaseLogic | ||
| 60 | } | 60 | } |
| 61 | $this->param = $this->editPassword($this->param); | 61 | $this->param = $this->editPassword($this->param); |
| 62 | $rs = $this->model->edit($this->param, ['id' => $this->param['id']]); | 62 | $rs = $this->model->edit($this->param, ['id' => $this->param['id']]); |
| 63 | + DB::table('gl_user_edit_log')->insert(['message'=>json_encode($this->param),'user_id'=>$this->manager['id'],'project_id'=>$this->user['project_id'],'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')]); | ||
| 63 | } else { | 64 | } else { |
| 64 | -// $mobileModel = new Mobile(); | ||
| 65 | -// //查看当前手机号码是否存在于手机号码库 | ||
| 66 | -// $mobileInfo = $mobileModel->read(['mobile'=>$this->param['mobile']]); | ||
| 67 | $this->param['password'] = base64_encode(md5($this->param['password'])); | 65 | $this->param['password'] = base64_encode(md5($this->param['password'])); |
| 68 | $rs = $this->model->add($this->param); | 66 | $rs = $this->model->add($this->param); |
| 69 | } | 67 | } |
| @@ -933,4 +933,24 @@ class BTemplateLogic extends BaseLogic | @@ -933,4 +933,24 @@ class BTemplateLogic extends BaseLogic | ||
| 933 | } | 933 | } |
| 934 | return $this->success(); | 934 | return $this->success(); |
| 935 | } | 935 | } |
| 936 | + | ||
| 937 | + /** | ||
| 938 | + * @remark :设置模版 | ||
| 939 | + * @name :setCustomTemplate | ||
| 940 | + * @author :lyh | ||
| 941 | + * @method :post | ||
| 942 | + * @time :2024/5/24 15:55 | ||
| 943 | + */ | ||
| 944 | + public function setCustomTemplate(){ | ||
| 945 | + $templateModel = new Template(); | ||
| 946 | + $templateInfo = $templateModel->read(['id'=>$this->param['template_id']],['id','main_html','main_css']); | ||
| 947 | + if($templateInfo === false){ | ||
| 948 | + $this->fail('未获取到模版数据'); | ||
| 949 | + } | ||
| 950 | + if(empty($templateInfo['main_html']) || empty($templateInfo['main_css'])){ | ||
| 951 | + $this->fail('当前模版替换数据错误'); | ||
| 952 | + } | ||
| 953 | + $this->model->edit(['html'=>$templateInfo['main_html'],'html_style'=>$templateInfo['main_css']],['id'=>$this->param['id']]); | ||
| 954 | + return $this->success(); | ||
| 955 | + } | ||
| 936 | } | 956 | } |
| @@ -404,4 +404,33 @@ class CustomTemplateLogic extends BaseLogic | @@ -404,4 +404,33 @@ class CustomTemplateLogic extends BaseLogic | ||
| 404 | } | 404 | } |
| 405 | return $this->success(); | 405 | return $this->success(); |
| 406 | } | 406 | } |
| 407 | + | ||
| 408 | + /** | ||
| 409 | + * @remark :复制单页面 | ||
| 410 | + * @name :copyCustomTemplateInfo | ||
| 411 | + * @author :lyh | ||
| 412 | + * @method :post | ||
| 413 | + * @time :2024/5/24 14:47 | ||
| 414 | + */ | ||
| 415 | + public function copyCustomTemplateInfo(){ | ||
| 416 | + $info = $this->model->read(['id'=>$this->param['id']]); | ||
| 417 | + if($info === false){ | ||
| 418 | + $this->fail('当前数据不存在'); | ||
| 419 | + } | ||
| 420 | + $param = [ | ||
| 421 | + 'name'=>$info['name'].'-copy', | ||
| 422 | + 'status'=>$info['status'], | ||
| 423 | + 'url'=>$info['url'].'-copy', | ||
| 424 | + 'html'=>$info['html'], | ||
| 425 | + 'html_style'=>$info['html_style'], | ||
| 426 | + 'project_id'=>$info['project_id'], | ||
| 427 | + 'is_visualization'=>$info['is_visualization'], | ||
| 428 | + 'six_read'=>$info['six_read'], | ||
| 429 | + 'is_upgrade'=>$info['is_upgrade'], | ||
| 430 | + ]; | ||
| 431 | + $id = $this->model->addReturnId($param); | ||
| 432 | + $route = RouteMap::setRoute($param['url'],RouteMap::SOURCE_PAGE,$id,$param['project_id']); | ||
| 433 | + $this->model->edit(['url'=>$route],['id'=>$id]); | ||
| 434 | + return $this->success(['id'=>$id]); | ||
| 435 | + } | ||
| 407 | } | 436 | } |
| @@ -59,7 +59,7 @@ class CountLogic extends BaseLogic | @@ -59,7 +59,7 @@ class CountLogic extends BaseLogic | ||
| 59 | */ | 59 | */ |
| 60 | public function scheme_info(){ | 60 | public function scheme_info(){ |
| 61 | $data = [ | 61 | $data = [ |
| 62 | - 'company'=>$this->project['company'], | 62 | + 'company'=>$this->project['company'] ?? '', |
| 63 | 'scheme'=>Project::planMap()[$this->project['deploy_build']['plan']], | 63 | 'scheme'=>Project::planMap()[$this->project['deploy_build']['plan']], |
| 64 | 'service_duration'=>$this->project['deploy_build']['service_duration'], | 64 | 'service_duration'=>$this->project['deploy_build']['service_duration'], |
| 65 | ]; | 65 | ]; |
| @@ -19,7 +19,6 @@ class NewsLogic extends BaseLogic | @@ -19,7 +19,6 @@ class NewsLogic extends BaseLogic | ||
| 19 | public function __construct() | 19 | public function __construct() |
| 20 | { | 20 | { |
| 21 | parent::__construct(); | 21 | parent::__construct(); |
| 22 | - | ||
| 23 | $this->model = new News(); | 22 | $this->model = new News(); |
| 24 | $this->param = $this->requestAll; | 23 | $this->param = $this->requestAll; |
| 25 | } | 24 | } |
| @@ -61,8 +60,8 @@ class NewsLogic extends BaseLogic | @@ -61,8 +60,8 @@ class NewsLogic extends BaseLogic | ||
| 61 | public function newsSave() | 60 | public function newsSave() |
| 62 | { | 61 | { |
| 63 | //拼接参数 | 62 | //拼接参数 |
| 64 | - DB::beginTransaction(); | ||
| 65 | - try { | 63 | +// DB::beginTransaction(); |
| 64 | +// try { | ||
| 66 | $this->param = $this->paramProcessing($this->param); | 65 | $this->param = $this->paramProcessing($this->param); |
| 67 | if (isset($this->param['id']) && !empty($this->param['id'])) { | 66 | if (isset($this->param['id']) && !empty($this->param['id'])) { |
| 68 | $id = $this->param['id']; | 67 | $id = $this->param['id']; |
| @@ -80,12 +79,12 @@ class NewsLogic extends BaseLogic | @@ -80,12 +79,12 @@ class NewsLogic extends BaseLogic | ||
| 80 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']); | 79 | $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_NEWS, $id, $this->user['project_id']); |
| 81 | $this->edit(['url' => $route], ['id' => $id]); | 80 | $this->edit(['url' => $route], ['id' => $id]); |
| 82 | } | 81 | } |
| 83 | - //更新路由 | ||
| 84 | - DB::commit(); | ||
| 85 | - } catch (\Exception $e) { | ||
| 86 | - DB::rollBack(); | ||
| 87 | - $this->fail('系统错误,请联系管理员'); | ||
| 88 | - } | 82 | +// //更新路由 |
| 83 | +// DB::commit(); | ||
| 84 | +// } catch (\Exception $e) { | ||
| 85 | +// DB::rollBack(); | ||
| 86 | +// $this->fail('系统错误,请联系管理员'); | ||
| 87 | +// } | ||
| 89 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route); | 88 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route); |
| 90 | $this->curlDelRoute(['new_route'=>$route]); | 89 | $this->curlDelRoute(['new_route'=>$route]); |
| 91 | return $this->success(['id'=>$id]); | 90 | return $this->success(['id'=>$id]); |
| @@ -97,6 +97,7 @@ class RankDataLogic extends BaseLogic | @@ -97,6 +97,7 @@ class RankDataLogic extends BaseLogic | ||
| 97 | foreach($languageList as $lang){ | 97 | foreach($languageList as $lang){ |
| 98 | $remain_day = $lang_data[$lang['lang']]['dabiao_day'] ?? 0; | 98 | $remain_day = $lang_data[$lang['lang']]['dabiao_day'] ?? 0; |
| 99 | $data['langs'][$lang['language'] ?? ''] = [ | 99 | $data['langs'][$lang['language'] ?? ''] = [ |
| 100 | + 'lang'=>$lang['lang'], | ||
| 100 | 'lang_text' => $lang['language'], | 101 | 'lang_text' => $lang['language'], |
| 101 | 'keyword_num' => $lang['keywords'] ?? 0, | 102 | 'keyword_num' => $lang['keywords'] ?? 0, |
| 102 | 'reach_day' => $lang_data[$lang['lang']]['dabiao_day'] ?? 0, | 103 | 'reach_day' => $lang_data[$lang['lang']]['dabiao_day'] ?? 0, |
| @@ -247,7 +248,7 @@ class RankDataLogic extends BaseLogic | @@ -247,7 +248,7 @@ class RankDataLogic extends BaseLogic | ||
| 247 | $list = collect($list30)->merge($list30_0)->merge($list100)->merge($list0)->filter(function ($item) { | 248 | $list = collect($list30)->merge($list30_0)->merge($list100)->merge($list0)->filter(function ($item) { |
| 248 | //搜索 | 249 | //搜索 |
| 249 | if ($this->request['search']) { | 250 | if ($this->request['search']) { |
| 250 | - return strpos($item['keyword'], $this->request['search']) !== false; | 251 | + return strpos(strtolower($item['keyword']), strtolower($this->request['search'])) !== false; |
| 251 | } | 252 | } |
| 252 | //前几名 | 253 | //前几名 |
| 253 | if ($this->request['first']) { | 254 | if ($this->request['first']) { |
| @@ -485,6 +486,7 @@ class RankDataLogic extends BaseLogic | @@ -485,6 +486,7 @@ class RankDataLogic extends BaseLogic | ||
| 485 | //保证关键词数 | 486 | //保证关键词数 |
| 486 | $keyword_num = DeployBuild::where('project_id', $project_id)->value('keyword_num'); | 487 | $keyword_num = DeployBuild::where('project_id', $project_id)->value('keyword_num'); |
| 487 | $type = Project::where('id', $project_id)->value('type'); | 488 | $type = Project::where('id', $project_id)->value('type'); |
| 489 | + $model_is_compliance = $model->is_compliance; | ||
| 488 | $model->is_compliance = 0; | 490 | $model->is_compliance = 0; |
| 489 | //是否达标 | 491 | //是否达标 |
| 490 | $is_compliance = $first_page_num >= $keyword_num; | 492 | $is_compliance = $first_page_num >= $keyword_num; |
| @@ -494,7 +496,7 @@ class RankDataLogic extends BaseLogic | @@ -494,7 +496,7 @@ class RankDataLogic extends BaseLogic | ||
| 494 | if ($keyword_num && $type == Project::TYPE_TWO && $is_compliance) { | 496 | if ($keyword_num && $type == Project::TYPE_TWO && $is_compliance) { |
| 495 | Log::channel('rank_data')->info('项目' . $project_id . ':关键词达标'. $keyword_num .' - ' . $first_page_num . ' - ' . $first_page_without_extension_num); | 497 | Log::channel('rank_data')->info('项目' . $project_id . ':关键词达标'. $keyword_num .' - ' . $first_page_num . ' - ' . $first_page_without_extension_num); |
| 496 | //项目表更新 | 498 | //项目表更新 |
| 497 | - if (($model->updated_date != date('Y-m-d') || empty($model->is_compliance)) && !$lang) { | 499 | + if (($model->updated_date != date('Y-m-d') || empty($model_is_compliance)) && !$lang) { |
| 498 | $compliance_day = Project::where(['id' => $project_id])->value('finish_remain_day') ?: 0; | 500 | $compliance_day = Project::where(['id' => $project_id])->value('finish_remain_day') ?: 0; |
| 499 | Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $compliance_day + 1]); | 501 | Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $compliance_day + 1]); |
| 500 | Log::channel('rank_data')->info('项目' . $project_id . '达标天数+1:'. ($compliance_day + 1)); | 502 | Log::channel('rank_data')->info('项目' . $project_id . '达标天数+1:'. ($compliance_day + 1)); |
| @@ -5,6 +5,7 @@ namespace App\Http\Logic\Bside\User; | @@ -5,6 +5,7 @@ namespace App\Http\Logic\Bside\User; | ||
| 5 | use App\Http\Logic\Bside\BaseLogic; | 5 | use App\Http\Logic\Bside\BaseLogic; |
| 6 | use App\Models\User\DeptUser; | 6 | use App\Models\User\DeptUser; |
| 7 | use App\Models\User\User as UserModel; | 7 | use App\Models\User\User as UserModel; |
| 8 | +use Illuminate\Support\Facades\DB; | ||
| 8 | 9 | ||
| 9 | class DeptUserLogic extends BaseLogic | 10 | class DeptUserLogic extends BaseLogic |
| 10 | { | 11 | { |
| @@ -6,6 +6,7 @@ use App\Enums\Common\Code; | @@ -6,6 +6,7 @@ use App\Enums\Common\Code; | ||
| 6 | use App\Http\Logic\Bside\BaseLogic; | 6 | use App\Http\Logic\Bside\BaseLogic; |
| 7 | use App\Models\User\User; | 7 | use App\Models\User\User; |
| 8 | use Illuminate\Support\Facades\Cache; | 8 | use Illuminate\Support\Facades\Cache; |
| 9 | +use Illuminate\Support\Facades\DB; | ||
| 9 | 10 | ||
| 10 | class UserLogic extends BaseLogic | 11 | class UserLogic extends BaseLogic |
| 11 | { | 12 | { |
| @@ -84,6 +85,8 @@ class UserLogic extends BaseLogic | @@ -84,6 +85,8 @@ class UserLogic extends BaseLogic | ||
| 84 | if($rs === false){ | 85 | if($rs === false){ |
| 85 | $this->fail('系统错误,请联系管理员'); | 86 | $this->fail('系统错误,请联系管理员'); |
| 86 | } | 87 | } |
| 88 | + //todo::写入日志 | ||
| 89 | + DB::table('gl_user_edit_log')->insert(['message'=>json_encode($this->param),'user_id'=>$this->user['id'],'project_id'=>$this->user['project_id'],'created_at'=>date('Y-m-d H:i:s'),'updated_at'=>date('Y-m-d H:i:s')]); | ||
| 87 | return $this->success(); | 90 | return $this->success(); |
| 88 | } | 91 | } |
| 89 | 92 |
| @@ -47,13 +47,23 @@ class VisitLogic extends BaseLogic | @@ -47,13 +47,23 @@ class VisitLogic extends BaseLogic | ||
| 47 | * @method :post | 47 | * @method :post |
| 48 | * @time :2024/5/6 16:39 | 48 | * @time :2024/5/6 16:39 |
| 49 | */ | 49 | */ |
| 50 | - public function downloadItem($map,$page,$row,$order,$filed = ['*']){ | 50 | + public function downloadItem($map,$page,$row,$order,$filed = ['id','depth','created_at','referrer_url','url','device_port','country','ip']){ |
| 51 | $lists = $this->model->lists($map,$page,$row,$order,$filed); | 51 | $lists = $this->model->lists($map,$page,$row,$order,$filed); |
| 52 | - $itemModel = new VisitItem(); | ||
| 53 | if(!empty($lists) && !empty($lists['list'])){ | 52 | if(!empty($lists) && !empty($lists['list'])){ |
| 54 | - foreach ($lists['list'] as $k => $v){ | ||
| 55 | - $v['sub'] = $itemModel->list(['customer_visit_id' => $v['id']]); | ||
| 56 | - $lists['list'][$k] = $v; | 53 | + foreach ($lists['list'] as $v){ |
| 54 | + $customer_visit_id[] = $v['id']; | ||
| 55 | + } | ||
| 56 | + $itemModel = new VisitItem(); | ||
| 57 | + $itemList = $itemModel->list(['customer_visit_id'=>['in',$customer_visit_id]],['customer_visit_id','url']); | ||
| 58 | + foreach ($lists['list'] as $key => $value){ | ||
| 59 | + $sub = []; | ||
| 60 | + foreach ($itemList as $sonValue){ | ||
| 61 | + if($value['id'] == $sonValue['customer_visit_id']){ | ||
| 62 | + $sub[] = $sonValue; | ||
| 63 | + } | ||
| 64 | + } | ||
| 65 | + $value['sub'] = $sub; | ||
| 66 | + $lists['list'][$key] = $value; | ||
| 57 | } | 67 | } |
| 58 | } | 68 | } |
| 59 | return $this->success($lists); | 69 | return $this->success($lists); |
| @@ -25,7 +25,7 @@ class BlogRequest extends FormRequest | @@ -25,7 +25,7 @@ class BlogRequest extends FormRequest | ||
| 25 | { | 25 | { |
| 26 | return [ | 26 | return [ |
| 27 | 'name'=>'required|max:200', | 27 | 'name'=>'required|max:200', |
| 28 | -// 'remark'=>'max:500', | 28 | + 'seo_keywords'=>'max:1000', |
| 29 | 'url'=>'required', | 29 | 'url'=>'required', |
| 30 | ]; | 30 | ]; |
| 31 | } | 31 | } |
| @@ -36,7 +36,7 @@ class BlogRequest extends FormRequest | @@ -36,7 +36,7 @@ class BlogRequest extends FormRequest | ||
| 36 | 'name.required'=>'请填写名称', | 36 | 'name.required'=>'请填写名称', |
| 37 | 'name.max'=>'名称超过最长长度200', | 37 | 'name.max'=>'名称超过最长长度200', |
| 38 | 'url.required'=>'链接不能为空', | 38 | 'url.required'=>'链接不能为空', |
| 39 | -// 'remark.max'=>'描述超过最长长度500' | 39 | + 'seo_keywords.max'=>'seo_keywords太长,请重新编辑' |
| 40 | ]; | 40 | ]; |
| 41 | } | 41 | } |
| 42 | } | 42 | } |
| @@ -60,10 +60,20 @@ class CopyProjectJob implements ShouldQueue | @@ -60,10 +60,20 @@ class CopyProjectJob implements ShouldQueue | ||
| 60 | $data['status'] = 0; | 60 | $data['status'] = 0; |
| 61 | $data['finish_remain_day'] = 0; | 61 | $data['finish_remain_day'] = 0; |
| 62 | $data['title'] = $data['title'].'-copy'; | 62 | $data['title'] = $data['title'].'-copy'; |
| 63 | + $data['delete_status'] = 1; | ||
| 63 | unset($data['id']); | 64 | unset($data['id']); |
| 64 | $project_id = $projectModel->insertGetId($data); | 65 | $project_id = $projectModel->insertGetId($data); |
| 65 | $hashids = new Hashids($data['from_order_id'], 13, 'abcdefghjkmnpqrstuvwxyz1234567890'); | 66 | $hashids = new Hashids($data['from_order_id'], 13, 'abcdefghjkmnpqrstuvwxyz1234567890'); |
| 66 | $projectModel->edit(['from_order_id'=>$hashids->encode($project_id)],['id'=>$project_id]); | 67 | $projectModel->edit(['from_order_id'=>$hashids->encode($project_id)],['id'=>$project_id]); |
| 68 | + //复制设置的模版 | ||
| 69 | + $settingTemplateModel = new Setting(); | ||
| 70 | + $settingData = $settingTemplateModel::where('project_id', $this->param['project_id'])->first(); | ||
| 71 | + if(!empty($settingData)){ | ||
| 72 | + $settingData = $settingData->getAttributes(); | ||
| 73 | + unset($settingData['id']); | ||
| 74 | + $settingData['project_id'] = $project_id; | ||
| 75 | + $settingTemplateModel->insert($settingData); | ||
| 76 | + } | ||
| 67 | //复制部署表 | 77 | //复制部署表 |
| 68 | $buildModel = new DeployBuild(); | 78 | $buildModel = new DeployBuild(); |
| 69 | $buildData = $buildModel::where('project_id', $this->param['project_id'])->first(); | 79 | $buildData = $buildModel::where('project_id', $this->param['project_id'])->first(); |
| @@ -114,15 +124,6 @@ class CopyProjectJob implements ShouldQueue | @@ -114,15 +124,6 @@ class CopyProjectJob implements ShouldQueue | ||
| 114 | $userData['project_id'] = $project_id; | 124 | $userData['project_id'] = $project_id; |
| 115 | $userModel->insert($userData); | 125 | $userModel->insert($userData); |
| 116 | } | 126 | } |
| 117 | - //复制设置的模版 | ||
| 118 | - $settingTemplateModel = new Setting(); | ||
| 119 | - $settingData = $settingTemplateModel::where('project_id', $this->param['project_id'])->first(); | ||
| 120 | - if(!empty($settingData)){ | ||
| 121 | - $settingData = $settingData->getAttributes(); | ||
| 122 | - unset($settingData['id']); | ||
| 123 | - $settingData['project_id'] = $project_id; | ||
| 124 | - $settingTemplateModel->insert($settingData); | ||
| 125 | - } | ||
| 126 | DB::commit(); | 127 | DB::commit(); |
| 127 | }catch (\Exception $e){ | 128 | }catch (\Exception $e){ |
| 128 | DB::rollBack(); | 129 | DB::rollBack(); |
| @@ -131,6 +132,8 @@ class CopyProjectJob implements ShouldQueue | @@ -131,6 +132,8 @@ class CopyProjectJob implements ShouldQueue | ||
| 131 | if($type != 0){ | 132 | if($type != 0){ |
| 132 | $this->copyMysql($this->param['project_id'],$project_id); | 133 | $this->copyMysql($this->param['project_id'],$project_id); |
| 133 | } | 134 | } |
| 135 | + //修改项目状态 | ||
| 136 | + $projectModel->edit(['delete_status'=>0],['id'=>$project_id]); | ||
| 134 | return true; | 137 | return true; |
| 135 | } | 138 | } |
| 136 | 139 |
| @@ -358,6 +358,7 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -358,6 +358,7 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 358 | Route::any('/setHeadFooter', [Aside\Template\ATemplateController::class, 'setHeadFooter'])->name('admin.template_setHeadFooter'); | 358 | Route::any('/setHeadFooter', [Aside\Template\ATemplateController::class, 'setHeadFooter'])->name('admin.template_setHeadFooter'); |
| 359 | Route::any('/getHeadFooter', [Aside\Template\ATemplateController::class, 'getHeadFooter'])->name('admin.template_getHeadFooter'); | 359 | Route::any('/getHeadFooter', [Aside\Template\ATemplateController::class, 'getHeadFooter'])->name('admin.template_getHeadFooter'); |
| 360 | Route::any('/setPublicTemplate', [Aside\Template\ATemplateController::class, 'setPublicTemplate'])->name('admin.template_setPublicTemplate'); | 360 | Route::any('/setPublicTemplate', [Aside\Template\ATemplateController::class, 'setPublicTemplate'])->name('admin.template_setPublicTemplate'); |
| 361 | + Route::any('/auditingStatus', [Aside\Template\ATemplateController::class, 'auditingStatus'])->name('admin.template_auditingStatus'); | ||
| 361 | Route::any('/getProjectPublicTemplate', [Aside\Template\ATemplateController::class, 'getProjectPublicTemplate'])->name('admin.template_getProjectPublicTemplate'); | 362 | Route::any('/getProjectPublicTemplate', [Aside\Template\ATemplateController::class, 'getProjectPublicTemplate'])->name('admin.template_getProjectPublicTemplate'); |
| 362 | // 左侧模块 | 363 | // 左侧模块 |
| 363 | Route::prefix('module')->group(function () { | 364 | Route::prefix('module')->group(function () { |
| @@ -361,6 +361,7 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -361,6 +361,7 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 361 | Route::any('/savePublicTemplate', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'savePublicTemplate'])->name('template_savePublicTemplate'); | 361 | Route::any('/savePublicTemplate', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'savePublicTemplate'])->name('template_savePublicTemplate'); |
| 362 | Route::any('/getDetailInfo', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'getDetailInfo'])->name('template_getDetailInfo'); | 362 | Route::any('/getDetailInfo', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'getDetailInfo'])->name('template_getDetailInfo'); |
| 363 | Route::any('/saveDetail', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'saveDetail'])->name('template_saveDetail'); | 363 | Route::any('/saveDetail', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'saveDetail'])->name('template_saveDetail'); |
| 364 | + Route::any('/setPublicTemplate', [\App\Http\Controllers\Bside\Template\BTemplateController::class, 'setPublicTemplate'])->name('template_setPublicTemplate'); | ||
| 364 | // 模板 | 365 | // 模板 |
| 365 | Route::prefix('module')->group(function () { | 366 | Route::prefix('module')->group(function () { |
| 366 | //获取所有左侧模版 | 367 | //获取所有左侧模版 |
-
请 注册 或 登录 后发表评论