正在显示
6 个修改的文件
包含
267 行增加
和
4 行删除
| @@ -19,14 +19,12 @@ use App\Models\News\NewsCategory; | @@ -19,14 +19,12 @@ use App\Models\News\NewsCategory; | ||
| 19 | use App\Models\Product\Category; | 19 | use App\Models\Product\Category; |
| 20 | use App\Models\Product\Keyword; | 20 | use App\Models\Product\Keyword; |
| 21 | use App\Models\Product\Product; | 21 | use App\Models\Product\Product; |
| 22 | -use App\Models\Project\Project; | ||
| 23 | use App\Models\RouteMap\RouteMap; | 22 | use App\Models\RouteMap\RouteMap; |
| 24 | use App\Services\ProjectServer; | 23 | use App\Services\ProjectServer; |
| 25 | use Illuminate\Console\Command; | 24 | use Illuminate\Console\Command; |
| 26 | use Illuminate\Support\Facades\DB; | 25 | use Illuminate\Support\Facades\DB; |
| 27 | use Illuminate\Support\Facades\Redis; | 26 | use Illuminate\Support\Facades\Redis; |
| 28 | use PhpOffice\PhpSpreadsheet\IOFactory; | 27 | use PhpOffice\PhpSpreadsheet\IOFactory; |
| 29 | -use function Aws\default_http_handler; | ||
| 30 | 28 | ||
| 31 | class UpdateProjectTdk extends Command | 29 | class UpdateProjectTdk extends Command |
| 32 | { | 30 | { |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :GeoController.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/7/2 17:42 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Controllers\Aside\Geo; | ||
| 11 | + | ||
| 12 | +use App\Enums\Common\Code; | ||
| 13 | +use App\Http\Controllers\Aside\BaseController; | ||
| 14 | +use App\Http\Logic\Aside\Geo\GeoLogic; | ||
| 15 | +use Illuminate\Http\Request; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * @remark :项目geo设置 | ||
| 19 | + * @name :GeoController | ||
| 20 | + * @author :lyh | ||
| 21 | + * @method :post | ||
| 22 | + * @time :2025/7/2 17:42 | ||
| 23 | + */ | ||
| 24 | +class GeoController extends BaseController | ||
| 25 | +{ | ||
| 26 | + public function __construct(Request $request) | ||
| 27 | + { | ||
| 28 | + parent::__construct($request); | ||
| 29 | + $this->logic = new GeoLogic(); | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * @remark :开启或关闭geo设置 | ||
| 34 | + * @name :setGeoStatus | ||
| 35 | + * @author :lyh | ||
| 36 | + * @method :post | ||
| 37 | + * @time :2025/7/2 17:50 | ||
| 38 | + */ | ||
| 39 | + public function setGeoStatus(){ | ||
| 40 | + $this->request->validate([ | ||
| 41 | + 'project_id'=>'required', | ||
| 42 | + 'geo_status'=>'required', | ||
| 43 | + 'geo_frequency'=>'required', | ||
| 44 | + ],[ | ||
| 45 | + 'project_id.required' => '项目ID不能为空', | ||
| 46 | + 'geo_status.required' => '项目开启与关闭不能为空', | ||
| 47 | + 'geo_frequency.required' => '项目发送频率不能为空', | ||
| 48 | + ]); | ||
| 49 | + $data = $this->logic->setGeoStatus(); | ||
| 50 | + $this->response('success',Code::SUCCESS,$data); | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + /** | ||
| 54 | + * @remark :问题列表 | ||
| 55 | + * @name :getGeoQuestion | ||
| 56 | + * @author :lyh | ||
| 57 | + * @method :post | ||
| 58 | + * @time :2025/7/3 9:09 | ||
| 59 | + */ | ||
| 60 | + public function getGeoQuestionList(){ | ||
| 61 | + $this->request->validate([ | ||
| 62 | + 'project_id'=>'required', | ||
| 63 | + ],[ | ||
| 64 | + 'project_id.required' => '项目ID不能为空', | ||
| 65 | + ]); | ||
| 66 | + $data = $this->logic->getGeoQuestionList($this->map,$this->page,$this->row,$this->order); | ||
| 67 | + $this->response('success',Code::SUCCESS,$data); | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + /** | ||
| 71 | + * @remark :保存问题数据 | ||
| 72 | + * @name :saveGeoQuestion | ||
| 73 | + * @author :lyh | ||
| 74 | + * @method :post | ||
| 75 | + * @time :2025/7/3 9:31 | ||
| 76 | + */ | ||
| 77 | + public function saveGeoQuestion(){ | ||
| 78 | + $this->request->validate([ | ||
| 79 | + 'project_id'=>'required', | ||
| 80 | + 'question'=>'required', | ||
| 81 | + 'keywords'=>'required', | ||
| 82 | + 'url'=>'required', | ||
| 83 | + 'status'=>'required', | ||
| 84 | + ],[ | ||
| 85 | + 'project_id.required' => '项目ID不能为空', | ||
| 86 | + 'question.required' => '项目ID不能为空', | ||
| 87 | + 'keywords.required' => '项目ID不能为空', | ||
| 88 | + 'url.required' => '项目ID不能为空', | ||
| 89 | + 'status.required' => '项目ID不能为空', | ||
| 90 | + ]); | ||
| 91 | + $data = $this->logic->saveGeoQuestion(); | ||
| 92 | + $this->response('success',Code::SUCCESS,$data); | ||
| 93 | + } | ||
| 94 | +} |
| @@ -58,8 +58,20 @@ class ComController extends BaseController | @@ -58,8 +58,20 @@ class ComController extends BaseController | ||
| 58 | public function seo_get_menu(){ | 58 | public function seo_get_menu(){ |
| 59 | $seoMenuModel = new ProjectMenuSeo(); | 59 | $seoMenuModel = new ProjectMenuSeo(); |
| 60 | $this->map['status'] = 0; | 60 | $this->map['status'] = 0; |
| 61 | + $data = []; | ||
| 62 | + $is_ai_blog = $this->getIsAiBlog(); | ||
| 63 | + if($is_ai_blog != 1){ | ||
| 64 | + $data[] = 57; | ||
| 65 | + } | ||
| 66 | + $is_ai_video = $this->getIsAiVideo(); | ||
| 67 | + if($is_ai_video != 1){ | ||
| 68 | + $data[] = 74; | ||
| 69 | + } | ||
| 61 | if($this->user['login_source'] == User::LOGIN_PASSWORD_SOURCE){ | 70 | if($this->user['login_source'] == User::LOGIN_PASSWORD_SOURCE){ |
| 62 | - $this->map['id'] = ['not in',[19]]; | 71 | + $data[] = 19; |
| 72 | + } | ||
| 73 | + if(!empty($data)){ | ||
| 74 | + $this->map['id'] = ['not in',$data]; | ||
| 63 | } | 75 | } |
| 64 | $lists = $seoMenuModel->list($this->map,'sort'); | 76 | $lists = $seoMenuModel->list($this->map,'sort'); |
| 65 | $menu = array(); | 77 | $menu = array(); |
app/Http/Logic/Aside/Geo/GeoLogic.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :GeoLogic.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/7/2 17:51 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Logic\Aside\Geo; | ||
| 11 | + | ||
| 12 | +use App\Http\Logic\Aside\BaseLogic; | ||
| 13 | +use App\Models\Geo\GeoQuestion; | ||
| 14 | +use App\Models\Project\Project; | ||
| 15 | + | ||
| 16 | +class GeoLogic extends BaseLogic | ||
| 17 | +{ | ||
| 18 | + public function __construct() | ||
| 19 | + { | ||
| 20 | + parent::__construct(); | ||
| 21 | + $this->param = $this->requestAll; | ||
| 22 | + $this->model = new GeoQuestion(); | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * @remark :设置geo状态 | ||
| 27 | + * @name :setGeoStatus | ||
| 28 | + * @author :lyh | ||
| 29 | + * @method :post | ||
| 30 | + * @time :2025/7/2 17:51 | ||
| 31 | + */ | ||
| 32 | + public function setGeoStatus(){ | ||
| 33 | + $projectModel = new Project(); | ||
| 34 | + $data = $projectModel->edit(['geo_status'=>$this->param['geo_status'],'geo_frequency'=>$this->param['geo_frequency']],['id'=>$this->param['project_id']]); | ||
| 35 | + return $this->success($data); | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + /** | ||
| 39 | + * @remark :获取问题列表 | ||
| 40 | + * @name :getGeoQuestionList | ||
| 41 | + * @author :lyh | ||
| 42 | + * @method :post | ||
| 43 | + * @time :2025/7/3 9:12 | ||
| 44 | + */ | ||
| 45 | + public function getGeoQuestionList($map,$page,$row,$order,$field = ['*']){ | ||
| 46 | + $data = $this->model->lists($map,$page,$row,$order,$field); | ||
| 47 | + return $this->success($data); | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + /** | ||
| 51 | + * @remark :保存数据 | ||
| 52 | + * @name :saveGeoQuestion | ||
| 53 | + * @author :lyh | ||
| 54 | + * @method :post | ||
| 55 | + * @time :2025/7/3 9:47 | ||
| 56 | + * @param : question->提交的问题 | ||
| 57 | + * @param : url->提交的网址 | ||
| 58 | + * @param : keywords->提交的关键字 | ||
| 59 | + */ | ||
| 60 | + public function saveGeoQuestion(){ | ||
| 61 | + //处理数据 | ||
| 62 | + $this->param['question'] = json_encode($this->param['question'] ?? [],true); | ||
| 63 | + $this->param['url'] = json_encode($this->param['url'] ?? [],true); | ||
| 64 | + $this->param['keywords'] = json_encode($this->param['keywords'] ?? [],true); | ||
| 65 | + //执行时间设置为今天 | ||
| 66 | + $this->param['current_time'] = date('Y-m-d'); | ||
| 67 | + if(isset($this->param['id']) && !empty($this->param['id'])){ | ||
| 68 | + $id = $this->param['id']; | ||
| 69 | + $this->model->edit($this->param,['id'=>$id]); | ||
| 70 | + }else{ | ||
| 71 | + $id = $this->model->addReturnId($this->param); | ||
| 72 | + } | ||
| 73 | + return $this->success(['id'=>$id]); | ||
| 74 | + } | ||
| 75 | +} |
| @@ -484,7 +484,7 @@ class ProjectLogic extends BaseLogic | @@ -484,7 +484,7 @@ class ProjectLogic extends BaseLogic | ||
| 484 | } | 484 | } |
| 485 | $param['upload_config'] = json_encode($param['upload_config'] ?? []); | 485 | $param['upload_config'] = json_encode($param['upload_config'] ?? []); |
| 486 | $param['web_traffic_config'] = json_encode($param['web_traffic_config'] ?? []); | 486 | $param['web_traffic_config'] = json_encode($param['web_traffic_config'] ?? []); |
| 487 | - unset($param['robots'],$param['is_analysis']);//项目不保存robots | 487 | + unset($param['robots'],$param['is_analysis'],$param['geo_status'],$param['geo_frequency']);//项目单独保存的数据 |
| 488 | $this->model->edit($param,['id'=>$param['id']]); | 488 | $this->model->edit($param,['id'=>$param['id']]); |
| 489 | Common::del_user_cache($this->model->getTable(),$param['id']); | 489 | Common::del_user_cache($this->model->getTable(),$param['id']); |
| 490 | return $this->success(); | 490 | return $this->success(); |
app/Models/Geo/GeoQuestion.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :GeoQuestion.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2025/7/3 9:05 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Models\Geo; | ||
| 11 | + | ||
| 12 | +use App\Helper\Arr; | ||
| 13 | +use App\Models\Base; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * @remark :geo设置问题表 | ||
| 17 | + * @name :GeoQuestion | ||
| 18 | + * @author :lyh | ||
| 19 | + * @method :post | ||
| 20 | + * @time :2025/7/3 9:05 | ||
| 21 | + */ | ||
| 22 | +class GeoQuestion extends Base | ||
| 23 | +{ | ||
| 24 | + protected $table = 'gl_geo_question'; | ||
| 25 | + | ||
| 26 | + /** | ||
| 27 | + * @remark :geo提交网址获取器 | ||
| 28 | + * @name :getUrlAttribute | ||
| 29 | + * @author :lyh | ||
| 30 | + * @method :post | ||
| 31 | + * @time :2025/7/3 9:52 | ||
| 32 | + */ | ||
| 33 | + public function getUrlAttribute($value) | ||
| 34 | + { | ||
| 35 | + if($value){ | ||
| 36 | + $value = Arr::s2a($value); | ||
| 37 | + } | ||
| 38 | + return $value; | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | + /** | ||
| 42 | + * @remark :geo提交问题获取器 | ||
| 43 | + * @name :getUrlAttribute | ||
| 44 | + * @author :lyh | ||
| 45 | + * @method :post | ||
| 46 | + * @time :2025/7/3 9:53 | ||
| 47 | + */ | ||
| 48 | + public function getQuestionAttribute($value) | ||
| 49 | + { | ||
| 50 | + if($value){ | ||
| 51 | + $value = Arr::s2a($value); | ||
| 52 | + } | ||
| 53 | + return $value; | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + /** | ||
| 57 | + * @remark :geo提交关键字获取器 | ||
| 58 | + * @name :getUrlAttribute | ||
| 59 | + * @author :lyh | ||
| 60 | + * @method :post | ||
| 61 | + * @time :2025/7/3 9:53 | ||
| 62 | + */ | ||
| 63 | + public function getKeywordsAttribute($value) | ||
| 64 | + { | ||
| 65 | + if($value){ | ||
| 66 | + $value = Arr::s2a($value); | ||
| 67 | + } | ||
| 68 | + return $value; | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + /** | ||
| 72 | + * @remark :品牌类型 | ||
| 73 | + * @name :brandType | ||
| 74 | + * @author :lyh | ||
| 75 | + * @method :post | ||
| 76 | + * @time :2025/7/3 9:43 | ||
| 77 | + */ | ||
| 78 | + public function brandType(){ | ||
| 79 | + return [ | ||
| 80 | + 1=>'品牌数据', | ||
| 81 | + 2=>'营销数据' | ||
| 82 | + ]; | ||
| 83 | + } | ||
| 84 | +} |
-
请 注册 或 登录 后发表评论