Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
27 个修改的文件
包含
393 行增加
和
117 行删除
| @@ -736,7 +736,12 @@ class RelayInquiry extends Command | @@ -736,7 +736,12 @@ class RelayInquiry extends Command | ||
| 736 | // 所有可用url | 736 | // 所有可用url |
| 737 | $urls = $inquiry_urls = []; | 737 | $urls = $inquiry_urls = []; |
| 738 | //入口url 首页30%,单页10%,聚合页60% | 738 | //入口url 首页30%,单页10%,聚合页60% |
| 739 | - $type = getRandByRatio([40,20,40]); | 739 | + if ($re_website == 'https://www.hikelok.com/') { |
| 740 | + $type = getRandByRatio([50,49,1]); | ||
| 741 | + } else { | ||
| 742 | + $type = getRandByRatio([40,20,40]); | ||
| 743 | + } | ||
| 744 | + | ||
| 740 | $inlet = $re_website; | 745 | $inlet = $re_website; |
| 741 | $type == 1 && $inlet = $page_url ? Arr::random($page_url) : $re_website; | 746 | $type == 1 && $inlet = $page_url ? Arr::random($page_url) : $re_website; |
| 742 | $type == 2 && $inlet = $keywords_url ? Arr::random($keywords_url) : $re_website; | 747 | $type == 2 && $inlet = $keywords_url ? Arr::random($keywords_url) : $re_website; |
| @@ -52,9 +52,9 @@ class LyhImportTest extends Command | @@ -52,9 +52,9 @@ class LyhImportTest extends Command | ||
| 52 | * @time :2023/11/20 15:13 | 52 | * @time :2023/11/20 15:13 |
| 53 | */ | 53 | */ |
| 54 | public function handle(){ | 54 | public function handle(){ |
| 55 | - ProjectServer::useProject(3951); | 55 | + ProjectServer::useProject(3654); |
| 56 | echo date('Y-m-d H:i:s') . 'start' . PHP_EOL; | 56 | echo date('Y-m-d H:i:s') . 'start' . PHP_EOL; |
| 57 | - $this->import2140CustomModule('https://ecdn6.globalso.com/upload/p/2140/file/2025-05/daoru.csv',3951); | 57 | + $this->importProductCategory('https://ecdn6-nc.globalso.com/upload/p/3654/file/2025-06/products-1.csv',3654); |
| 58 | DB::disconnect('custom_mysql'); | 58 | DB::disconnect('custom_mysql'); |
| 59 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | 59 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; |
| 60 | } | 60 | } |
| @@ -129,23 +129,43 @@ class LyhImportTest extends Command | @@ -129,23 +129,43 @@ class LyhImportTest extends Command | ||
| 129 | if($k < 1){ | 129 | if($k < 1){ |
| 130 | continue; | 130 | continue; |
| 131 | } | 131 | } |
| 132 | - if(empty($val[1])){ | ||
| 133 | - echo '跳过的名称:'.$val[1]; | 132 | + if(empty($val[0])){ |
| 133 | + echo '跳过的名称:'.$val[0]; | ||
| 134 | continue; | 134 | continue; |
| 135 | } | 135 | } |
| 136 | try { | 136 | try { |
| 137 | - $categoryModel->edit(['sort'=>$val[1]],['title'=>$val[0]]); | ||
| 138 | -// $id = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$val[1],'seo_title'=>$val[0],'seo_des'=>$val[2]]); | ||
| 139 | -// $pid = 0; | ||
| 140 | -// if($val[2] != 0){ | ||
| 141 | -// //查询上级id | ||
| 142 | -// $pidCate = $categoryModel->read(['seo_title'=>$val[2]]); | ||
| 143 | -// if($pidCate !== false){ | ||
| 144 | -// $pid = $pidCate['id']; | ||
| 145 | -// } | ||
| 146 | -// } | ||
| 147 | -// $route = RouteMap::setRoute($val[1],RouteMap::SOURCE_PRODUCT_CATE,$id,$project_id); | ||
| 148 | -// $categoryModel->edit(['route'=>$route,'pid'=>$pid],['id'=>$id]); | 137 | + $cateArr = explode('/',$val[0]); |
| 138 | + $pid = 0; | ||
| 139 | + $two_pid = 0; | ||
| 140 | + foreach ($cateArr as $key => $item){ | ||
| 141 | + if($key == 0){ | ||
| 142 | + //查看一级分类是否存在 | ||
| 143 | + $info = $categoryModel->read(['title'=>$item,'pid'=>0],['id']); | ||
| 144 | + if($info === false){ | ||
| 145 | + $pid = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$item]); | ||
| 146 | + //设置路由 | ||
| 147 | + $route = RouteMap::setRoute($item,RouteMap::SOURCE_PRODUCT_CATE,$pid,$project_id); | ||
| 148 | + $categoryModel->edit(['route'=>$route],['id'=>$pid]); | ||
| 149 | + }else{ | ||
| 150 | + $pid = $info['id']; | ||
| 151 | + } | ||
| 152 | + }elseif ($key == 1){ | ||
| 153 | + //查看当前下面的子级别是否存在 | ||
| 154 | + $two_info = $categoryModel->read(['title'=>$item,'pid'=>$pid],['id']); | ||
| 155 | + if($two_info === false){ | ||
| 156 | + $two_pid = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$item,'pid'=>$pid]); | ||
| 157 | + //设置路由 | ||
| 158 | + $route = RouteMap::setRoute($item,RouteMap::SOURCE_PRODUCT_CATE,$two_pid,$project_id); | ||
| 159 | + $categoryModel->edit(['route'=>$route],['id'=>$two_pid]); | ||
| 160 | + }else{ | ||
| 161 | + $two_pid = $two_info['id']; | ||
| 162 | + } | ||
| 163 | + }else{ | ||
| 164 | + $id = $categoryModel->addReturnId(['project_id'=>$project_id,'title'=>$item,'pid'=>$two_pid]); | ||
| 165 | + $route = RouteMap::setRoute($item,RouteMap::SOURCE_PRODUCT_CATE,$id,$project_id); | ||
| 166 | + $categoryModel->edit(['route'=>$route],['id'=>$id]); | ||
| 167 | + } | ||
| 168 | + } | ||
| 149 | echo date('Y-m-d H:i:s') . '产品分类id:'.PHP_EOL; | 169 | echo date('Y-m-d H:i:s') . '产品分类id:'.PHP_EOL; |
| 150 | }catch (\Exception $e){ | 170 | }catch (\Exception $e){ |
| 151 | echo date('Y-m-d H:i:s') . '跳过的名称:'. $val[1]; | 171 | echo date('Y-m-d H:i:s') . '跳过的名称:'. $val[1]; |
| @@ -68,7 +68,9 @@ class UpdateRoute extends Command | @@ -68,7 +68,9 @@ class UpdateRoute extends Command | ||
| 68 | */ | 68 | */ |
| 69 | public function handle() | 69 | public function handle() |
| 70 | { | 70 | { |
| 71 | - return $this->getAiBlog(); | 71 | + ProjectServer::useProject(1181); |
| 72 | + return $this->setProductKeyword(); | ||
| 73 | + DB::disconnect('custom_mysql'); | ||
| 72 | } | 74 | } |
| 73 | 75 | ||
| 74 | /** | 76 | /** |
| @@ -299,18 +301,18 @@ class UpdateRoute extends Command | @@ -299,18 +301,18 @@ class UpdateRoute extends Command | ||
| 299 | if(!empty($lists)){ | 301 | if(!empty($lists)){ |
| 300 | foreach ($lists as $v){ | 302 | foreach ($lists as $v){ |
| 301 | if(!empty($v['route'])){ | 303 | if(!empty($v['route'])){ |
| 302 | -// echo date('Y-m-d H:i:s') . 'route :'.$v['id'] . PHP_EOL; | ||
| 303 | -// $route = $this->setRoute($v['route'], RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); | ||
| 304 | -// $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); | 304 | + echo date('Y-m-d H:i:s') . 'route :'.$v['id'] . PHP_EOL; |
| 305 | + $route = $this->setRoute($v['title'], RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); | ||
| 306 | + $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); | ||
| 305 | continue; | 307 | continue; |
| 306 | }else{ | 308 | }else{ |
| 307 | - echo date('Y-m-d H:i:s') . 'route :'.$v['id'] . PHP_EOL; | ||
| 308 | - $route = Translate::tran($v['title'], 'en'); | ||
| 309 | - if(!empty($route)){ | ||
| 310 | - echo date('Y-m-d H:i:s') . $route . PHP_EOL; | ||
| 311 | - $route = $this->setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); | ||
| 312 | - $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); | ||
| 313 | - } | 309 | +// echo date('Y-m-d H:i:s') . 'route :'.$v['id'] . PHP_EOL; |
| 310 | +// $route = Translate::tran($v['title'], 'en'); | ||
| 311 | +// if(!empty($route)){ | ||
| 312 | +// echo date('Y-m-d H:i:s') . $route . PHP_EOL; | ||
| 313 | +// $route = $this->setRoute($route, RouteMap::SOURCE_PRODUCT_KEYWORD, $v['id'], $v['project_id']); | ||
| 314 | +// $keywordModel->edit(['route'=>$route],['id'=>$v['id']]); | ||
| 315 | +// } | ||
| 314 | } | 316 | } |
| 315 | } | 317 | } |
| 316 | } | 318 | } |
| @@ -372,7 +374,7 @@ class UpdateRoute extends Command | @@ -372,7 +374,7 @@ class UpdateRoute extends Command | ||
| 372 | } | 374 | } |
| 373 | } | 375 | } |
| 374 | $route = $sign.$suffix; | 376 | $route = $sign.$suffix; |
| 375 | - while(RouteMap::isExist($route, $source_id, $project_id)){ | 377 | + while(RouteMap::isExist($route, $source_id, $project_id,$source)){ |
| 376 | $route = $sign .'-'.$i.$suffix; | 378 | $route = $sign .'-'.$i.$suffix; |
| 377 | $i++; | 379 | $i++; |
| 378 | } | 380 | } |
| @@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
| 10 | namespace App\Console\Commands\LyhTest; | 10 | namespace App\Console\Commands\LyhTest; |
| 11 | 11 | ||
| 12 | use App\Console\Commands\Domain\DomainInfo; | 12 | use App\Console\Commands\Domain\DomainInfo; |
| 13 | +use App\Helper\OaGlobalsoApi; | ||
| 13 | use App\Http\Logic\Aside\Project\ProjectLogic; | 14 | use App\Http\Logic\Aside\Project\ProjectLogic; |
| 14 | use App\Models\Ai\AiBlog; | 15 | use App\Models\Ai\AiBlog; |
| 15 | use App\Models\Ai\AiBlogAuthor; | 16 | use App\Models\Ai\AiBlogAuthor; |
| @@ -57,26 +58,28 @@ class lyhDemo extends Command | @@ -57,26 +58,28 @@ class lyhDemo extends Command | ||
| 57 | protected $description = '更新路由'; | 58 | protected $description = '更新路由'; |
| 58 | 59 | ||
| 59 | public function handle(){ | 60 | public function handle(){ |
| 60 | - $str = '3671,955,752,1270,439,2674,3588,2388,1271,1543,738,624,552,1417,1237,651,1143,817,1556,1234,1350,650,538,491,631,2059,1845,866,1194,1699,546,684,905,1805,1728,2811,952,2972,2827,983,812,3081,554,741,1349,980'; | ||
| 61 | - $arr = explode(',',$str); | ||
| 62 | - $model = new TranslateBigProject(); | ||
| 63 | - foreach ($arr as $val){ | ||
| 64 | - $model->addReturnId(['project_id'=>$val]); | 61 | + $projectModel = new Project(); |
| 62 | + $buildModel = new DeployBuild(); | ||
| 63 | + $lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'is_upgrade'=>0,'id'=>['<',1659],'extend_type'=>0,'type'=>['in',[1,2,3,4,6]]], 'id', ['id','notice_order_id']); | ||
| 64 | + foreach ($lists as $item){ | ||
| 65 | + echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL; | ||
| 66 | + try { | ||
| 67 | + if(!empty($item['notice_order_id'])){ | ||
| 68 | + $api = new OaGlobalsoApi(); | ||
| 69 | + $data = $api->order_info($item['notice_order_id']); | ||
| 70 | + if(!empty($data)){ | ||
| 71 | + if(isset($data['data']['ads_price'])){ | ||
| 72 | + echo '奖励金额:'.$data['data']['ads_price'].PHP_EOL; | ||
| 73 | + $buildModel->edit(['ads_price'=>$data['data']['ads_price'] ?? 0],['project_id'=>$item['id']]); | ||
| 74 | + } | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | + }catch (\Exception $e){ | ||
| 78 | + continue; | ||
| 79 | + } | ||
| 80 | + DB::disconnect('custom_mysql'); | ||
| 65 | } | 81 | } |
| 66 | - return true; | ||
| 67 | -// $projectModel = new Project(); | ||
| 68 | -// $lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'extend_type'=>0,'type'=>['in',[1,2,3,4,6]]], 'id', ['id']); | ||
| 69 | -// foreach ($lists as $item){ | ||
| 70 | -//// echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL; | ||
| 71 | -// ProjectServer::useProject($item['id']); | ||
| 72 | -// $webSettingModel = new WebSetting(); | ||
| 73 | -// $info = $webSettingModel->read(['project_id'=>$item['id']]); | ||
| 74 | -// if($info === false){ | ||
| 75 | -// $webSettingModel->addReturnId(['project_id'=>$item['id']]); | ||
| 76 | -// echo '当前数据为空:'.$item['id'].PHP_EOL; | ||
| 77 | -// } | ||
| 78 | -// DB::disconnect('custom_mysql'); | ||
| 79 | -// } | 82 | + echo date('Y-m-d H:i:s') . '结束。。。' . PHP_EOL; |
| 80 | } | 83 | } |
| 81 | 84 | ||
| 82 | public function _actionTemplateMain(){ | 85 | public function _actionTemplateMain(){ |
| @@ -188,6 +188,7 @@ class Supervisory extends Command | @@ -188,6 +188,7 @@ class Supervisory extends Command | ||
| 188 | ->where('gl_project.type', Project::TYPE_TWO) | 188 | ->where('gl_project.type', Project::TYPE_TWO) |
| 189 | ->where('gl_project.extend_type', 0) // 是否续费是由extend_type字段控制 | 189 | ->where('gl_project.extend_type', 0) // 是否续费是由extend_type字段控制 |
| 190 | ->where('gl_project.delete_status', Project::IS_DEL_FALSE) | 190 | ->where('gl_project.delete_status', Project::IS_DEL_FALSE) |
| 191 | + ->where('gl_project.project_type', '!=', Project::PROJECT_TYPE_SEO)//排除白帽项目 | ||
| 191 | ->where(function ($subQuery) { | 192 | ->where(function ($subQuery) { |
| 192 | $subQuery->orwhere('c.qa_status', OnlineCheck::STATUS_ONLINE_TRUE)->orwhere('gl_project.is_upgrade', Project::IS_UPGRADE_TRUE); | 193 | $subQuery->orwhere('c.qa_status', OnlineCheck::STATUS_ONLINE_TRUE)->orwhere('gl_project.is_upgrade', Project::IS_UPGRADE_TRUE); |
| 193 | }) | 194 | }) |
| @@ -75,6 +75,7 @@ class CopyProject extends Command | @@ -75,6 +75,7 @@ class CopyProject extends Command | ||
| 75 | }catch (\Exception $e){ | 75 | }catch (\Exception $e){ |
| 76 | echo $e->getMessage().PHP_EOL; | 76 | echo $e->getMessage().PHP_EOL; |
| 77 | echo '复制数据库失败:'.$old_project_id . '<->'.$project_id; | 77 | echo '复制数据库失败:'.$old_project_id . '<->'.$project_id; |
| 78 | + continue; | ||
| 78 | } | 79 | } |
| 79 | //修改项目状态 | 80 | //修改项目状态 |
| 80 | $projectModel->edit(['delete_status'=>0],['id'=>$project_id]); | 81 | $projectModel->edit(['delete_status'=>0],['id'=>$project_id]); |
| @@ -227,7 +227,8 @@ class SyncProject extends Command | @@ -227,7 +227,8 @@ class SyncProject extends Command | ||
| 227 | 'version'=>$version | 227 | 'version'=>$version |
| 228 | ], | 228 | ], |
| 229 | 'deploy_build' => [ | 229 | 'deploy_build' => [ |
| 230 | - 'login_mobile'=>$param['principal_mobile'] | 230 | + 'login_mobile'=>$param['principal_mobile'], |
| 231 | + 'ads_price'=>$param['ads_price'] ?? 0 | ||
| 231 | ], | 232 | ], |
| 232 | 'deploy_optimize' => [ | 233 | 'deploy_optimize' => [ |
| 233 | // 'api_no' => 0 | 234 | // 'api_no' => 0 |
| @@ -35,7 +35,6 @@ class UpdateKeyword extends Command | @@ -35,7 +35,6 @@ class UpdateKeyword extends Command | ||
| 35 | 35 | ||
| 36 | 36 | ||
| 37 | public function handle(){ | 37 | public function handle(){ |
| 38 | - dd(1111); | ||
| 39 | while (true){ | 38 | while (true){ |
| 40 | $keywordPageModel = new KeywordPage(); | 39 | $keywordPageModel = new KeywordPage(); |
| 41 | $lists = $keywordPageModel->list(['status'=>0]); | 40 | $lists = $keywordPageModel->list(['status'=>0]); |
| @@ -52,6 +52,7 @@ class PrivateController extends BaseController | @@ -52,6 +52,7 @@ class PrivateController extends BaseController | ||
| 52 | ->leftJoin('gl_project_online_check as c', 'gl_project.id', '=', 'c.project_id') | 52 | ->leftJoin('gl_project_online_check as c', 'gl_project.id', '=', 'c.project_id') |
| 53 | ->leftJoin('gl_domain_info as d', 'gl_project.id', '=', 'd.project_id') | 53 | ->leftJoin('gl_domain_info as d', 'gl_project.id', '=', 'd.project_id') |
| 54 | ->where('gl_project.type', Project::TYPE_TWO) | 54 | ->where('gl_project.type', Project::TYPE_TWO) |
| 55 | + ->where('gl_project.project_type',Project::TYPE_ZERO) | ||
| 55 | ->where('gl_project.extend_type', 0) // 是否续费是由extend_type字段控制 | 56 | ->where('gl_project.extend_type', 0) // 是否续费是由extend_type字段控制 |
| 56 | ->where('gl_project.delete_status', Project::IS_DEL_FALSE) | 57 | ->where('gl_project.delete_status', Project::IS_DEL_FALSE) |
| 57 | ->where(function ($subQuery) { | 58 | ->where(function ($subQuery) { |
| @@ -142,7 +142,7 @@ class IndexController extends BaseController | @@ -142,7 +142,7 @@ class IndexController extends BaseController | ||
| 142 | Cache::add($token,$info,12 * 3600); | 142 | Cache::add($token,$info,12 * 3600); |
| 143 | $languageModel = new WebLanguage(); | 143 | $languageModel = new WebLanguage(); |
| 144 | $languageInfo = $languageModel->read(['id'=>$info['main_lang_id']],['short','english','chinese']); | 144 | $languageInfo = $languageModel->read(['id'=>$info['main_lang_id']],['short','english','chinese']); |
| 145 | - $data = ['token'=>$token,'main_lang_id'=>$info['main_lang_id'],'language_info'=>$languageInfo]; | 145 | + $data = ['token'=>$token,'main_lang_id'=>$info['main_lang_id'],'language_info'=>$languageInfo,'project_seo_type'=>$info['project_seo_type']]; |
| 146 | $this->response('success',Code::SUCCESS,$data); | 146 | $this->response('success',Code::SUCCESS,$data); |
| 147 | } | 147 | } |
| 148 | 148 |
| @@ -15,6 +15,7 @@ use App\Models\Channel\Channel; | @@ -15,6 +15,7 @@ use App\Models\Channel\Channel; | ||
| 15 | use App\Models\Channel\User; | 15 | use App\Models\Channel\User; |
| 16 | use App\Models\Channel\Zone; | 16 | use App\Models\Channel\Zone; |
| 17 | use App\Models\Com\City; | 17 | use App\Models\Com\City; |
| 18 | +use App\Models\Com\NoticeLog; | ||
| 18 | use App\Models\Com\UpdateLog; | 19 | use App\Models\Com\UpdateLog; |
| 19 | use App\Models\Devops\ServerConfig; | 20 | use App\Models\Devops\ServerConfig; |
| 20 | use App\Models\Devops\ServersIp; | 21 | use App\Models\Devops\ServersIp; |
| @@ -60,6 +61,7 @@ class ProjectController extends BaseController | @@ -60,6 +61,7 @@ class ProjectController extends BaseController | ||
| 60 | ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id') | 61 | ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id') |
| 61 | ->leftJoin('gl_project_online_check', 'gl_project.id', '=', 'gl_project_online_check.project_id') | 62 | ->leftJoin('gl_project_online_check', 'gl_project.id', '=', 'gl_project_online_check.project_id') |
| 62 | ->leftJoin('gl_web_setting_template', 'gl_project.id', '=', 'gl_web_setting_template.project_id') | 63 | ->leftJoin('gl_web_setting_template', 'gl_project.id', '=', 'gl_web_setting_template.project_id') |
| 64 | + ->leftJoin('gl_project_association', 'gl_project.id', '=', 'gl_project_association.project_id') | ||
| 63 | ->where('gl_project.delete_status',Project::TYPE_ZERO); | 65 | ->where('gl_project.delete_status',Project::TYPE_ZERO); |
| 64 | $query = $this->searchParam($query); | 66 | $query = $this->searchParam($query); |
| 65 | $query = $this->orderByList($query); | 67 | $query = $this->orderByList($query); |
| @@ -121,6 +123,7 @@ class ProjectController extends BaseController | @@ -121,6 +123,7 @@ class ProjectController extends BaseController | ||
| 121 | 'gl_project_deploy_optimize.design_mid AS design_mid', | 123 | 'gl_project_deploy_optimize.design_mid AS design_mid', |
| 122 | 'gl_project_deploy_optimize.api_no AS api_no', | 124 | 'gl_project_deploy_optimize.api_no AS api_no', |
| 123 | 'gl_web_setting_template.template_id AS template_id', | 125 | 'gl_web_setting_template.template_id AS template_id', |
| 126 | + 'gl_project_association.friend_id as friend_id' | ||
| 124 | ]; | 127 | ]; |
| 125 | return $select; | 128 | return $select; |
| 126 | } | 129 | } |
| @@ -294,6 +297,16 @@ class ProjectController extends BaseController | @@ -294,6 +297,16 @@ class ProjectController extends BaseController | ||
| 294 | if(isset($this->map['plan'])){ | 297 | if(isset($this->map['plan'])){ |
| 295 | $query = $query->where('gl_project_deploy_build.plan',$this->map['plan']); | 298 | $query = $query->where('gl_project_deploy_build.plan',$this->map['plan']); |
| 296 | } | 299 | } |
| 300 | + if(isset($this->map['friend_id'])){ | ||
| 301 | + if($this->map['friend_id'] == 1){ | ||
| 302 | + $query = $query->where('gl_project_association.friend_id', '!=', 0); | ||
| 303 | + }else{ | ||
| 304 | + $query = $query->where(function ($subQuery) { | ||
| 305 | + $subQuery->where('gl_project_association.friend_id', 0) | ||
| 306 | + ->orWhereNull('gl_project_association.friend_id'); | ||
| 307 | + }); | ||
| 308 | + } | ||
| 309 | + } | ||
| 297 | if(isset($this->map['seo_plan'])){ | 310 | if(isset($this->map['seo_plan'])){ |
| 298 | $query = $query->where('gl_project_deploy_build.seo_plan',$this->map['seo_plan']); | 311 | $query = $query->where('gl_project_deploy_build.seo_plan',$this->map['seo_plan']); |
| 299 | } | 312 | } |
| @@ -960,14 +973,10 @@ class ProjectController extends BaseController | @@ -960,14 +973,10 @@ class ProjectController extends BaseController | ||
| 960 | 'id'=>'required', | 973 | 'id'=>'required', |
| 961 | 'aicc'=>'required', | 974 | 'aicc'=>'required', |
| 962 | 'hagro'=>'required', | 975 | 'hagro'=>'required', |
| 963 | -// 'exclusive_aicc_day'=>'required', | ||
| 964 | -// 'exclusive_hagro_day'=>'required', | ||
| 965 | ],[ | 976 | ],[ |
| 966 | 'id.required' => 'id不能为空', | 977 | 'id.required' => 'id不能为空', |
| 967 | 'aicc.required' => 'aicc是否开启不能为空', | 978 | 'aicc.required' => 'aicc是否开启不能为空', |
| 968 | 'hagro.required' => 'hagro是否开启不能为空', | 979 | 'hagro.required' => 'hagro是否开启不能为空', |
| 969 | -// 'exclusive_aicc_day.required' => '服务天数不能为空', | ||
| 970 | -// 'exclusive_hagro_day.required' => '服务天数不能为空', | ||
| 971 | ]); | 980 | ]); |
| 972 | $logic->saveOtherProject(); | 981 | $logic->saveOtherProject(); |
| 973 | $this->response('success'); | 982 | $this->response('success'); |
| @@ -1136,7 +1145,7 @@ class ProjectController extends BaseController | @@ -1136,7 +1145,7 @@ class ProjectController extends BaseController | ||
| 1136 | 1145 | ||
| 1137 | //获取项目数据 | 1146 | //获取项目数据 |
| 1138 | $projectModel = new Project(); | 1147 | $projectModel = new Project(); |
| 1139 | - $projectInfo = $projectModel->read(['id'=>$this->param['id']],['project_type','serve_id','site_status']); | 1148 | + $projectInfo = $projectModel->read(['id'=>$this->param['id']],['project_type','serve_id','site_status','site_token']); |
| 1140 | if(!$projectInfo){ | 1149 | if(!$projectInfo){ |
| 1141 | $this->fail('获取项目数据失败'); | 1150 | $this->fail('获取项目数据失败'); |
| 1142 | } | 1151 | } |
| @@ -1144,61 +1153,75 @@ class ProjectController extends BaseController | @@ -1144,61 +1153,75 @@ class ProjectController extends BaseController | ||
| 1144 | $this->response('success'); | 1153 | $this->response('success'); |
| 1145 | } | 1154 | } |
| 1146 | 1155 | ||
| 1147 | - //获取域名数据 | ||
| 1148 | - $domainModel = new DomainInfoModel(); | ||
| 1149 | - $domainInfo = $domainModel->read(['project_id'=>$this->param['id']],['id','domain','amp_status']); | ||
| 1150 | - if(!$domainInfo){ | ||
| 1151 | - $this->fail('获取域名数据失败'); | ||
| 1152 | - } | ||
| 1153 | - | ||
| 1154 | - if($this->param['site_status'] == 1){ | ||
| 1155 | - //关闭站点:通知C端 | ||
| 1156 | - $re = curl_get('https://'.$domainInfo['domain'].'/api/stop_or_start_website'); | ||
| 1157 | - if(isset($re['status']) && $re['status'] !== 200){ | ||
| 1158 | - $this->fail($re['message']); | 1156 | + if($projectInfo['serve_id'] == 8){ |
| 1157 | + //自建站项目 | ||
| 1158 | + if($this->param['site_status'] == 1){ | ||
| 1159 | + //关闭站点 | ||
| 1160 | + $site_token = $projectInfo['site_token'] ? $projectInfo['site_token'].'_expired' : ''; | ||
| 1161 | + }else{ | ||
| 1162 | + //开启站点 | ||
| 1163 | + $site_token = str_replace('_expired','',$projectInfo['site_token']); | ||
| 1159 | } | 1164 | } |
| 1165 | + | ||
| 1166 | + $projectModel->edit(['site_status'=>$this->param['site_status'],'site_token'=>$site_token],['id'=>$this->param['id']]); | ||
| 1160 | }else{ | 1167 | }else{ |
| 1161 | - //开启站点:创建建站任务 | ||
| 1162 | - $serverIpModel = new ServersIp(); | ||
| 1163 | - $serversIpInfo = $serverIpModel->read(['id' => $projectInfo['serve_id']], ['servers_id']); | ||
| 1164 | - if(!$serversIpInfo){ | ||
| 1165 | - $this->fail('获取项目所属服务器失败'); | 1168 | + //普通项目 |
| 1169 | + //获取域名数据 | ||
| 1170 | + $domainModel = new DomainInfoModel(); | ||
| 1171 | + $domainInfo = $domainModel->read(['project_id'=>$this->param['id']],['id','domain','amp_status']); | ||
| 1172 | + if(!$domainInfo){ | ||
| 1173 | + $this->fail('获取域名数据失败'); | ||
| 1166 | } | 1174 | } |
| 1167 | 1175 | ||
| 1168 | - if ($projectInfo['project_type'] == Project::PROJECT_TYPE_SEO) { | ||
| 1169 | - $type = DomainCreateTask::TYPE_BLOG; | ||
| 1170 | - } else { | ||
| 1171 | - $type = DomainCreateTask::TYPE_MAIN; | ||
| 1172 | - } | 1176 | + if($this->param['site_status'] == 1){ |
| 1177 | + //关闭站点:通知C端 | ||
| 1178 | + $re = curl_get('https://'.$domainInfo['domain'].'/api/stop_or_start_website'); | ||
| 1179 | + if(isset($re['status']) && $re['status'] !== 200){ | ||
| 1180 | + $this->fail($re['message']); | ||
| 1181 | + } | ||
| 1182 | + }else{ | ||
| 1183 | + //开启站点:创建建站任务 | ||
| 1184 | + $serverIpModel = new ServersIp(); | ||
| 1185 | + $serversIpInfo = $serverIpModel->read(['id' => $projectInfo['serve_id']], ['servers_id']); | ||
| 1186 | + if(!$serversIpInfo){ | ||
| 1187 | + $this->fail('获取项目所属服务器失败'); | ||
| 1188 | + } | ||
| 1173 | 1189 | ||
| 1174 | - //创建更新站点证书任务 | ||
| 1175 | - $domainCreateTaskModel = new DomainCreateTask(); | ||
| 1176 | - $task_info = $domainCreateTaskModel->read(['type' => $type, 'domain_id' => $domainInfo['id'], 'is_open' => DomainCreateTask::IS_OPEN, 'status' => ['<', DomainCreateTask::STATUS_SUC]], ['id']); | ||
| 1177 | - if (!$task_info) { | ||
| 1178 | - $domainCreateTaskModel->add([ | ||
| 1179 | - 'server_id' => $serversIpInfo['servers_id'], | ||
| 1180 | - 'project_id' => $this->param['id'], | ||
| 1181 | - 'domain_id' => $domainInfo['id'], | ||
| 1182 | - 'type' => $type, | ||
| 1183 | - 'is_open' => DomainCreateTask::IS_OPEN | ||
| 1184 | - ]); | ||
| 1185 | - } | 1190 | + if ($projectInfo['project_type'] == Project::PROJECT_TYPE_SEO) { |
| 1191 | + $type = DomainCreateTask::TYPE_BLOG; | ||
| 1192 | + } else { | ||
| 1193 | + $type = DomainCreateTask::TYPE_MAIN; | ||
| 1194 | + } | ||
| 1186 | 1195 | ||
| 1187 | - if($domainInfo['amp_status']){ | ||
| 1188 | - $task_info_amp = $domainCreateTaskModel->read(['type' => DomainCreateTask::TYPE_AMP, 'domain_id' => $domainInfo['id'], 'is_open' => DomainCreateTask::IS_OPEN, 'status' => ['<', DomainCreateTask::STATUS_SUC]], ['id']); | ||
| 1189 | - if (!$task_info_amp) { | 1196 | + //创建更新站点证书任务 |
| 1197 | + $domainCreateTaskModel = new DomainCreateTask(); | ||
| 1198 | + $task_info = $domainCreateTaskModel->read(['type' => $type, 'domain_id' => $domainInfo['id'], 'is_open' => DomainCreateTask::IS_OPEN, 'status' => ['<', DomainCreateTask::STATUS_SUC]], ['id']); | ||
| 1199 | + if (!$task_info) { | ||
| 1190 | $domainCreateTaskModel->add([ | 1200 | $domainCreateTaskModel->add([ |
| 1191 | 'server_id' => $serversIpInfo['servers_id'], | 1201 | 'server_id' => $serversIpInfo['servers_id'], |
| 1192 | 'project_id' => $this->param['id'], | 1202 | 'project_id' => $this->param['id'], |
| 1193 | 'domain_id' => $domainInfo['id'], | 1203 | 'domain_id' => $domainInfo['id'], |
| 1194 | - 'type' => DomainCreateTask::TYPE_AMP, | 1204 | + 'type' => $type, |
| 1195 | 'is_open' => DomainCreateTask::IS_OPEN | 1205 | 'is_open' => DomainCreateTask::IS_OPEN |
| 1196 | ]); | 1206 | ]); |
| 1197 | } | 1207 | } |
| 1208 | + | ||
| 1209 | + if($domainInfo['amp_status']){ | ||
| 1210 | + $task_info_amp = $domainCreateTaskModel->read(['type' => DomainCreateTask::TYPE_AMP, 'domain_id' => $domainInfo['id'], 'is_open' => DomainCreateTask::IS_OPEN, 'status' => ['<', DomainCreateTask::STATUS_SUC]], ['id']); | ||
| 1211 | + if (!$task_info_amp) { | ||
| 1212 | + $domainCreateTaskModel->add([ | ||
| 1213 | + 'server_id' => $serversIpInfo['servers_id'], | ||
| 1214 | + 'project_id' => $this->param['id'], | ||
| 1215 | + 'domain_id' => $domainInfo['id'], | ||
| 1216 | + 'type' => DomainCreateTask::TYPE_AMP, | ||
| 1217 | + 'is_open' => DomainCreateTask::IS_OPEN | ||
| 1218 | + ]); | ||
| 1219 | + } | ||
| 1220 | + } | ||
| 1198 | } | 1221 | } |
| 1199 | - } | ||
| 1200 | 1222 | ||
| 1201 | - $projectModel->edit(['site_status'=>$this->param['site_status']],['id'=>$this->param['id']]); | 1223 | + $projectModel->edit(['site_status'=>$this->param['site_status']],['id'=>$this->param['id']]); |
| 1224 | + } | ||
| 1202 | 1225 | ||
| 1203 | $this->response('success'); | 1226 | $this->response('success'); |
| 1204 | } | 1227 | } |
| @@ -1215,4 +1238,25 @@ class ProjectController extends BaseController | @@ -1215,4 +1238,25 @@ class ProjectController extends BaseController | ||
| 1215 | $this->response('success', Code::SUCCESS, $lists); | 1238 | $this->response('success', Code::SUCCESS, $lists); |
| 1216 | } | 1239 | } |
| 1217 | 1240 | ||
| 1241 | + /** | ||
| 1242 | + * @remark :生成关键词图表数据 | ||
| 1243 | + * @name :generateCountCharts | ||
| 1244 | + * @author :lyh | ||
| 1245 | + * @method :post | ||
| 1246 | + * @time :2025/6/10 10:51 | ||
| 1247 | + */ | ||
| 1248 | + public function generateCountCharts(){ | ||
| 1249 | + $this->request->validate([ | ||
| 1250 | + 'project_id'=>'required', | ||
| 1251 | + ],[ | ||
| 1252 | + 'project_id.required' => '项目id不能为空', | ||
| 1253 | + ]); | ||
| 1254 | + $noticeModel = new NoticeLog(); | ||
| 1255 | + $info = $noticeModel->read(['type'=>NoticeLog::TYPE_GENERATE_COUNT_CHARTS,'status'=>0,'data'=>['like','%"'.$this->param['project_id'].'"%']]); | ||
| 1256 | + if($info !== false){ | ||
| 1257 | + $this->fail('当前数据在生成中'); | ||
| 1258 | + } | ||
| 1259 | + NoticeLog::createLog(NoticeLog::TYPE_GENERATE_COUNT_CHARTS, ['project_id' => $this->param['project_id']]); | ||
| 1260 | + $this->response('success'); | ||
| 1261 | + } | ||
| 1218 | } | 1262 | } |
| @@ -210,7 +210,7 @@ class CNoticeController extends BaseController | @@ -210,7 +210,7 @@ class CNoticeController extends BaseController | ||
| 210 | * 更新通知C端 | 210 | * 更新通知C端 |
| 211 | * @param Request $request | 211 | * @param Request $request |
| 212 | * @return \Illuminate\Http\JsonResponse | 212 | * @return \Illuminate\Http\JsonResponse |
| 213 | - * @param : type : 1->主站更新 4->聚合页更新 | 213 | + * @param : type : 1->主站更新 4->聚合页更新 7->ai博客 |
| 214 | */ | 214 | */ |
| 215 | public function sendNotify(Request $request) | 215 | public function sendNotify(Request $request) |
| 216 | { | 216 | { |
| @@ -93,7 +93,7 @@ class OperationHeartbeatController extends BaseController | @@ -93,7 +93,7 @@ class OperationHeartbeatController extends BaseController | ||
| 93 | if($info === false){ | 93 | if($info === false){ |
| 94 | $info = []; | 94 | $info = []; |
| 95 | }else{ | 95 | }else{ |
| 96 | - $date_time = strtotime($info['updated_at']) + 120; | 96 | + $date_time = strtotime($info['updated_at']) + 60; |
| 97 | if($date_time < time()){ | 97 | if($date_time < time()){ |
| 98 | $operationHeartbeatModel->edit(['status'=>0,'ip'=>'127.0.0.1'],$condition); | 98 | $operationHeartbeatModel->edit(['status'=>0,'ip'=>'127.0.0.1'],$condition); |
| 99 | $info['status'] = 0; | 99 | $info['status'] = 0; |
| @@ -3,13 +3,17 @@ | @@ -3,13 +3,17 @@ | ||
| 3 | namespace App\Http\Controllers\Bside\Product; | 3 | namespace App\Http\Controllers\Bside\Product; |
| 4 | 4 | ||
| 5 | use App\Enums\Common\Code; | 5 | use App\Enums\Common\Code; |
| 6 | +use App\Helper\Common; | ||
| 7 | +use App\Helper\Gpt; | ||
| 6 | use App\Http\Controllers\Bside\BaseController; | 8 | use App\Http\Controllers\Bside\BaseController; |
| 7 | use App\Http\Logic\Bside\Product\KeywordLogic; | 9 | use App\Http\Logic\Bside\Product\KeywordLogic; |
| 8 | use App\Http\Requests\Bside\Product\KeywordRequest; | 10 | use App\Http\Requests\Bside\Product\KeywordRequest; |
| 11 | +use App\Models\Ai\AiCommand; | ||
| 9 | use App\Models\Product\Keyword; | 12 | use App\Models\Product\Keyword; |
| 10 | use App\Models\Product\KeywordPage; | 13 | use App\Models\Product\KeywordPage; |
| 11 | use App\Models\Product\KeywordRelated; | 14 | use App\Models\Product\KeywordRelated; |
| 12 | use App\Models\Product\Product; | 15 | use App\Models\Product\Product; |
| 16 | +use App\Models\Project\AggregateKeywordComment; | ||
| 13 | use App\Rules\Ids; | 17 | use App\Rules\Ids; |
| 14 | use Illuminate\Http\Request; | 18 | use Illuminate\Http\Request; |
| 15 | 19 | ||
| @@ -312,4 +316,73 @@ class KeywordController extends BaseController | @@ -312,4 +316,73 @@ class KeywordController extends BaseController | ||
| 312 | $logic->delAllRelated($this->param['keyword_id']); | 316 | $logic->delAllRelated($this->param['keyword_id']); |
| 313 | $this->response('success'); | 317 | $this->response('success'); |
| 314 | } | 318 | } |
| 319 | + | ||
| 320 | + /** | ||
| 321 | + * @remark :添加评论 | ||
| 322 | + * @name :saveComment | ||
| 323 | + * @author :lyh | ||
| 324 | + * @method :post | ||
| 325 | + * @time :2025/6/9 14:27 | ||
| 326 | + */ | ||
| 327 | + public function saveComment(KeywordLogic $logic){ | ||
| 328 | + $this->request->validate([ | ||
| 329 | + 'text'=>'required', | ||
| 330 | + 'nickname'=>'required', | ||
| 331 | + 'start_time'=>'required', | ||
| 332 | + ],[ | ||
| 333 | + 'text.required' => '评论内容不能为空', | ||
| 334 | + 'nickname.required'=>'昵称不能为空', | ||
| 335 | + 'start_time.required'=>'发布时间不能为空', | ||
| 336 | + ]); | ||
| 337 | + $data = $logic->saveComment(); | ||
| 338 | + $this->response('success',Code::SUCCESS,$data); | ||
| 339 | + } | ||
| 340 | + | ||
| 341 | + /** | ||
| 342 | + * @remark :生成评论 | ||
| 343 | + * @name :sendComment | ||
| 344 | + * @author :lyh | ||
| 345 | + * @method :post | ||
| 346 | + * @time :2025/6/9 11:10 | ||
| 347 | + */ | ||
| 348 | + public function sendComment(KeywordLogic $logic){ | ||
| 349 | + $this->request->validate([ | ||
| 350 | + 'count' => 'required|integer|max:100', | ||
| 351 | + ], [ | ||
| 352 | + 'count.required' => '生成条数不能为空', | ||
| 353 | + 'count.integer' => '生成条数必须是整数', | ||
| 354 | + 'count.max' => '生成条数最大不能超过100', | ||
| 355 | + ]); | ||
| 356 | + $data = $logic->sendComment(); | ||
| 357 | + $this->response('success',Code::SUCCESS,$data); | ||
| 358 | + } | ||
| 359 | + | ||
| 360 | + /** | ||
| 361 | + * @remark :获取评论 | ||
| 362 | + * @name :getComment | ||
| 363 | + * @author :lyh | ||
| 364 | + * @method :post | ||
| 365 | + * @time :2025/6/9 11:45 | ||
| 366 | + */ | ||
| 367 | + public function getComment(KeywordLogic $logic){ | ||
| 368 | + $data = $logic->getComment($this->map,$this->page,$this->row); | ||
| 369 | + $this->response('success',Code::SUCCESS,$data); | ||
| 370 | + } | ||
| 371 | + | ||
| 372 | + /** | ||
| 373 | + * @remark :删除评论 | ||
| 374 | + * @name :getComment | ||
| 375 | + * @author :lyh | ||
| 376 | + * @method :post | ||
| 377 | + * @time :2025/6/9 11:45 | ||
| 378 | + */ | ||
| 379 | + public function delComment(KeywordLogic $logic){ | ||
| 380 | + $this->request->validate([ | ||
| 381 | + 'id'=>'required', | ||
| 382 | + ],[ | ||
| 383 | + 'id.required' => '主键不能为空', | ||
| 384 | + ]); | ||
| 385 | + $data = $logic->delComment(); | ||
| 386 | + $this->response('success',Code::SUCCESS,$data); | ||
| 387 | + } | ||
| 315 | } | 388 | } |
| @@ -359,7 +359,7 @@ class ProductController extends BaseController | @@ -359,7 +359,7 @@ class ProductController extends BaseController | ||
| 359 | } | 359 | } |
| 360 | if (!empty($new_content)){ | 360 | if (!empty($new_content)){ |
| 361 | $detailModel = new Detail(); | 361 | $detailModel = new Detail(); |
| 362 | - $detailInfo = $detailModel->read(['column_id'=>1]); | 362 | + $detailInfo = $detailModel->read(['column_id'=>1,'product_id'=>$this->param['product_id']]); |
| 363 | if($detailInfo !== false && !empty($detailInfo['content'])){ | 363 | if($detailInfo !== false && !empty($detailInfo['content'])){ |
| 364 | $productInfo['content'] = $new_content . $detailInfo['content']['content']; | 364 | $productInfo['content'] = $new_content . $detailInfo['content']['content']; |
| 365 | } | 365 | } |
| @@ -23,7 +23,7 @@ class WebSettingImageController extends BaseController | @@ -23,7 +23,7 @@ class WebSettingImageController extends BaseController | ||
| 23 | * @time :2023/9/21 15:12 | 23 | * @time :2023/9/21 15:12 |
| 24 | */ | 24 | */ |
| 25 | public function lists(WebSettingImage $webSettingImage){ | 25 | public function lists(WebSettingImage $webSettingImage){ |
| 26 | - $list = $webSettingImage->list($this->map,'id',['id','image','type']); | 26 | + $list = $webSettingImage->list($this->map,'id',['id','image','type','is_call']); |
| 27 | foreach ($list as $k=>$v){ | 27 | foreach ($list as $k=>$v){ |
| 28 | $v['image'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']); | 28 | $v['image'] = getImageUrl($v['image'],$this->user['storage_type'],$this->user['project_location']); |
| 29 | $list[$k] = $v; | 29 | $list[$k] = $v; |
| @@ -40,11 +40,15 @@ class WebSettingImageController extends BaseController | @@ -40,11 +40,15 @@ class WebSettingImageController extends BaseController | ||
| 40 | */ | 40 | */ |
| 41 | public function save(WebSettingImage $webSettingImage){ | 41 | public function save(WebSettingImage $webSettingImage){ |
| 42 | try { | 42 | try { |
| 43 | - $webSettingImage->del(['project_id'=>$this->user['project_id']]); | ||
| 44 | foreach ($this->param['data'] as $v){ | 43 | foreach ($this->param['data'] as $v){ |
| 45 | - $v['project_id'] = $this->user['project_id']; | ||
| 46 | - $v['image'] = str_replace_url($v['image']); | ||
| 47 | - $webSettingImage->add($v); | 44 | + if(isset($v['id']) && !empty($v['id'])){ |
| 45 | + $v['image'] = str_replace_url($v['image']); | ||
| 46 | + $webSettingImage->edit($v,['id'=>$v['id']]); | ||
| 47 | + }else{ | ||
| 48 | + $v['project_id'] = $this->user['project_id']; | ||
| 49 | + $v['image'] = str_replace_url($v['image']); | ||
| 50 | + $webSettingImage->add($v); | ||
| 51 | + } | ||
| 48 | } | 52 | } |
| 49 | }catch (\Exception $e){ | 53 | }catch (\Exception $e){ |
| 50 | $this->response('系统错误请联系管理员'); | 54 | $this->response('系统错误请联系管理员'); |
| @@ -81,12 +81,14 @@ class RenewLogic extends BaseLogic | @@ -81,12 +81,14 @@ class RenewLogic extends BaseLogic | ||
| 81 | } | 81 | } |
| 82 | DB::beginTransaction(); | 82 | DB::beginTransaction(); |
| 83 | try { | 83 | try { |
| 84 | - $this->model->edit(['project_id'=>$this->param['id'],'operator_id'=>$this->manager['id']],['id'=>$this->param['renew_id']]); | 84 | + if($this->param['renew_id'] != 0){ |
| 85 | + $this->model->edit(['project_id'=>$this->param['id'],'operator_id'=>$this->manager['id']],['id'=>$this->param['renew_id']]); | ||
| 86 | + } | ||
| 85 | $param = $this->param; | 87 | $param = $this->param; |
| 86 | $param['api_no'] = $info['api_no'] ?? 0; | 88 | $param['api_no'] = $info['api_no'] ?? 0; |
| 87 | $this->saveLog($param); | 89 | $this->saveLog($param); |
| 88 | $this->updateProject($this->param['id'],$this->param['type']); | 90 | $this->updateProject($this->param['id'],$this->param['type']); |
| 89 | - $this->updateProjectBuild($this->param['id'],$this->param['service_duration'],$this->param['plan']); | 91 | + $this->updateProjectBuild($this->param['id'],$this->param['service_duration'] ?? 0,$this->param['plan']); |
| 90 | DB::commit(); | 92 | DB::commit(); |
| 91 | }catch (\Exception $e){ | 93 | }catch (\Exception $e){ |
| 92 | DB::rollBack(); | 94 | DB::rollBack(); |
| @@ -120,12 +122,12 @@ class RenewLogic extends BaseLogic | @@ -120,12 +122,12 @@ class RenewLogic extends BaseLogic | ||
| 120 | public function saveLog($param){ | 122 | public function saveLog($param){ |
| 121 | $data = [ | 123 | $data = [ |
| 122 | 'renew_id'=>$param['renew_id'], | 124 | 'renew_id'=>$param['renew_id'], |
| 123 | - 'service_duration'=>$param['service_duration'], | 125 | + 'service_duration'=>$param['service_duration'] ?? 0, |
| 124 | 'plan'=>$param['plan'], | 126 | 'plan'=>$param['plan'], |
| 125 | 'old_plan'=>$param['old_plan'], | 127 | 'old_plan'=>$param['old_plan'], |
| 126 | 'type'=>$param['type'], | 128 | 'type'=>$param['type'], |
| 127 | 'old_type'=>$param['old_type'], | 129 | 'old_type'=>$param['old_type'], |
| 128 | - 'amount'=>$param['amount'], | 130 | + 'amount'=>$param['amount'] ?? 0, |
| 129 | 'api_no'=>$param['api_no'], | 131 | 'api_no'=>$param['api_no'], |
| 130 | 'project_id'=>$param['id'], | 132 | 'project_id'=>$param['id'], |
| 131 | 'operator_id'=>$this->manager['id'], | 133 | 'operator_id'=>$this->manager['id'], |
| @@ -68,6 +68,7 @@ class AiBlogLogic extends BaseLogic | @@ -68,6 +68,7 @@ class AiBlogLogic extends BaseLogic | ||
| 68 | }catch (\Exception $e){ | 68 | }catch (\Exception $e){ |
| 69 | $this->fail('保存失败,请联系管理员'); | 69 | $this->fail('保存失败,请联系管理员'); |
| 70 | } | 70 | } |
| 71 | + $this->sendHttpC([$this->param['route'],'top-blog']); | ||
| 71 | shell_exec("php artisan save_ai_blog_list {$this->user['project_id']} > /dev/null 2>&1 &"); | 72 | shell_exec("php artisan save_ai_blog_list {$this->user['project_id']} > /dev/null 2>&1 &"); |
| 72 | return $this->success(); | 73 | return $this->success(); |
| 73 | } | 74 | } |
| @@ -9,7 +9,6 @@ | @@ -9,7 +9,6 @@ | ||
| 9 | 9 | ||
| 10 | namespace App\Http\Logic\Bside\Gpt; | 10 | namespace App\Http\Logic\Bside\Gpt; |
| 11 | 11 | ||
| 12 | -use App\Helper\Stream; | ||
| 13 | use App\Http\Logic\Bside\BaseLogic; | 12 | use App\Http\Logic\Bside\BaseLogic; |
| 14 | use App\Models\Gpt\Chat; | 13 | use App\Models\Gpt\Chat; |
| 15 | use App\Models\Gpt\ChatItem; | 14 | use App\Models\Gpt\ChatItem; |
| @@ -81,7 +81,7 @@ class NewsLogic extends BaseLogic | @@ -81,7 +81,7 @@ class NewsLogic extends BaseLogic | ||
| 81 | $this->edit(['url' => $route], ['id' => $id]); | 81 | $this->edit(['url' => $route], ['id' => $id]); |
| 82 | $this->curlDelRoute(['new_route'=>$route]); | 82 | $this->curlDelRoute(['new_route'=>$route]); |
| 83 | } | 83 | } |
| 84 | - $this->model->saveExtendInfo($id,$this->param['extend'] ?? []); | 84 | + $this->model->saveExtendInfo($id,$this->param['extend'] ?? [],$this->user['project_id']); |
| 85 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route); | 85 | $this->addUpdateNotify(RouteMap::SOURCE_NEWS,$route); |
| 86 | return $this->success(['id'=>$id]); | 86 | return $this->success(['id'=>$id]); |
| 87 | } | 87 | } |
| @@ -175,6 +175,9 @@ class NewsLogic extends BaseLogic | @@ -175,6 +175,9 @@ class NewsLogic extends BaseLogic | ||
| 175 | RouteMap::delRoute(RouteMap::SOURCE_NEWS, $id, $this->user['project_id']); | 175 | RouteMap::delRoute(RouteMap::SOURCE_NEWS, $id, $this->user['project_id']); |
| 176 | $this->delRoute($id); | 176 | $this->delRoute($id); |
| 177 | $this->model->del(['id' => $id]); | 177 | $this->model->del(['id' => $id]); |
| 178 | + //删除扩展字段 | ||
| 179 | + $extendInfoModel = new NewsExtendInfo(); | ||
| 180 | + $extendInfoModel->del(['news_id'=>$id]); | ||
| 178 | } | 181 | } |
| 179 | } | 182 | } |
| 180 | DB::commit(); | 183 | DB::commit(); |
| @@ -5,12 +5,15 @@ namespace App\Http\Logic\Bside\Product; | @@ -5,12 +5,15 @@ namespace App\Http\Logic\Bside\Product; | ||
| 5 | use App\Exceptions\BsideGlobalException; | 5 | use App\Exceptions\BsideGlobalException; |
| 6 | use App\Helper\Arr; | 6 | use App\Helper\Arr; |
| 7 | use App\Helper\Common; | 7 | use App\Helper\Common; |
| 8 | +use App\Helper\Gpt; | ||
| 8 | use App\Http\Logic\Bside\BaseLogic; | 9 | use App\Http\Logic\Bside\BaseLogic; |
| 10 | +use App\Models\Ai\AiCommand; | ||
| 9 | use App\Models\Com\NoticeLog; | 11 | use App\Models\Com\NoticeLog; |
| 10 | use App\Models\News\News; | 12 | use App\Models\News\News; |
| 11 | use App\Models\Product\Keyword; | 13 | use App\Models\Product\Keyword; |
| 12 | use App\Models\Product\KeywordRelated; | 14 | use App\Models\Product\KeywordRelated; |
| 13 | use App\Models\Product\Product; | 15 | use App\Models\Product\Product; |
| 16 | +use App\Models\Project\AggregateKeywordComment; | ||
| 14 | use App\Models\RouteMap\RouteMap; | 17 | use App\Models\RouteMap\RouteMap; |
| 15 | use App\Models\User\User; | 18 | use App\Models\User\User; |
| 16 | use Illuminate\Support\Facades\DB; | 19 | use Illuminate\Support\Facades\DB; |
| @@ -345,4 +348,110 @@ class KeywordLogic extends BaseLogic | @@ -345,4 +348,110 @@ class KeywordLogic extends BaseLogic | ||
| 345 | return $this->success(); | 348 | return $this->success(); |
| 346 | } | 349 | } |
| 347 | 350 | ||
| 351 | + /** | ||
| 352 | + * @remark :手动添加评论 | ||
| 353 | + * @name :saveComment | ||
| 354 | + * @author :lyh | ||
| 355 | + * @method :post | ||
| 356 | + * @time :2025/6/9 14:29 | ||
| 357 | + */ | ||
| 358 | + public function saveComment(){ | ||
| 359 | + $keywordCommonModel = new AggregateKeywordComment(); | ||
| 360 | + if(isset($this->param['id']) && !empty($this->param['id'])){ | ||
| 361 | + $id = $this->param['id']; | ||
| 362 | + $keywordCommonModel->edit($this->param,['id'=>$this->param['id']]); | ||
| 363 | + }else{ | ||
| 364 | + $param = [ | ||
| 365 | + 'nickname' => $this->param['nickname'], | ||
| 366 | + 'text' => $this->param['text'], | ||
| 367 | + 'project_id' => $this->user['project_id'], | ||
| 368 | + 'type' => 1, | ||
| 369 | + 'uid' => 0, | ||
| 370 | + 'start_time'=>$this->param['start_time'], | ||
| 371 | + 'created_at' => date('Y-m-d H:i:s'), | ||
| 372 | + 'updated_at' => date('Y-m-d H:i:s') | ||
| 373 | + ]; | ||
| 374 | + $id = $keywordCommonModel->addReturnId($param); | ||
| 375 | + } | ||
| 376 | + return $this->success(['id'=>$id]); | ||
| 377 | + } | ||
| 378 | + | ||
| 379 | + /** | ||
| 380 | + * @remark :保存数据 | ||
| 381 | + * @name :sendComment | ||
| 382 | + * @author :lyh | ||
| 383 | + * @method :post | ||
| 384 | + * @time :2025/6/9 11:19 | ||
| 385 | + */ | ||
| 386 | + public function sendComment() | ||
| 387 | + { | ||
| 388 | + $aiCommonModel = new AiCommand(); | ||
| 389 | + $info = $aiCommonModel->read(['key' => 'tag_comment','project_id'=>$this->user['project_id']]); | ||
| 390 | + if($info === false){ | ||
| 391 | + $info = $aiCommonModel->read(['key' => 'tag_comment']); | ||
| 392 | + $info['ai'] = str_replace('50', $this->param['count'], $info['ai']); | ||
| 393 | + } | ||
| 394 | + $text = Gpt::instance()->openai_chat_qqs($info['ai']); | ||
| 395 | + $text = Common::deal_keywords($text); | ||
| 396 | + preg_match_all('/\{[^{}]*\}/', $text, $matches); | ||
| 397 | + $data = []; | ||
| 398 | + $twoMonthsAgo = strtotime('-2 months'); | ||
| 399 | + | ||
| 400 | + if (!empty($text)) { | ||
| 401 | + foreach ($matches[0] as $item) { | ||
| 402 | + $item = str_replace("'", '"', $item); | ||
| 403 | + // 解码成 PHP 关联数组 | ||
| 404 | + $item = json_decode($item, true); | ||
| 405 | + if (!isset($item['name']) || !isset($item['comment'])) { | ||
| 406 | + continue; | ||
| 407 | + } | ||
| 408 | + $randomTimestamp = rand($twoMonthsAgo, time()); | ||
| 409 | + $randomDateTime = date('Y-m-d H:i:s', $randomTimestamp); | ||
| 410 | + $data[] = [ | ||
| 411 | + 'nickname' => $item['name'], | ||
| 412 | + 'text' => $item['comment'], | ||
| 413 | + 'project_id' => $this->user['project_id'], | ||
| 414 | + 'type' => 1, | ||
| 415 | + 'uid' => 0, | ||
| 416 | + 'start_time'=>$randomDateTime, | ||
| 417 | + 'created_at' => date('Y-m-d H:i:s'), | ||
| 418 | + 'updated_at' => date('Y-m-d H:i:s') | ||
| 419 | + ]; | ||
| 420 | + } | ||
| 421 | + } | ||
| 422 | + $keywordCommonModel = new AggregateKeywordComment(); | ||
| 423 | + $keywordCommonModel->insertAll($data); | ||
| 424 | + return $this->success($data); | ||
| 425 | + } | ||
| 426 | + | ||
| 427 | + /** | ||
| 428 | + * @remark :获取评论 | ||
| 429 | + * @name :getComment | ||
| 430 | + * @author :lyh | ||
| 431 | + * @method :post | ||
| 432 | + * @time :2025/6/9 11:46 | ||
| 433 | + */ | ||
| 434 | + public function getComment($map,$page,$row){ | ||
| 435 | + $keywordCommonModel = new AggregateKeywordComment(); | ||
| 436 | + $map['project_id'] = $this->user['project_id']; | ||
| 437 | + $lists = $keywordCommonModel->lists($map,$page,$row); | ||
| 438 | + return $this->success($lists); | ||
| 439 | + } | ||
| 440 | + | ||
| 441 | + /** | ||
| 442 | + * @remark :删除评论 | ||
| 443 | + * @name :delComment | ||
| 444 | + * @author :lyh | ||
| 445 | + * @method :post | ||
| 446 | + * @time :2025/6/9 11:48 | ||
| 447 | + */ | ||
| 448 | + public function delComment(){ | ||
| 449 | + $keywordCommonModel = new AggregateKeywordComment(); | ||
| 450 | + if($this->param['id'] == 0){ | ||
| 451 | + $keywordCommonModel->del(['project_id'=>$this->user['project_id']]); | ||
| 452 | + }else{ | ||
| 453 | + $keywordCommonModel->del(['id'=>$this->param['id']]); | ||
| 454 | + } | ||
| 455 | + return $this->success(); | ||
| 456 | + } | ||
| 348 | } | 457 | } |
| @@ -101,6 +101,7 @@ class RankDataLogic extends BaseLogic | @@ -101,6 +101,7 @@ class RankDataLogic extends BaseLogic | ||
| 101 | 'keyword_num' => $project['deploy_build']['keyword_num'], | 101 | 'keyword_num' => $project['deploy_build']['keyword_num'], |
| 102 | 'compliance_day' => $project['finish_remain_day'] ?? 0, | 102 | 'compliance_day' => $project['finish_remain_day'] ?? 0, |
| 103 | 'remain_day' => $project['remain_day'], | 103 | 'remain_day' => $project['remain_day'], |
| 104 | + 'seo_remain_day' => $project['seo_remain_day'], | ||
| 104 | 'g_top_plan' => $g_top_plan ?? [], | 105 | 'g_top_plan' => $g_top_plan ?? [], |
| 105 | ]; | 106 | ]; |
| 106 | //小语种列表 | 107 | //小语种列表 |
| @@ -14,6 +14,7 @@ class NoticeLog extends Base | @@ -14,6 +14,7 @@ class NoticeLog extends Base | ||
| 14 | const TYPE_RANK_DATA = 'rank_data'; | 14 | const TYPE_RANK_DATA = 'rank_data'; |
| 15 | const TYPE_INIT_PROJECT = 'init_project'; | 15 | const TYPE_INIT_PROJECT = 'init_project'; |
| 16 | const TYPE_INIT_KEYWORD_COMMON = 'init_keyword_common';//聚合页关键词评论 | 16 | const TYPE_INIT_KEYWORD_COMMON = 'init_keyword_common';//聚合页关键词评论 |
| 17 | + const TYPE_GENERATE_COUNT_CHARTS = 'generate_count_charts';//聚合页关键字图表生成 | ||
| 17 | const TYPE_COPY_PROJECT = 'copy_project'; | 18 | const TYPE_COPY_PROJECT = 'copy_project'; |
| 18 | const TYPE_INIT_KEYWORD = 'init_keyword'; | 19 | const TYPE_INIT_KEYWORD = 'init_keyword'; |
| 19 | const DELETE_PRODUCT_CATEGORY = 'delete_product_category'; | 20 | const DELETE_PRODUCT_CATEGORY = 'delete_product_category'; |
| @@ -80,7 +80,7 @@ class News extends Base | @@ -80,7 +80,7 @@ class News extends Base | ||
| 80 | $arr = json_decode($info['values']); | 80 | $arr = json_decode($info['values']); |
| 81 | foreach ($arr as $k1=>$v1){ | 81 | foreach ($arr as $k1=>$v1){ |
| 82 | $v1 = (array)$v1; | 82 | $v1 = (array)$v1; |
| 83 | - $v1['url'] = getImageUrl($v1['url'],$this->user['storage_type'],$this->user['project_location']); | 83 | + $v1['url'] = getImageUrl($v1['url']); |
| 84 | $arr[$k1] = $v1; | 84 | $arr[$k1] = $v1; |
| 85 | } | 85 | } |
| 86 | $v['values'] = $arr; | 86 | $v['values'] = $arr; |
| @@ -89,9 +89,9 @@ class News extends Base | @@ -89,9 +89,9 @@ class News extends Base | ||
| 89 | foreach ($arr1 as $k1=>$v1){ | 89 | foreach ($arr1 as $k1=>$v1){ |
| 90 | $v1 = (array)$v1; | 90 | $v1 = (array)$v1; |
| 91 | if(isset($v1['url'])){ | 91 | if(isset($v1['url'])){ |
| 92 | - $v1['url'] = getFileUrl($v1['url'],$this->user['storage_type'],$this->user['project_location'],$this->user['file_cdn'] ?? 0); | 92 | + $v1['url'] = getFileUrl($v1['url']); |
| 93 | }else{ | 93 | }else{ |
| 94 | - $v1 = getFileUrl($v1,$this->user['storage_type'],$this->user['project_location'],$this->user['file_cdn'] ?? 0); | 94 | + $v1 = getFileUrl($v1); |
| 95 | } | 95 | } |
| 96 | $arr1[$k1] = $v1; | 96 | $arr1[$k1] = $v1; |
| 97 | } | 97 | } |
| @@ -109,7 +109,7 @@ class News extends Base | @@ -109,7 +109,7 @@ class News extends Base | ||
| 109 | * @method :post | 109 | * @method :post |
| 110 | * @time :2023/11/9 15:02 | 110 | * @time :2023/11/9 15:02 |
| 111 | */ | 111 | */ |
| 112 | - public function saveExtendInfo($news_id,$extend){ | 112 | + public function saveExtendInfo($news_id,$extend,$project_id){ |
| 113 | //先删除以前的数据 | 113 | //先删除以前的数据 |
| 114 | $extendInfoModel = new NewsExtendInfo(); | 114 | $extendInfoModel = new NewsExtendInfo(); |
| 115 | $extendInfoModel->del(['news_id'=>$news_id]); | 115 | $extendInfoModel->del(['news_id'=>$news_id]); |
| @@ -120,7 +120,7 @@ class News extends Base | @@ -120,7 +120,7 @@ class News extends Base | ||
| 120 | if(empty($v['values'])){ | 120 | if(empty($v['values'])){ |
| 121 | continue; | 121 | continue; |
| 122 | } | 122 | } |
| 123 | - $v = $this->saveHandleExtend($v,$news_id); | 123 | + $v = $this->saveHandleExtend($v,$news_id,$project_id); |
| 124 | $extendInfoModel->add($v); | 124 | $extendInfoModel->add($v); |
| 125 | } | 125 | } |
| 126 | return true; | 126 | return true; |
| @@ -133,7 +133,7 @@ class News extends Base | @@ -133,7 +133,7 @@ class News extends Base | ||
| 133 | * @method :post | 133 | * @method :post |
| 134 | * @time :2023/12/6 15:11 | 134 | * @time :2023/12/6 15:11 |
| 135 | */ | 135 | */ |
| 136 | - public function saveHandleExtend(&$v,$news_id){ | 136 | + public function saveHandleExtend(&$v,$news_id,$project_id){ |
| 137 | unset($v['title']); | 137 | unset($v['title']); |
| 138 | if($v['type'] == 3){ | 138 | if($v['type'] == 3){ |
| 139 | foreach ($v['values'] as $k1=>$v1){ | 139 | foreach ($v['values'] as $k1=>$v1){ |
| @@ -148,7 +148,7 @@ class News extends Base | @@ -148,7 +148,7 @@ class News extends Base | ||
| 148 | } | 148 | } |
| 149 | $v['values'] = json_encode($v['values']); | 149 | $v['values'] = json_encode($v['values']); |
| 150 | } | 150 | } |
| 151 | - $v['project_id'] = $this->user['project_id']; | 151 | + $v['project_id'] = $project_id; |
| 152 | $v['news_id'] = $news_id; | 152 | $v['news_id'] = $news_id; |
| 153 | return $v; | 153 | return $v; |
| 154 | } | 154 | } |
| @@ -209,6 +209,7 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -209,6 +209,7 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 209 | Route::any('/getKeywordPrefix', [Aside\Project\KeywordPrefixController::class, 'getKeywordPrefix'])->name('admin.keyword_getKeywordPrefix'); | 209 | Route::any('/getKeywordPrefix', [Aside\Project\KeywordPrefixController::class, 'getKeywordPrefix'])->name('admin.keyword_getKeywordPrefix'); |
| 210 | Route::any('/save', [Aside\Project\KeywordPrefixController::class, 'save'])->name('admin.keyword_save'); | 210 | Route::any('/save', [Aside\Project\KeywordPrefixController::class, 'save'])->name('admin.keyword_save'); |
| 211 | Route::any('/del', [Aside\Project\KeywordPrefixController::class, 'del'])->name('admin.keyword_del'); | 211 | Route::any('/del', [Aside\Project\KeywordPrefixController::class, 'del'])->name('admin.keyword_del'); |
| 212 | + Route::any('/generateCountCharts', [Aside\Project\ProjectController::class, 'generateCountCharts'])->name('admin.keyword_generateCountCharts'); | ||
| 212 | }); | 213 | }); |
| 213 | //企业资料库 | 214 | //企业资料库 |
| 214 | Route::prefix('enterprise_product')->group(function () { | 215 | Route::prefix('enterprise_product')->group(function () { |
| @@ -327,6 +327,10 @@ Route::middleware(['bloginauth'])->group(function () { | @@ -327,6 +327,10 @@ Route::middleware(['bloginauth'])->group(function () { | ||
| 327 | Route::any('keyword/batchKeywordIsVideo', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordIsVideo'])->name('product_keyword_batchKeywordIsVideo'); | 327 | Route::any('keyword/batchKeywordIsVideo', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordIsVideo'])->name('product_keyword_batchKeywordIsVideo'); |
| 328 | Route::any('keyword/batchKeywordFiled', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordFiled'])->name('product_keyword_batchKeywordFiled'); | 328 | Route::any('keyword/batchKeywordFiled', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'batchKeywordFiled'])->name('product_keyword_batchKeywordFiled'); |
| 329 | Route::any('keyword/delRelatedProductId', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delRelatedProductId'])->name('product_keyword_delRelatedProductId'); | 329 | Route::any('keyword/delRelatedProductId', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delRelatedProductId'])->name('product_keyword_delRelatedProductId'); |
| 330 | + Route::any('keyword/sendComment', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'sendComment'])->name('product_keyword_sendComment'); | ||
| 331 | + Route::any('keyword/getComment', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'getComment'])->name('product_keyword_getComment'); | ||
| 332 | + Route::any('keyword/delComment', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'delComment'])->name('product_keyword_delComment'); | ||
| 333 | + Route::any('keyword/saveComment', [\App\Http\Controllers\Bside\Product\KeywordController::class, 'saveComment'])->name('product_keyword_saveComment'); | ||
| 330 | //产品参数 | 334 | //产品参数 |
| 331 | Route::get('attr', [\App\Http\Controllers\Bside\Product\AttrController::class, 'index'])->name('product_attr'); | 335 | Route::get('attr', [\App\Http\Controllers\Bside\Product\AttrController::class, 'index'])->name('product_attr'); |
| 332 | Route::get('attr/info', [\App\Http\Controllers\Bside\Product\AttrController::class, 'info'])->name('product_attr_info'); | 336 | Route::get('attr/info', [\App\Http\Controllers\Bside\Product\AttrController::class, 'info'])->name('product_attr_info'); |
-
请 注册 或 登录 后发表评论