正在显示
7 个修改的文件
包含
21 行增加
和
32 行删除
| @@ -166,22 +166,4 @@ class BaseController extends Controller | @@ -166,22 +166,4 @@ class BaseController extends Controller | ||
| 166 | return \Illuminate\Support\Facades\Request::isMethod('post'); | 166 | return \Illuminate\Support\Facades\Request::isMethod('post'); |
| 167 | } | 167 | } |
| 168 | 168 | ||
| 169 | - /** | ||
| 170 | - * @remark :获取域名 | ||
| 171 | - * @name :getProjectDomain | ||
| 172 | - * @author :lyh | ||
| 173 | - * @method :post | ||
| 174 | - * @time :2023/7/20 16:45 | ||
| 175 | - */ | ||
| 176 | - public function getProjectDomain(){ | ||
| 177 | - $project = (new ProjectLogic())->getInfo($this->user['project_id']); | ||
| 178 | - if(!empty($project['deploy_optimize']['domain'])){ | ||
| 179 | - return $project['deploy_optimize']['domain']; | ||
| 180 | - } | ||
| 181 | - if(!empty($project['deploy_build']['test_domain'])){ | ||
| 182 | - return $project['deploy_build']['test_domain']; | ||
| 183 | - } | ||
| 184 | - return ''; | ||
| 185 | - } | ||
| 186 | - | ||
| 187 | } | 169 | } |
| @@ -27,7 +27,7 @@ class BlogCategoryController extends BaseController | @@ -27,7 +27,7 @@ class BlogCategoryController extends BaseController | ||
| 27 | foreach ($lists['list'] as $k => $v){ | 27 | foreach ($lists['list'] as $k => $v){ |
| 28 | $v['num'] = $blogModel->formatQuery(['category_id'=>['like','%,' . $v['id'] . ',%']])->count(); | 28 | $v['num'] = $blogModel->formatQuery(['category_id'=>['like','%,' . $v['id'] . ',%']])->count(); |
| 29 | $v['alias'] = RouteMap::getRoute(RouteMap::SOURCE_BLOG_CATE, $v['id'], $this->user['project_id']); | 29 | $v['alias'] = RouteMap::getRoute(RouteMap::SOURCE_BLOG_CATE, $v['id'], $this->user['project_id']); |
| 30 | - $v['url'] = $this->getProjectDomain() . RouteMap::PATH_BLOG_CATE . '/' . $v['alias']; | 30 | + $v['url'] = $this->user['domain'] . RouteMap::PATH_BLOG_CATE . '/' . $v['alias']; |
| 31 | $v['hasChildren'] = (($blogCategoryModel->read(['pid'=>$v['id']])) != false) ? true : false; | 31 | $v['hasChildren'] = (($blogCategoryModel->read(['pid'=>$v['id']])) != false) ? true : false; |
| 32 | $lists['list'][$k] = $v; | 32 | $lists['list'][$k] = $v; |
| 33 | } | 33 | } |
| @@ -59,7 +59,7 @@ class BlogCategoryController extends BaseController | @@ -59,7 +59,7 @@ class BlogCategoryController extends BaseController | ||
| 59 | ]); | 59 | ]); |
| 60 | $info = $blogCategoryLogic->info_blog_category(); | 60 | $info = $blogCategoryLogic->info_blog_category(); |
| 61 | $info['alias'] = RouteMap::getRoute(RouteMap::SOURCE_BLOG_CATE, $info['id'], $this->user['project_id']); | 61 | $info['alias'] = RouteMap::getRoute(RouteMap::SOURCE_BLOG_CATE, $info['id'], $this->user['project_id']); |
| 62 | - $info['url'] = $this->getProjectDomain() . RouteMap::PATH_BLOG_CATE . '/' . $info['alias']; | 62 | + $info['url'] = $this->user['domain'] . RouteMap::PATH_BLOG_CATE . '/' . $info['alias']; |
| 63 | $this->response('success',Code::SUCCESS,$info); | 63 | $this->response('success',Code::SUCCESS,$info); |
| 64 | } | 64 | } |
| 65 | /** | 65 | /** |
| @@ -33,7 +33,7 @@ class BlogController extends BaseController | @@ -33,7 +33,7 @@ class BlogController extends BaseController | ||
| 33 | $v = $blogCategoryLogic->get_category_name($v); | 33 | $v = $blogCategoryLogic->get_category_name($v); |
| 34 | //获取标签名称 | 34 | //获取标签名称 |
| 35 | // $v = $blogLabelLogic->get_label_name($v); | 35 | // $v = $blogLabelLogic->get_label_name($v); |
| 36 | - $v['url'] = $this->getProjectDomain() . RouteMap::getRoute(RouteMap::SOURCE_BLOG, $v['id'], $this->user['project_id']); | 36 | + $v['url'] = $this->user['domain'] . RouteMap::getRoute(RouteMap::SOURCE_BLOG, $v['id'], $this->user['project_id']); |
| 37 | $v['image_link'] = getImageUrl($v['image']); | 37 | $v['image_link'] = getImageUrl($v['image']); |
| 38 | $v['operator_name'] = (new User())->getName($v['operator_id']); | 38 | $v['operator_name'] = (new User())->getName($v['operator_id']); |
| 39 | $lists['list'][$k] = $v; | 39 | $lists['list'][$k] = $v; |
| @@ -78,7 +78,7 @@ class BlogController extends BaseController | @@ -78,7 +78,7 @@ class BlogController extends BaseController | ||
| 78 | ]); | 78 | ]); |
| 79 | $info = $blogLogic->blog_info(); | 79 | $info = $blogLogic->blog_info(); |
| 80 | $info['route'] = RouteMap::getRoute(RouteMap::SOURCE_BLOG, $info['id'], $this->user['project_id']); | 80 | $info['route'] = RouteMap::getRoute(RouteMap::SOURCE_BLOG, $info['id'], $this->user['project_id']); |
| 81 | - $info['url'] = $this->getProjectDomain() . $info['route']; | 81 | + $info['url'] = $this->user['domain'] . $info['route']; |
| 82 | $info['image_link'] = getImageUrl($info['image']); | 82 | $info['image_link'] = getImageUrl($info['image']); |
| 83 | $this->response('success',Code::SUCCESS,$info); | 83 | $this->response('success',Code::SUCCESS,$info); |
| 84 | } | 84 | } |
| @@ -27,7 +27,7 @@ class NewsCategoryController extends BaseController | @@ -27,7 +27,7 @@ class NewsCategoryController extends BaseController | ||
| 27 | foreach ($lists['list'] as $k => $v){ | 27 | foreach ($lists['list'] as $k => $v){ |
| 28 | $v['num'] = $newsModel->formatQuery(['category_id'=>['like','%,' . $v['id'] . ',%']])->count(); | 28 | $v['num'] = $newsModel->formatQuery(['category_id'=>['like','%,' . $v['id'] . ',%']])->count(); |
| 29 | $v['alias'] = RouteMap::getRoute(RouteMap::SOURCE_NEWS_CATE, $v['id'], $this->user['project_id']); | 29 | $v['alias'] = RouteMap::getRoute(RouteMap::SOURCE_NEWS_CATE, $v['id'], $this->user['project_id']); |
| 30 | - $v['url'] = $this->getProjectDomain() . RouteMap::PATH_NEWS_CATE . '/' . $v['alias']; | 30 | + $v['url'] = $this->user['domain'] . RouteMap::PATH_NEWS_CATE . '/' . $v['alias']; |
| 31 | $v['hasChildren'] = (($newsCategory->read(['pid'=>$v['id']])) != false) ? true : false; | 31 | $v['hasChildren'] = (($newsCategory->read(['pid'=>$v['id']])) != false) ? true : false; |
| 32 | $lists['list'][$k] = $v; | 32 | $lists['list'][$k] = $v; |
| 33 | } | 33 | } |
| @@ -59,7 +59,7 @@ class NewsCategoryController extends BaseController | @@ -59,7 +59,7 @@ class NewsCategoryController extends BaseController | ||
| 59 | ]); | 59 | ]); |
| 60 | $info = $newsCategoryLogic->info_news_category(); | 60 | $info = $newsCategoryLogic->info_news_category(); |
| 61 | $info['alias'] = RouteMap::getRoute(RouteMap::SOURCE_NEWS_CATE, $info['id'], $this->user['project_id']); | 61 | $info['alias'] = RouteMap::getRoute(RouteMap::SOURCE_NEWS_CATE, $info['id'], $this->user['project_id']); |
| 62 | - $info['url'] = $this->getProjectDomain() . RouteMap::PATH_NEWS_CATE . '/' . $info['alias']; | 62 | + $info['url'] = $this->user['domain'] . RouteMap::PATH_NEWS_CATE . '/' . $info['alias']; |
| 63 | $this->response('success',Code::SUCCESS,$info); | 63 | $this->response('success',Code::SUCCESS,$info); |
| 64 | } | 64 | } |
| 65 | /** | 65 | /** |
| @@ -31,7 +31,7 @@ class NewsController extends BaseController | @@ -31,7 +31,7 @@ class NewsController extends BaseController | ||
| 31 | if(!empty($lists['list'])){ | 31 | if(!empty($lists['list'])){ |
| 32 | foreach ($lists['list'] as $k => $v){ | 32 | foreach ($lists['list'] as $k => $v){ |
| 33 | $v = $newsCategoryLogic->get_category_name($v); | 33 | $v = $newsCategoryLogic->get_category_name($v); |
| 34 | - $v['url'] = $this->getProjectDomain() . RouteMap::getRoute(RouteMap::SOURCE_NEWS, $v['id'], $this->user['project_id']); | 34 | + $v['url'] = $this->user['domain'] . RouteMap::getRoute(RouteMap::SOURCE_NEWS, $v['id'], $this->user['project_id']); |
| 35 | $v['image_link'] = getImageUrl($v['image']); | 35 | $v['image_link'] = getImageUrl($v['image']); |
| 36 | $v['operator_name'] = (new User())->getName($v['operator_id']); | 36 | $v['operator_name'] = (new User())->getName($v['operator_id']); |
| 37 | $lists['list'][$k] = $v; | 37 | $lists['list'][$k] = $v; |
| @@ -75,7 +75,7 @@ class NewsController extends BaseController | @@ -75,7 +75,7 @@ class NewsController extends BaseController | ||
| 75 | ]); | 75 | ]); |
| 76 | $info = $newsLogic->news_info(); | 76 | $info = $newsLogic->news_info(); |
| 77 | $info['route'] = RouteMap::getRoute(RouteMap::SOURCE_NEWS, $info['id'], $this->user['project_id']); | 77 | $info['route'] = RouteMap::getRoute(RouteMap::SOURCE_NEWS, $info['id'], $this->user['project_id']); |
| 78 | - $info['url'] = $this->getProjectDomain() . $info['route']; | 78 | + $info['url'] = $this->user['domain'] . $info['route']; |
| 79 | $info['image_link'] = getImageUrl($info['image']); | 79 | $info['image_link'] = getImageUrl($info['image']); |
| 80 | $this->response('success',Code::SUCCESS,$info); | 80 | $this->response('success',Code::SUCCESS,$info); |
| 81 | } | 81 | } |
| @@ -42,7 +42,7 @@ class KeywordController extends BaseController | @@ -42,7 +42,7 @@ class KeywordController extends BaseController | ||
| 42 | foreach ($data['list'] as &$v){ | 42 | foreach ($data['list'] as &$v){ |
| 43 | $v['product_num'] = KeywordRelated::where('keyword_id', $v['id'])->distinct()->count('product_id'); | 43 | $v['product_num'] = KeywordRelated::where('keyword_id', $v['id'])->distinct()->count('product_id'); |
| 44 | $v['tdk'] = boolval($v['seo_title']) * boolval($v['seo_keywords']) * boolval($v['seo_description']); | 44 | $v['tdk'] = boolval($v['seo_title']) * boolval($v['seo_keywords']) * boolval($v['seo_description']); |
| 45 | - $v['url'] = $this->getProjectDomain() . RouteMap::getRoute(RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); | 45 | + $v['url'] = $this->user['domain'] . RouteMap::getRoute(RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); |
| 46 | } | 46 | } |
| 47 | } | 47 | } |
| 48 | return $this->response('success',Code::SUCCESS,$data); | 48 | return $this->response('success',Code::SUCCESS,$data); |
| @@ -16,6 +16,7 @@ use App\Models\Channel\User; | @@ -16,6 +16,7 @@ use App\Models\Channel\User; | ||
| 16 | use App\Models\Channel\Zone; | 16 | use App\Models\Channel\Zone; |
| 17 | use App\Models\Devops\ServerConfig; | 17 | use App\Models\Devops\ServerConfig; |
| 18 | use App\Models\Inquiry\InquirySet; | 18 | use App\Models\Inquiry\InquirySet; |
| 19 | +use App\Models\Manage\Manage; | ||
| 19 | use App\Models\News\News; | 20 | use App\Models\News\News; |
| 20 | use App\Models\Project\DeployBuild; | 21 | use App\Models\Project\DeployBuild; |
| 21 | use App\Models\Project\DeployOptimize; | 22 | use App\Models\Project\DeployOptimize; |
| @@ -91,8 +92,6 @@ class ProjectLogic extends BaseLogic | @@ -91,8 +92,6 @@ class ProjectLogic extends BaseLogic | ||
| 91 | public function getAutoLoginCode($project_id){ | 92 | public function getAutoLoginCode($project_id){ |
| 92 | $encrypt = new EncryptUtils(); | 93 | $encrypt = new EncryptUtils(); |
| 93 | return $encrypt->authcode(json_encode(['project_id' => $project_id]), 'ENCODE', 'autologin', 3600); | 94 | return $encrypt->authcode(json_encode(['project_id' => $project_id]), 'ENCODE', 'autologin', 3600); |
| 94 | -// $param = http_build_query(['code' => $code]); | ||
| 95 | -// return env('B_URL') . '/autologin?' . $param; | ||
| 96 | } | 95 | } |
| 97 | 96 | ||
| 98 | public function getInfo($id) | 97 | public function getInfo($id) |
| @@ -111,14 +110,21 @@ class ProjectLogic extends BaseLogic | @@ -111,14 +110,21 @@ class ProjectLogic extends BaseLogic | ||
| 111 | public function getProjectInfo($id){ | 110 | public function getProjectInfo($id){ |
| 112 | $info = $this->model->with('payment')->with('deploy_build') | 111 | $info = $this->model->with('payment')->with('deploy_build') |
| 113 | ->with('deploy_optimize')->with('online_check')->where(['id'=>$id])->first(); | 112 | ->with('deploy_optimize')->with('online_check')->where(['id'=>$id])->first(); |
| 114 | - if(isset($info['online_check']['created_manage_id']) && !empty($info['online_check']['created_manage_id'])){ | ||
| 115 | - $info['online_check']['name'] = (new ManageLogic)->getCacheName($info['online_check']['created_manage_id']); | ||
| 116 | - } | 113 | + $info['online_check']['name'] = (new Manage())->read(['id'=>$info['online_check']['created_manage_id']])['name'] ?? ''; |
| 114 | + $info['deploy_optimize']['minor_keywords'] = json_decode($info['deploy_optimize']['minor_keywords']) ?? ''; | ||
| 117 | if($info['extend_type'] != 0){ | 115 | if($info['extend_type'] != 0){ |
| 118 | $info['type'] = $info['extend_type']; | 116 | $info['type'] = $info['extend_type']; |
| 119 | } | 117 | } |
| 120 | return $this->success($info); | 118 | return $this->success($info); |
| 121 | } | 119 | } |
| 120 | + | ||
| 121 | + /** | ||
| 122 | + * @remark :保存项目配置数据 | ||
| 123 | + * @name :save | ||
| 124 | + * @author :lyh | ||
| 125 | + * @method :post | ||
| 126 | + * @time :2023/8/17 14:19 | ||
| 127 | + */ | ||
| 122 | public function save($param){ | 128 | public function save($param){ |
| 123 | if(!empty($param['deploy_optimize']['domain'])){ | 129 | if(!empty($param['deploy_optimize']['domain'])){ |
| 124 | $param['deploy_optimize']['domain'] = checkDomain($param['deploy_optimize']['domain']); | 130 | $param['deploy_optimize']['domain'] = checkDomain($param['deploy_optimize']['domain']); |
| @@ -195,6 +201,7 @@ class ProjectLogic extends BaseLogic | @@ -195,6 +201,7 @@ class ProjectLogic extends BaseLogic | ||
| 195 | return true; | 201 | return true; |
| 196 | } | 202 | } |
| 197 | $data = $param['deploy_optimize']; | 203 | $data = $param['deploy_optimize']; |
| 204 | + $data['minor_keywords'] = json_encode($data['minor_keywords']) ?? ''; | ||
| 198 | $data['project_id'] = $param['id']; | 205 | $data['project_id'] = $param['id']; |
| 199 | $data['id'] = DeployOptimize::where('project_id', $param['id'])->value('id'); | 206 | $data['id'] = DeployOptimize::where('project_id', $param['id'])->value('id'); |
| 200 | // Arr::forget($data, ['api_no']); | 207 | // Arr::forget($data, ['api_no']); |
-
请 注册 或 登录 后发表评论