Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
69 个修改的文件
包含
682 行增加
和
331 行删除
| @@ -44,9 +44,9 @@ class ShareUser extends Command | @@ -44,9 +44,9 @@ class ShareUser extends Command | ||
| 44 | //获取所有ayr_share用户 | 44 | //获取所有ayr_share用户 |
| 45 | $ayr_share_model = new AyrShareModel(); | 45 | $ayr_share_model = new AyrShareModel(); |
| 46 | $ayr_release = new AyrReleaseModel(); | 46 | $ayr_release = new AyrReleaseModel(); |
| 47 | - $ayr_share_list = $ayr_share_model->list(['profile_key'=>['!=','']]); | 47 | + $ayr_share_list = $ayr_share_model->list(['profile_key'=>['!=',''],'project_id'=>410]); |
| 48 | foreach ($ayr_share_list as $v){ | 48 | foreach ($ayr_share_list as $v){ |
| 49 | - $time = Carbon::now()->modify('-7 days')->toDateString(); | 49 | + $time = Carbon::now()->modify('-1 days')->toDateString(); |
| 50 | //创建时间小于7天前的当前时间 | 50 | //创建时间小于7天前的当前时间 |
| 51 | if($v['created_at'] > $time){ | 51 | if($v['created_at'] > $time){ |
| 52 | continue; | 52 | continue; |
| @@ -43,7 +43,7 @@ class Count extends Command | @@ -43,7 +43,7 @@ class Count extends Command | ||
| 43 | public function handle() | 43 | public function handle() |
| 44 | { | 44 | { |
| 45 | $list = DB::table('gl_project')->where('gl_project.extend_type','=',0) | 45 | $list = DB::table('gl_project')->where('gl_project.extend_type','=',0) |
| 46 | - ->where('gl_project.type','!=',0) | 46 | + ->whereIn('gl_project.type',[1,2,3,4,6]) |
| 47 | ->leftJoin('gl_project_deploy_build', 'gl_project.id', '=', 'gl_project_deploy_build.project_id') | 47 | ->leftJoin('gl_project_deploy_build', 'gl_project.id', '=', 'gl_project_deploy_build.project_id') |
| 48 | ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id') | 48 | ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id') |
| 49 | ->select($this->selectParam())->get(); | 49 | ->select($this->selectParam())->get(); |
| @@ -38,7 +38,7 @@ class CountAll extends Command | @@ -38,7 +38,7 @@ class CountAll extends Command | ||
| 38 | 38 | ||
| 39 | public function handle(){ | 39 | public function handle(){ |
| 40 | $projectModel = new Project(); | 40 | $projectModel = new Project(); |
| 41 | - $list = $projectModel->list(['delete_status'=>0]); | 41 | + $list = $projectModel->list(['delete_status'=>0,'type'=>['in',[1,2,3,4,6]]]); |
| 42 | foreach ($list as $v) { | 42 | foreach ($list as $v) { |
| 43 | echo date('Y-m-d H:i:s') . '项目id:'.$v['id'] . PHP_EOL; | 43 | echo date('Y-m-d H:i:s') . '项目id:'.$v['id'] . PHP_EOL; |
| 44 | ProjectServer::useProject($v['id']); | 44 | ProjectServer::useProject($v['id']); |
| @@ -10,6 +10,7 @@ | @@ -10,6 +10,7 @@ | ||
| 10 | namespace App\Console\Commands\DeleteTemplate; | 10 | namespace App\Console\Commands\DeleteTemplate; |
| 11 | 11 | ||
| 12 | use App\Models\Project\Project; | 12 | use App\Models\Project\Project; |
| 13 | +use App\Models\Template\BTemplateLog; | ||
| 13 | use App\Services\ProjectServer; | 14 | use App\Services\ProjectServer; |
| 14 | use Illuminate\Console\Command; | 15 | use Illuminate\Console\Command; |
| 15 | use Illuminate\Support\Facades\DB; | 16 | use Illuminate\Support\Facades\DB; |
| @@ -46,6 +47,7 @@ class TemplateLog extends Command | @@ -46,6 +47,7 @@ class TemplateLog extends Command | ||
| 46 | foreach ($list as $v){ | 47 | foreach ($list as $v){ |
| 47 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | 48 | echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; |
| 48 | ProjectServer::useProject($v['id']); | 49 | ProjectServer::useProject($v['id']); |
| 50 | + $this->deleteTemplate(); | ||
| 49 | DB::disconnect('custom_mysql'); | 51 | DB::disconnect('custom_mysql'); |
| 50 | } | 52 | } |
| 51 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | 53 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; |
| @@ -59,6 +61,9 @@ class TemplateLog extends Command | @@ -59,6 +61,9 @@ class TemplateLog extends Command | ||
| 59 | * @time :2024/7/10 14:48 | 61 | * @time :2024/7/10 14:48 |
| 60 | */ | 62 | */ |
| 61 | public function deleteTemplate(){ | 63 | public function deleteTemplate(){ |
| 62 | - | 64 | + $startDate = date("Y-m-01 00:00:00"); |
| 65 | + $endDate = date("Y-m-t 23:59:59"); | ||
| 66 | + $templateLogModel = new BTemplateLog(); | ||
| 67 | + return $templateLogModel->del(['created_at'=>['not between'=>[$startDate,$endDate]]]); | ||
| 63 | } | 68 | } |
| 64 | } | 69 | } |
| @@ -153,7 +153,7 @@ class DomainInfo extends Command | @@ -153,7 +153,7 @@ class DomainInfo extends Command | ||
| 153 | $servers_ip_info = $serverIpModel->read(['id' => $project_info['serve_id']], ['servers_id']); | 153 | $servers_ip_info = $serverIpModel->read(['id' => $project_info['serve_id']], ['servers_id']); |
| 154 | if ($servers_ip_info && $servers_ip_info['servers_id'] != ServerConfig::SELF_SITE_ID) { | 154 | if ($servers_ip_info && $servers_ip_info['servers_id'] != ServerConfig::SELF_SITE_ID) { |
| 155 | //非自建站项目,申请免费证书 | 155 | //非自建站项目,申请免费证书 |
| 156 | - $this->updateAmpPrivate($v['domain']); | 156 | + $this->updateAmpPrivate($v); |
| 157 | 157 | ||
| 158 | $ssl_new = $this->updateDomainSsl($v['domain']); | 158 | $ssl_new = $this->updateDomainSsl($v['domain']); |
| 159 | $ssl_new['from'] && $data['certificate_start_time'] = $ssl_new['from']; | 159 | $ssl_new['from'] && $data['certificate_start_time'] = $ssl_new['from']; |
| @@ -212,24 +212,28 @@ class DomainInfo extends Command | @@ -212,24 +212,28 @@ class DomainInfo extends Command | ||
| 212 | "rewrite" => $param['extend_config'], | 212 | "rewrite" => $param['extend_config'], |
| 213 | 'other_domain' => $param['other_domain'], | 213 | 'other_domain' => $param['other_domain'], |
| 214 | 'is_https' => $param['is_https'], | 214 | 'is_https' => $param['is_https'], |
| 215 | + 'not_allow_country' => $param['not_allow_country'], | ||
| 216 | + 'not_allow_ip' => $param['not_allow_ip'], | ||
| 217 | + 'is_redirect' => $param['is_redirect'] | ||
| 215 | ]; | 218 | ]; |
| 216 | return $this->curlRequest($url, $param); | 219 | return $this->curlRequest($url, $param); |
| 217 | } | 220 | } |
| 218 | 221 | ||
| 219 | /** | 222 | /** |
| 220 | * 更新amp站证书 | 223 | * 更新amp站证书 |
| 221 | - * @param $domain | 224 | + * @param $param |
| 222 | * @return array | 225 | * @return array |
| 223 | * @author Akun | 226 | * @author Akun |
| 224 | * @date 2024/02/26 10:25 | 227 | * @date 2024/02/26 10:25 |
| 225 | */ | 228 | */ |
| 226 | - public function updateAmpPrivate($domain) | 229 | + public function updateAmpPrivate($param) |
| 227 | { | 230 | { |
| 228 | - $url = 'https://' . $domain . '/api/createSiteAmp/'; | 231 | + $url = 'https://' . $param['domain'] . '/api/createSiteAmp/'; |
| 229 | $param = [ | 232 | $param = [ |
| 230 | - "domain" => $domain, | ||
| 231 | - 'private_key' => '', | ||
| 232 | - 'cert' => '' | 233 | + "domain" => $param['domain'], |
| 234 | + 'not_allow_country' => $param['not_allow_country'], | ||
| 235 | + 'not_allow_ip' => $param['not_allow_ip'], | ||
| 236 | + 'is_redirect' => $param['is_redirect'] | ||
| 233 | ]; | 237 | ]; |
| 234 | return $this->curlRequest($url, $param); | 238 | return $this->curlRequest($url, $param); |
| 235 | } | 239 | } |
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | 2 | ||
| 3 | namespace App\Console\Commands\Domain; | 3 | namespace App\Console\Commands\Domain; |
| 4 | 4 | ||
| 5 | +use App\Models\Project\DeployOptimize; | ||
| 5 | use App\Models\Project\OnlineCheck; | 6 | use App\Models\Project\OnlineCheck; |
| 6 | use App\Models\Project\Project; | 7 | use App\Models\Project\Project; |
| 7 | use Illuminate\Console\Command; | 8 | use Illuminate\Console\Command; |
| @@ -22,6 +23,9 @@ class RemainDay extends Command | @@ -22,6 +23,9 @@ class RemainDay extends Command | ||
| 22 | */ | 23 | */ |
| 23 | protected $signature = 'remain_day'; | 24 | protected $signature = 'remain_day'; |
| 24 | 25 | ||
| 26 | + protected $projectId = [ | ||
| 27 | + 1434 | ||
| 28 | + ];//需要单独处理的项目 | ||
| 25 | /** | 29 | /** |
| 26 | * The console command description. | 30 | * The console command description. |
| 27 | * | 31 | * |
| @@ -44,20 +48,29 @@ class RemainDay extends Command | @@ -44,20 +48,29 @@ class RemainDay extends Command | ||
| 44 | */ | 48 | */ |
| 45 | public function handle() | 49 | public function handle() |
| 46 | { | 50 | { |
| 47 | - $list = Project::whereIn('type', [2,3,4])->get(); | 51 | + $list = Project::whereIn('type', [Project::TYPE_TWO,Project::TYPE_THREE,Project::TYPE_FOUR])->get(); |
| 48 | foreach ($list as $item){ | 52 | foreach ($list as $item){ |
| 49 | - if($item['type'] == Project::TYPE_TWO){ | ||
| 50 | - //获取当前项目的达标天数 | ||
| 51 | - $compliance_day = Project::where(['id' => $item['id']])->value('finish_remain_day') ?: 0; | ||
| 52 | - $remain_day = $item['deploy_build']['service_duration'] - $compliance_day; | 53 | + if(in_array($item->id,$this->projectId)){//已开始优化的时间结算 |
| 54 | + $optimizeModel = new DeployOptimize(); | ||
| 55 | + $opInfo = $optimizeModel->read(['project_id'=>$item->id],['start_date']); | ||
| 56 | + if($opInfo === false){ | ||
| 57 | + continue; | ||
| 58 | + } | ||
| 59 | + $diff = time() - strtotime($opInfo['start_date'] ?? $item->uptime); | ||
| 60 | + $remain_day = $item['deploy_build']['service_duration'] - floor($diff / (60 * 60 * 24)); | ||
| 53 | }else{ | 61 | }else{ |
| 54 | - //审核上线后开始 | ||
| 55 | - $check_time = OnlineCheck::where('project_id', $item['id'])->where('status', 1)->value('created_at') ?: ''; | ||
| 56 | - if(!$check_time){ | ||
| 57 | - $remain_day = $item['deploy_build']['service_duration']; | 62 | + if($item['type'] == Project::TYPE_TWO){ |
| 63 | + //获取当前项目的达标天数 | ||
| 64 | + $compliance_day = $item->finish_remain_day ?? 0; | ||
| 65 | + $remain_day = $item['deploy_build']['service_duration'] - $compliance_day; | ||
| 58 | }else{ | 66 | }else{ |
| 59 | - $diff = time() - strtotime($check_time); | ||
| 60 | - $remain_day = floor($diff / (60 * 60 * 24)); | 67 | + if($item->uptime){ |
| 68 | + $diff = time() - strtotime($item->uptime); | ||
| 69 | + $item->finish_remain_day = floor($diff / (60 * 60 * 24)); | ||
| 70 | + $remain_day = $item['deploy_build']['service_duration'] - floor($diff / (60 * 60 * 24)); | ||
| 71 | + }else{ | ||
| 72 | + $remain_day = $item['deploy_build']['service_duration']; | ||
| 73 | + } | ||
| 61 | } | 74 | } |
| 62 | } | 75 | } |
| 63 | $item->remain_day = $remain_day > 0 ? $remain_day : 0; | 76 | $item->remain_day = $remain_day > 0 ? $remain_day : 0; |
| @@ -16,9 +16,12 @@ use App\Models\Product\Keyword; | @@ -16,9 +16,12 @@ use App\Models\Product\Keyword; | ||
| 16 | use App\Models\Product\Product; | 16 | use App\Models\Product\Product; |
| 17 | use App\Services\ProjectServer; | 17 | use App\Services\ProjectServer; |
| 18 | use Illuminate\Console\Command; | 18 | use Illuminate\Console\Command; |
| 19 | +use Illuminate\Support\Carbon; | ||
| 20 | +use Illuminate\Support\Facades\Cache; | ||
| 19 | use Illuminate\Support\Facades\DB; | 21 | use Illuminate\Support\Facades\DB; |
| 20 | use Illuminate\Support\Facades\Http; | 22 | use Illuminate\Support\Facades\Http; |
| 21 | use Illuminate\Support\Facades\Log; | 23 | use Illuminate\Support\Facades\Log; |
| 24 | +use Illuminate\Support\Facades\Redis; | ||
| 22 | 25 | ||
| 23 | class VideoTask extends Command | 26 | class VideoTask extends Command |
| 24 | { | 27 | { |
| @@ -50,15 +53,19 @@ class VideoTask extends Command | @@ -50,15 +53,19 @@ class VideoTask extends Command | ||
| 50 | * @var int 最大子任务 | 53 | * @var int 最大子任务 |
| 51 | */ | 54 | */ |
| 52 | public $max_sub_task = 200; | 55 | public $max_sub_task = 200; |
| 53 | - | 56 | + public $max_num = 49000; |
| 54 | /** | 57 | /** |
| 55 | * @return bool | 58 | * @return bool |
| 56 | */ | 59 | */ |
| 57 | public function handle() | 60 | public function handle() |
| 58 | { | 61 | { |
| 59 | - echo '开始:'.PHP_EOL; | ||
| 60 | Log::info('开始视频推广任务'); | 62 | Log::info('开始视频推广任务'); |
| 61 | - $this->createSubTask(); | 63 | + $number = KeywordVideoTaskLog::getMonthVideoNum(); |
| 64 | + if($number >= $this->max_num){ | ||
| 65 | + Log::info('当月以达到最大视频生成数,任务执行数:' . $number); | ||
| 66 | + return true; | ||
| 67 | + } | ||
| 68 | + $this->createSubTask($number); | ||
| 62 | $this->sendSubTask(); | 69 | $this->sendSubTask(); |
| 63 | Log::info('结束视频推广任务'); | 70 | Log::info('结束视频推广任务'); |
| 64 | return true; | 71 | return true; |
| @@ -69,13 +76,16 @@ class VideoTask extends Command | @@ -69,13 +76,16 @@ class VideoTask extends Command | ||
| 69 | * TODO 获取需要生成子任务的项目,获取项目中未生成视频的关键词,通过关键词生成初始化子任务 | 76 | * TODO 获取需要生成子任务的项目,获取项目中未生成视频的关键词,通过关键词生成初始化子任务 |
| 70 | * @return bool | 77 | * @return bool |
| 71 | */ | 78 | */ |
| 72 | - public function createSubTask() | 79 | + public function createSubTask($number) |
| 73 | { | 80 | { |
| 74 | $sub_task_num = $this->max_sub_task; | 81 | $sub_task_num = $this->max_sub_task; |
| 75 | while (true) { | 82 | while (true) { |
| 76 | if ($sub_task_num <= 0){ | 83 | if ($sub_task_num <= 0){ |
| 77 | break; | 84 | break; |
| 78 | } | 85 | } |
| 86 | + if($number >= $this->max_num){ | ||
| 87 | + break; | ||
| 88 | + } | ||
| 79 | $task_project = KeywordVideoTask::where(['status' => KeywordVideoTask::STATUS_OPEN])->orderBy('sort', 'desc')->orderBy('id', 'desc')->first(); | 89 | $task_project = KeywordVideoTask::where(['status' => KeywordVideoTask::STATUS_OPEN])->orderBy('sort', 'desc')->orderBy('id', 'desc')->first(); |
| 80 | if (empty($task_project)){ | 90 | if (empty($task_project)){ |
| 81 | break; | 91 | break; |
| @@ -101,7 +111,7 @@ class VideoTask extends Command | @@ -101,7 +111,7 @@ class VideoTask extends Command | ||
| 101 | } | 111 | } |
| 102 | $logo_bg = $this->getImage($domainInfo); | 112 | $logo_bg = $this->getImage($domainInfo); |
| 103 | foreach ($keyword as $val) { | 113 | foreach ($keyword as $val) { |
| 104 | - $log = KeywordVideoTaskLog::where(['project_id' => $task_project->project_id, 'keyword_id' => $val->id])->first(); | 114 | + $log = KeywordVideoTaskLog::where(['project_id' => $task_project->project_id, 'keyword_id' => $val->id , 'result_status'=>'200'])->first(); |
| 105 | if ($log){ | 115 | if ($log){ |
| 106 | continue; | 116 | continue; |
| 107 | } | 117 | } |
| @@ -124,6 +134,7 @@ class VideoTask extends Command | @@ -124,6 +134,7 @@ class VideoTask extends Command | ||
| 124 | } | 134 | } |
| 125 | } | 135 | } |
| 126 | } | 136 | } |
| 137 | + Cache::put('video_keyword_number_month',$number + count($keyword),3600); | ||
| 127 | $task_project->status = KeywordVideoTask::STATUS_CLOSE; | 138 | $task_project->status = KeywordVideoTask::STATUS_CLOSE; |
| 128 | $task_project->save(); | 139 | $task_project->save(); |
| 129 | } | 140 | } |
| @@ -39,7 +39,7 @@ class MonthAllCount extends Command | @@ -39,7 +39,7 @@ class MonthAllCount extends Command | ||
| 39 | 39 | ||
| 40 | public function handle(){ | 40 | public function handle(){ |
| 41 | $projectModel = new Project(); | 41 | $projectModel = new Project(); |
| 42 | - $list = $projectModel->list(['delete_status'=>0]); | 42 | + $list = $projectModel->list(['delete_status'=>0,'type'=>['in',[1,2,3,4,6]]]); |
| 43 | foreach ($list as $v) { | 43 | foreach ($list as $v) { |
| 44 | if($v['is_upgrade'] == 1){ | 44 | if($v['is_upgrade'] == 1){ |
| 45 | $oldModel = new UpdateOldInfo(); | 45 | $oldModel = new UpdateOldInfo(); |
| @@ -36,7 +36,7 @@ class MonthCount extends Command | @@ -36,7 +36,7 @@ class MonthCount extends Command | ||
| 36 | 36 | ||
| 37 | public function handle(){ | 37 | public function handle(){ |
| 38 | $list = DB::table('gl_project')->where('gl_project.extend_type','=',0) | 38 | $list = DB::table('gl_project')->where('gl_project.extend_type','=',0) |
| 39 | - ->where('gl_project.type','!=',0) | 39 | + ->whereIn('gl_project.type',[1,2,3,4,6]) |
| 40 | ->leftJoin('gl_project_deploy_build', 'gl_project.id', '=', 'gl_project_deploy_build.project_id') | 40 | ->leftJoin('gl_project_deploy_build', 'gl_project.id', '=', 'gl_project_deploy_build.project_id') |
| 41 | ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id') | 41 | ->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id') |
| 42 | ->select($this->selectParam())->get()->toArray(); | 42 | ->select($this->selectParam())->get()->toArray(); |
| @@ -105,7 +105,7 @@ class ReplaceHtml extends Command | @@ -105,7 +105,7 @@ class ReplaceHtml extends Command | ||
| 105 | 'source_id'=>$v['id'], | 105 | 'source_id'=>$v['id'], |
| 106 | 'is_rollback'=>$info['is_rollback'], | 106 | 'is_rollback'=>$info['is_rollback'], |
| 107 | 'template_id'=>$info['template_id'], | 107 | 'template_id'=>$info['template_id'], |
| 108 | - 'name'=>$v['name'], | 108 | + 'source_name'=>$v['name'], |
| 109 | 'created_at'=>date('Y-m-d H:i:s'), | 109 | 'created_at'=>date('Y-m-d H:i:s'), |
| 110 | 'updated_at'=>date('Y-m-d H:i:s') | 110 | 'updated_at'=>date('Y-m-d H:i:s') |
| 111 | ]; | 111 | ]; |
| @@ -10,6 +10,7 @@ use App\Models\Domain\DomainInfo; | @@ -10,6 +10,7 @@ use App\Models\Domain\DomainInfo; | ||
| 10 | use App\Models\Mail\Mail; | 10 | use App\Models\Mail\Mail; |
| 11 | use App\Models\Project\DeployBuild; | 11 | use App\Models\Project\DeployBuild; |
| 12 | use App\Models\Project\DeployOptimize; | 12 | use App\Models\Project\DeployOptimize; |
| 13 | +use App\Models\Project\ProjectKeyword; | ||
| 13 | use App\Models\Project\ProjectUpdateTdk; | 14 | use App\Models\Project\ProjectUpdateTdk; |
| 14 | use App\Models\User\User; | 15 | use App\Models\User\User; |
| 15 | use App\Models\WebSetting\WebLanguage; | 16 | use App\Models\WebSetting\WebLanguage; |
| @@ -375,7 +376,13 @@ class UpdateSeoTdk extends Command | @@ -375,7 +376,13 @@ class UpdateSeoTdk extends Command | ||
| 375 | $info = Cache::get($cache_key); | 376 | $info = Cache::get($cache_key); |
| 376 | if(!$info){ | 377 | if(!$info){ |
| 377 | $projectOptimizeModel = new DeployOptimize(); | 378 | $projectOptimizeModel = new DeployOptimize(); |
| 378 | - $info = $projectOptimizeModel->read(['project_id' => $project_id], ['id', 'company_en_name', 'company_en_description', 'main_keywords']); | 379 | + $info = $projectOptimizeModel->read(['project_id' => $project_id], ['id', 'company_en_name', 'company_en_description']); |
| 380 | + $projectKeywordModel = new ProjectKeyword(); | ||
| 381 | + $keywordInfo = $projectKeywordModel->read(['project_id'=>$project_id]); | ||
| 382 | + $info['main_keyword'] = ''; | ||
| 383 | + if($keywordInfo === false){ | ||
| 384 | + $info['main_keyword'] = $keywordInfo['main_keyword']; | ||
| 385 | + } | ||
| 379 | Cache::put($cache_key, $info, 600); | 386 | Cache::put($cache_key, $info, 600); |
| 380 | } | 387 | } |
| 381 | return $info; | 388 | return $info; |
| @@ -412,12 +419,12 @@ class UpdateSeoTdk extends Command | @@ -412,12 +419,12 @@ class UpdateSeoTdk extends Command | ||
| 412 | { | 419 | { |
| 413 | $str = ''; | 420 | $str = ''; |
| 414 | $info = $this->getDeployOptimize($project_id); | 421 | $info = $this->getDeployOptimize($project_id); |
| 415 | - if (!empty($info['main_keywords'])) { | ||
| 416 | - $main_keywords = explode("\r\n", $info['main_keywords']); | 422 | + if (!empty($info['main_keyword'])) { |
| 423 | + $main_keyword = explode("\r\n", $info['main_keyword']); | ||
| 417 | //随机取 | 424 | //随机取 |
| 418 | - shuffle($main_keywords); | ||
| 419 | - $main_keywords = array_slice($main_keywords, 0, $num); | ||
| 420 | - $str = implode(", ", $main_keywords); | 425 | + shuffle($main_keyword); |
| 426 | + $main_keyword = array_slice($main_keyword, 0, $num); | ||
| 427 | + $str = implode(", ", $main_keyword); | ||
| 421 | } | 428 | } |
| 422 | return $str; | 429 | return $str; |
| 423 | } | 430 | } |
| @@ -10,6 +10,7 @@ use App\Models\Domain\DomainInfo; | @@ -10,6 +10,7 @@ use App\Models\Domain\DomainInfo; | ||
| 10 | use App\Models\Mail\Mail; | 10 | use App\Models\Mail\Mail; |
| 11 | use App\Models\Project\DeployBuild; | 11 | use App\Models\Project\DeployBuild; |
| 12 | use App\Models\Project\DeployOptimize; | 12 | use App\Models\Project\DeployOptimize; |
| 13 | +use App\Models\Project\ProjectKeyword; | ||
| 13 | use App\Models\Project\ProjectUpdateTdk; | 14 | use App\Models\Project\ProjectUpdateTdk; |
| 14 | use App\Models\User\User; | 15 | use App\Models\User\User; |
| 15 | use App\Models\WebSetting\WebLanguage; | 16 | use App\Models\WebSetting\WebLanguage; |
| @@ -373,7 +374,13 @@ class UpdateSeoTdkByTaskId extends Command | @@ -373,7 +374,13 @@ class UpdateSeoTdkByTaskId extends Command | ||
| 373 | $info = Cache::get($cache_key); | 374 | $info = Cache::get($cache_key); |
| 374 | if(!$info){ | 375 | if(!$info){ |
| 375 | $projectOptimizeModel = new DeployOptimize(); | 376 | $projectOptimizeModel = new DeployOptimize(); |
| 376 | - $info = $projectOptimizeModel->read(['project_id' => $project_id], ['id', 'company_en_name', 'company_en_description', 'main_keywords']); | 377 | + $info = $projectOptimizeModel->read(['project_id' => $project_id], ['id', 'company_en_name', 'company_en_description']); |
| 378 | + $projectKeywordModel = new ProjectKeyword(); | ||
| 379 | + $keywordInfo = $projectKeywordModel->read(['project_id'=>$project_id]); | ||
| 380 | + $info['main_keyword'] = ''; | ||
| 381 | + if($keywordInfo === false){ | ||
| 382 | + $info['main_keyword'] = $keywordInfo['main_keyword']; | ||
| 383 | + } | ||
| 377 | Cache::put($cache_key, $info, 600); | 384 | Cache::put($cache_key, $info, 600); |
| 378 | } | 385 | } |
| 379 | return $info; | 386 | return $info; |
| @@ -410,12 +417,12 @@ class UpdateSeoTdkByTaskId extends Command | @@ -410,12 +417,12 @@ class UpdateSeoTdkByTaskId extends Command | ||
| 410 | { | 417 | { |
| 411 | $str = ''; | 418 | $str = ''; |
| 412 | $info = $this->getDeployOptimize($project_id); | 419 | $info = $this->getDeployOptimize($project_id); |
| 413 | - if (!empty($info['main_keywords'])) { | ||
| 414 | - $main_keywords = explode("\r\n", $info['main_keywords']); | 420 | + if (!empty($info['main_keyword'])) { |
| 421 | + $main_keyword = explode("\r\n", $info['main_keyword']); | ||
| 415 | //随机取 | 422 | //随机取 |
| 416 | - shuffle($main_keywords); | ||
| 417 | - $main_keywords = array_slice($main_keywords, 0, $num); | ||
| 418 | - $str = implode(", ", $main_keywords); | 423 | + shuffle($main_keyword); |
| 424 | + $main_keyword = array_slice($main_keyword, 0, $num); | ||
| 425 | + $str = implode(", ", $main_keyword); | ||
| 419 | } | 426 | } |
| 420 | return $str; | 427 | return $str; |
| 421 | } | 428 | } |
| @@ -48,113 +48,14 @@ class Demo extends Command | @@ -48,113 +48,14 @@ class Demo extends Command | ||
| 48 | protected $description = 'demo'; | 48 | protected $description = 'demo'; |
| 49 | 49 | ||
| 50 | public function handle(){ | 50 | public function handle(){ |
| 51 | - $p = new PurchaserInfo(); | ||
| 52 | - $lists = $p->list(); | ||
| 53 | - foreach ($lists as $k => $v){ | ||
| 54 | - $info = $p->read(['project_id'=>$v['project_id'],'keyword'=>$v['keyword'],'buyer'=>$v['buyer']]); | ||
| 55 | - if($info === false){ | ||
| 56 | - continue; | ||
| 57 | - } | ||
| 58 | - $p->del(['project_id'=>$v['project_id'],'keyword'=>$v['keyword'],'buyer'=>$v['buyer'],'id'=>['!=',$v['id']]]); | ||
| 59 | - } | ||
| 60 | - return true; | 51 | + $this->synchronizationFile('/upload/m/file/2024-07/tongli-haiyuan-keywords.pdf'); |
| 61 | } | 52 | } |
| 62 | 53 | ||
| 63 | -// public function handle(){ | ||
| 64 | -// $keywordVideoModel = new KeywordVideoTask(); | ||
| 65 | -// $project_id_arr = $keywordVideoModel::where('id','>',0)->pluck('project_id')->toArray(); | ||
| 66 | -// //查看是否有子记录 | ||
| 67 | -// foreach ($project_id_arr as $values){ | ||
| 68 | -// $logModel = new KeywordVideoTaskLog(); | ||
| 69 | -// $logInfo = $logModel->read(['project_id'=>$values]); | ||
| 70 | -// if($logInfo === false){ | ||
| 71 | -// echo date('Y-m-d H:i:s') . '开启的项目project_id:'.$values . PHP_EOL; | ||
| 72 | -// $keywordVideoModel->edit(['status'=>0],['project_id'=>$values]); | ||
| 73 | -// } | ||
| 74 | -// } | ||
| 75 | -// $projectModel = new Project(); | ||
| 76 | -// $list = $projectModel->list(['type'=>['!=',0],'delete_status'=>0,'id'=>['in',$project_id_arr]]); | ||
| 77 | -// $data = []; | ||
| 78 | -// foreach ($list as $v){ | ||
| 79 | -// echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; | ||
| 80 | -// ProjectServer::useProject($v['id']); | ||
| 81 | -// $this->getProductList(); | ||
| 82 | -// DB::disconnect('custom_mysql'); | ||
| 83 | -// } | ||
| 84 | -// echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | ||
| 85 | -// } | ||
| 86 | - | ||
| 87 | -// public function getProductList(){ | ||
| 88 | -// $productModel = new Product(); | ||
| 89 | -// $product_all_id = $productModel::whereRaw('LENGTH(keyword_id) > 50')->pluck('id')->toArray(); | ||
| 90 | -// if(empty($product_all_id)){ | ||
| 91 | -// return true; | ||
| 92 | -// } | ||
| 93 | -// $lists = $productModel->whereIn("id", $product_all_id)->orderByRaw(DB::raw("FIELD(id, " . implode(',', $product_all_id) . ")"))->get()->toArray(); | ||
| 94 | -// foreach ($lists as $k => $v){ | ||
| 95 | -// echo date('Y-m-d H:i:s') . '项目id:'.$v['project_id'].'+产品product_id:'.$v['id'] . PHP_EOL; | ||
| 96 | -// $str = ','; | ||
| 97 | -// shuffle($v['keyword_id']); | ||
| 98 | -// foreach ($v['keyword_id'] as $key => $value){ | ||
| 99 | -// if($key == 6){ | ||
| 100 | -// break; | ||
| 101 | -// } | ||
| 102 | -// $str .= $value.','; | ||
| 103 | -// } | ||
| 104 | -// $productModel->edit(['keyword_id'=>$str],['id'=>$v['id']]); | ||
| 105 | -// } | ||
| 106 | -// return true; | ||
| 107 | -// } | ||
| 108 | -// | ||
| 109 | -// /** | ||
| 110 | -// * @remark :关键字有视频的改为1 | ||
| 111 | -// * @name :getProductKeywordInfo | ||
| 112 | -// * @author :lyh | ||
| 113 | -// * @method :post | ||
| 114 | -// * @time :2024/5/31 9:54 | ||
| 115 | -// */ | ||
| 116 | -// public function saveKeyword(){ | ||
| 117 | -// $keywordModel = new Keyword(); | ||
| 118 | -// $rs = $keywordModel->edit(['is_video_keyword'=>0],['video'=>'']); | ||
| 119 | -// echo date('Y-m-d H:i:s') . 'end'.$rs . PHP_EOL; | ||
| 120 | -// return true; | ||
| 121 | -// } | ||
| 122 | - | ||
| 123 | -// public function handle(){ | ||
| 124 | -// //切换数据库配置 | ||
| 125 | -// ProjectServer::useProject(1862); | ||
| 126 | -// return $this->initTable(1380,1862); | ||
| 127 | -// } | ||
| 128 | -// | ||
| 129 | -// public function initTable($project_id, $news_project_id) | ||
| 130 | -// { | ||
| 131 | -// config(['database.connections.custom_tmp_mysql_copy.database' => 'gl_data_' . $project_id]); | ||
| 132 | -// $database_name = DB::connection('custom_tmp_mysql_copy')->getDatabaseName(); | ||
| 133 | -// $tables = Schema::connection('custom_tmp_mysql_copy')->getAllTables(); | ||
| 134 | -// $tables = array_column($tables, 'Tables_in_' . $database_name); | ||
| 135 | -// foreach ($tables as $table) { | ||
| 136 | -// $has_table = Schema::connection('custom_mysql')->hasTable($table); | ||
| 137 | -// if (!$has_table) { | ||
| 138 | -// $sql = DB::connection('custom_tmp_mysql_copy')->select("SHOW CREATE TABLE {$table}"); | ||
| 139 | -// DB::connection('custom_mysql')->statement(array_values((array)$sql[0])[0]); // 修正此处的sql语句获取方式 | ||
| 140 | -// } | ||
| 141 | -// | ||
| 142 | -// if ($table == 'gl_customer_visit' || $table == 'gl_customer_visit_item' || $table == 'gl_inquiry_other' || $table == 'gl_inquiry_form_data' || $table == 'gl_inquiry_form') { | ||
| 143 | -// continue; | ||
| 144 | -// } | ||
| 145 | -// DB::connection('custom_mysql')->table($table)->truncate(); // 清空目标表数据 | ||
| 146 | -// DB::connection('custom_mysql')->table($table)->insertUsing( | ||
| 147 | -// [], // 列名数组,留空表示插入所有列 | ||
| 148 | -// function ($query) use ($table, $project_id) { | ||
| 149 | -// $name = 'gl_data_' . $project_id . '.' . $table; | ||
| 150 | -// $query->select('*')->from("{$name}"); | ||
| 151 | -// } | ||
| 152 | -// ); | ||
| 153 | -// | ||
| 154 | -// if (Schema::connection('custom_mysql')->hasColumn($table, 'project_id')) { | ||
| 155 | -// DB::connection('custom_mysql')->table($table)->update(['project_id' => $news_project_id]); | ||
| 156 | -// } | ||
| 157 | -// } | ||
| 158 | -// return true; | ||
| 159 | -// } | 54 | + public function synchronizationFile($path_name){ |
| 55 | + //同步到大文件 | ||
| 56 | + $file_path = config('filesystems.disks.cos')['cdn1'].$path_name; | ||
| 57 | + $directoryPath = pathinfo($path_name, PATHINFO_DIRNAME); | ||
| 58 | + $cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$directoryPath.'" https://v6-file.globalso.com/upload.php'; | ||
| 59 | + return shell_exec($cmd); | ||
| 60 | + } | ||
| 160 | } | 61 | } |
| @@ -47,7 +47,7 @@ class HtmlCollect extends Command | @@ -47,7 +47,7 @@ class HtmlCollect extends Command | ||
| 47 | 47 | ||
| 48 | public function handle() | 48 | public function handle() |
| 49 | { | 49 | { |
| 50 | - ini_set('memory_limit', '512M'); | 50 | + ini_set('memory_limit', '1024M'); |
| 51 | while (true) { | 51 | while (true) { |
| 52 | $this->start_collect(); | 52 | $this->start_collect(); |
| 53 | } | 53 | } |
| @@ -442,7 +442,12 @@ class HtmlCollect extends Command | @@ -442,7 +442,12 @@ class HtmlCollect extends Command | ||
| 442 | foreach ($source as $vs) { | 442 | foreach ($source as $vs) { |
| 443 | 443 | ||
| 444 | if ($vs['download']) { | 444 | if ($vs['download']) { |
| 445 | - $new_source = CosService::uploadRemote($project_id, 'source', $vs['url_complete']); | 445 | + if ($project_id == 1355 && in_array(substr($vs['url_complete'], -3), ['pdf', 'zip', 'rar', '.gz'])) { |
| 446 | + //项目id为1355的项目,可下载类资源要保持原名称,做特殊处理 | ||
| 447 | + $new_source = CosService::uploadRemote($project_id, 'source', $vs['url_complete'], '', '', 1); | ||
| 448 | + } else { | ||
| 449 | + $new_source = CosService::uploadRemote($project_id, 'source', $vs['url_complete']); | ||
| 450 | + } | ||
| 446 | if ($new_source) { | 451 | if ($new_source) { |
| 447 | CollectSource::insert([ | 452 | CollectSource::insert([ |
| 448 | 'project_id' => $project_id, | 453 | 'project_id' => $project_id, |
| @@ -308,6 +308,13 @@ class ProjectUpdate extends Command | @@ -308,6 +308,13 @@ class ProjectUpdate extends Command | ||
| 308 | $keyword_id = ',' . implode(',', array_column($keyword_arr, 'id')) . ','; | 308 | $keyword_id = ',' . implode(',', array_column($keyword_arr, 'id')) . ','; |
| 309 | } | 309 | } |
| 310 | } | 310 | } |
| 311 | + //产品参数 | ||
| 312 | + $attrs = []; | ||
| 313 | + if ($item['attr'] ?? []) { | ||
| 314 | + foreach ($item['attr'] as $k_attr => $attr) { | ||
| 315 | + $attrs[] = ['key' => $k_attr, 'value' => $attr]; | ||
| 316 | + } | ||
| 317 | + } | ||
| 311 | //名称去掉特殊符号 | 318 | //名称去掉特殊符号 |
| 312 | $item['ttile'] = $this->special2str($item['ttile'] ?? ''); | 319 | $item['ttile'] = $this->special2str($item['ttile'] ?? ''); |
| 313 | 320 | ||
| @@ -323,6 +330,7 @@ class ProjectUpdate extends Command | @@ -323,6 +330,7 @@ class ProjectUpdate extends Command | ||
| 323 | 'keyword_id' => $keyword_id, | 330 | 'keyword_id' => $keyword_id, |
| 324 | 'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '', | 331 | 'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '', |
| 325 | 'gallery' => Arr::a2s($gallery), | 332 | 'gallery' => Arr::a2s($gallery), |
| 333 | + 'attrs' => Arr::a2s($attrs), | ||
| 326 | 'seo_mate' => Arr::a2s([ | 334 | 'seo_mate' => Arr::a2s([ |
| 327 | 'title' => $item['ttile'], | 335 | 'title' => $item['ttile'], |
| 328 | 'keyword' => $item['keywords'] ?? '', | 336 | 'keyword' => $item['keywords'] ?? '', |
| @@ -353,6 +361,7 @@ class ProjectUpdate extends Command | @@ -353,6 +361,7 @@ class ProjectUpdate extends Command | ||
| 353 | 'keyword_id' => $keyword_id, | 361 | 'keyword_id' => $keyword_id, |
| 354 | 'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '', | 362 | 'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '', |
| 355 | 'gallery' => Arr::a2s($gallery), | 363 | 'gallery' => Arr::a2s($gallery), |
| 364 | + 'attrs' => Arr::a2s($attrs), | ||
| 356 | 'seo_mate' => Arr::a2s([ | 365 | 'seo_mate' => Arr::a2s([ |
| 357 | 'title' => $item['ttile'], | 366 | 'title' => $item['ttile'], |
| 358 | 'keyword' => $item['keywords'] ?? '', | 367 | 'keyword' => $item['keywords'] ?? '', |
| @@ -361,15 +370,20 @@ class ProjectUpdate extends Command | @@ -361,15 +370,20 @@ class ProjectUpdate extends Command | ||
| 361 | 'send_time' => $item['post_date'] ?? date('Y-m-d H:i:s'), | 370 | 'send_time' => $item['post_date'] ?? date('Y-m-d H:i:s'), |
| 362 | 'sort' => $item['sort'] ?? 0, | 371 | 'sort' => $item['sort'] ?? 0, |
| 363 | ], ['id' => $id]); | 372 | ], ['id' => $id]); |
| 373 | + } else { | ||
| 374 | + //按6.0展示只更新分类 | ||
| 375 | + $model->edit([ | ||
| 376 | + 'category_id' => $category_id | ||
| 377 | + ], ['id' => $id]); | ||
| 364 | } | 378 | } |
| 365 | } | 379 | } |
| 366 | 380 | ||
| 367 | - if ($six_read) { | ||
| 368 | - //关联分类 | ||
| 369 | - if ($category_arr) { | ||
| 370 | - CategoryRelated::saveRelated($id, array_column($category_arr, 'id')); | ||
| 371 | - } | 381 | + //关联分类 |
| 382 | + if ($category_arr) { | ||
| 383 | + CategoryRelated::saveRelated($id, array_column($category_arr, 'id')); | ||
| 384 | + } | ||
| 372 | 385 | ||
| 386 | + if ($six_read) { | ||
| 373 | //扩展字段 | 387 | //扩展字段 |
| 374 | if ($item['extend'] ?? []) { | 388 | if ($item['extend'] ?? []) { |
| 375 | foreach (array_reverse($item['extend']) as $ke => $ve) { | 389 | foreach (array_reverse($item['extend']) as $ke => $ve) { |
| @@ -651,15 +665,15 @@ class ProjectUpdate extends Command | @@ -651,15 +665,15 @@ class ProjectUpdate extends Command | ||
| 651 | $item['title'] = $this->special2str($item['title'] ?? ''); | 665 | $item['title'] = $this->special2str($item['title'] ?? ''); |
| 652 | //排序 | 666 | //排序 |
| 653 | $sort = 0; | 667 | $sort = 0; |
| 654 | - if(isset($item['listorder'])){ | 668 | + if (isset($item['listorder'])) { |
| 655 | $sort = $item['listorder']; | 669 | $sort = $item['listorder']; |
| 656 | } | 670 | } |
| 657 | - if(isset($item['sort'])){ | 671 | + if (isset($item['sort'])) { |
| 658 | $sort = $item['sort']; | 672 | $sort = $item['sort']; |
| 659 | } | 673 | } |
| 660 | 674 | ||
| 661 | try { | 675 | try { |
| 662 | - $custom_content = $model->read(['route' => $route], ['id','six_read']); | 676 | + $custom_content = $model->read(['route' => $route], ['id', 'six_read']); |
| 663 | if (!$custom_content) { | 677 | if (!$custom_content) { |
| 664 | $id = $model->insertGetId([ | 678 | $id = $model->insertGetId([ |
| 665 | 'project_id' => $project_id, | 679 | 'project_id' => $project_id, |
| @@ -683,7 +697,7 @@ class ProjectUpdate extends Command | @@ -683,7 +697,7 @@ class ProjectUpdate extends Command | ||
| 683 | } else { | 697 | } else { |
| 684 | $id = $custom_content['id']; | 698 | $id = $custom_content['id']; |
| 685 | $six_read = $custom_content['six_read']; | 699 | $six_read = $custom_content['six_read']; |
| 686 | - if($six_read){ | 700 | + if ($six_read) { |
| 687 | $model->edit([ | 701 | $model->edit([ |
| 688 | 'name' => $item['title'], | 702 | 'name' => $item['title'], |
| 689 | 'category_id' => $category_id, | 703 | 'category_id' => $category_id, |
| @@ -696,7 +710,7 @@ class ProjectUpdate extends Command | @@ -696,7 +710,7 @@ class ProjectUpdate extends Command | ||
| 696 | } | 710 | } |
| 697 | 711 | ||
| 698 | //扩展字段 | 712 | //扩展字段 |
| 699 | - if($six_read){ | 713 | + if ($six_read) { |
| 700 | if ($item['extend'] ?? []) { | 714 | if ($item['extend'] ?? []) { |
| 701 | foreach ($item['extend'] as $ke => $ve) { | 715 | foreach ($item['extend'] as $ke => $ve) { |
| 702 | $extend = $extend_model->read(['title' => $ke]); | 716 | $extend = $extend_model->read(['title' => $ke]); |
| @@ -19,7 +19,7 @@ class Kernel extends ConsoleKernel | @@ -19,7 +19,7 @@ class Kernel extends ConsoleKernel | ||
| 19 | $schedule->command('template_label')->dailyAt('01:00')->withoutOverlapping(1);//最新模块 | 19 | $schedule->command('template_label')->dailyAt('01:00')->withoutOverlapping(1);//最新模块 |
| 20 | $schedule->command('popular_template_label')->dailyAt('01:30')->withoutOverlapping(1);//热门模块 | 20 | $schedule->command('popular_template_label')->dailyAt('01:30')->withoutOverlapping(1);//热门模块 |
| 21 | // $schedule->command('inspire')->hourly(); | 21 | // $schedule->command('inspire')->hourly(); |
| 22 | - $schedule->command('remain_day')->dailyAt('09:00')->withoutOverlapping(1); // 项目剩余服务时长 | 22 | + $schedule->command('remain_day')->dailyAt('06:00')->withoutOverlapping(1); // 项目剩余服务时长 |
| 23 | $schedule->command('rank_data_task')->everyMinute()->withoutOverlapping(1); // 排名数据更新任务 | 23 | $schedule->command('rank_data_task')->everyMinute()->withoutOverlapping(1); // 排名数据更新任务 |
| 24 | $schedule->command('service_count')->dailyAt('01:00')->withoutOverlapping(1); //服务器使用情况,每天凌晨1点执行一次 | 24 | $schedule->command('service_count')->dailyAt('01:00')->withoutOverlapping(1); //服务器使用情况,每天凌晨1点执行一次 |
| 25 | $schedule->command('web_traffic_special')->everyMinute()->withoutOverlapping(1); // 特殊引流 | 25 | $schedule->command('web_traffic_special')->everyMinute()->withoutOverlapping(1); // 特殊引流 |
| @@ -29,12 +29,15 @@ class Kernel extends ConsoleKernel | @@ -29,12 +29,15 @@ class Kernel extends ConsoleKernel | ||
| 29 | $schedule->command('inquiry_delay')->everyMinute()->withoutOverlapping(1);//TODO::上线放开,转发询盘,每分钟执行一次 | 29 | $schedule->command('inquiry_delay')->everyMinute()->withoutOverlapping(1);//TODO::上线放开,转发询盘,每分钟执行一次 |
| 30 | $schedule->command('inquiry_count')->dailyAt('01:00')->withoutOverlapping(1); // 询盘统计数据,每天凌晨执行一次 | 30 | $schedule->command('inquiry_count')->dailyAt('01:00')->withoutOverlapping(1); // 询盘统计数据,每天凌晨执行一次 |
| 31 | // $schedule->command('domain_info')->dailyAt('01:20')->withoutOverlapping(1);// 更新域名|证书结束时间,每天凌晨1点执行一次 | 31 | // $schedule->command('domain_info')->dailyAt('01:20')->withoutOverlapping(1);// 更新域名|证书结束时间,每天凌晨1点执行一次 |
| 32 | + $schedule->command('share_user')->dailyAt('01:20')->withoutOverlapping(1);// 每天凌晨1点执行一次 | ||
| 32 | $schedule->command('last_inquiry')->dailyAt('04:00')->withoutOverlapping(1);// 最近一次询盘信息 | 33 | $schedule->command('last_inquiry')->dailyAt('04:00')->withoutOverlapping(1);// 最近一次询盘信息 |
| 33 | $schedule->command('update_seo_tdk_crontab')->dailyAt('20:00')->withoutOverlapping(1); //更新上线项目TDK | 34 | $schedule->command('update_seo_tdk_crontab')->dailyAt('20:00')->withoutOverlapping(1); //更新上线项目TDK |
| 34 | $schedule->command('sync_manager')->dailyAt('01:00')->withoutOverlapping(1); //TODO::手机号码同步 每天执行一次 | 35 | $schedule->command('sync_manager')->dailyAt('01:00')->withoutOverlapping(1); //TODO::手机号码同步 每天执行一次 |
| 35 | $schedule->command('update_keyword_route')->dailyAt('01:00')->withoutOverlapping(1); //升级项目--清除路由相同的关键字 | 36 | $schedule->command('update_keyword_route')->dailyAt('01:00')->withoutOverlapping(1); //升级项目--清除路由相同的关键字 |
| 36 | $schedule->command('recommended_suppliers')->dailyAt('03:00')->withoutOverlapping(1); //每天凌晨1点执行一次生成推荐商 | 37 | $schedule->command('recommended_suppliers')->dailyAt('03:00')->withoutOverlapping(1); //每天凌晨1点执行一次生成推荐商 |
| 37 | $schedule->command('update_keyword_content')->hourly()->withoutOverlapping(1); | 38 | $schedule->command('update_keyword_content')->hourly()->withoutOverlapping(1); |
| 39 | + // 每月15号执行任务 | ||
| 40 | + $schedule->command('delete_template_log')->monthlyOn(15, '00:01')->withoutOverlapping(); | ||
| 38 | // 每日推送已完成视频任务项目生成对应界面 | 41 | // 每日推送已完成视频任务项目生成对应界面 |
| 39 | $schedule->command('notice_c')->dailyAt('04:00')->withoutOverlapping(1); | 42 | $schedule->command('notice_c')->dailyAt('04:00')->withoutOverlapping(1); |
| 40 | } | 43 | } |
| @@ -116,29 +116,22 @@ zFePUMXy1bFghAfzNKlrc5XgH4ixeeMh3cDtU97K | @@ -116,29 +116,22 @@ zFePUMXy1bFghAfzNKlrc5XgH4ixeeMh3cDtU97K | ||
| 116 | //平台参数处理 | 116 | //平台参数处理 |
| 117 | $param['idempotencyKey'] = uniqid().time(); | 117 | $param['idempotencyKey'] = uniqid().time(); |
| 118 | $url = $this->path.'/api/post'; | 118 | $url = $this->path.'/api/post'; |
| 119 | - return $this->http_post_ayr($url,$param,$api_key); | ||
| 120 | - } | ||
| 121 | - public function http_post_ayr($url,$param,$api_key){ | ||
| 122 | $curl = curl_init(); | 119 | $curl = curl_init(); |
| 123 | - curl_setopt_array($curl, array( | 120 | + curl_setopt_array($curl, [ |
| 124 | CURLOPT_URL => $url, | 121 | CURLOPT_URL => $url, |
| 125 | CURLOPT_RETURNTRANSFER => true, | 122 | CURLOPT_RETURNTRANSFER => true, |
| 126 | - CURLOPT_ENCODING => '', | ||
| 127 | - CURLOPT_MAXREDIRS => 10, | ||
| 128 | - CURLOPT_TIMEOUT => 0, | ||
| 129 | - CURLOPT_FOLLOWLOCATION => true, | ||
| 130 | - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, | ||
| 131 | - CURLOPT_CUSTOMREQUEST => 'POST', | ||
| 132 | - CURLOPT_POSTFIELDS => http_build_query($param), | ||
| 133 | - CURLOPT_HTTPHEADER => array( | 123 | + CURLOPT_POST => true, |
| 124 | + CURLOPT_POSTFIELDS => json_encode($param), | ||
| 125 | + CURLOPT_HTTPHEADER => [ | ||
| 134 | 'Authorization: Bearer '.$api_key, | 126 | 'Authorization: Bearer '.$api_key, |
| 135 | - 'Accept-Encoding: gzip' | ||
| 136 | - ), | ||
| 137 | - )); | 127 | + 'Content-Type: application/json' |
| 128 | + ], | ||
| 129 | + ]); | ||
| 138 | $response = curl_exec($curl); | 130 | $response = curl_exec($curl); |
| 139 | curl_close($curl); | 131 | curl_close($curl); |
| 140 | return $response; | 132 | return $response; |
| 141 | } | 133 | } |
| 134 | + | ||
| 142 | /** | 135 | /** |
| 143 | * @name :(上传图片或视频到ayr_share)post_media_upload | 136 | * @name :(上传图片或视频到ayr_share)post_media_upload |
| 144 | * @author :lyh | 137 | * @author :lyh |
| @@ -26,7 +26,8 @@ class Common | @@ -26,7 +26,8 @@ class Common | ||
| 26 | $data = [ | 26 | $data = [ |
| 27 | 'operator_id'=>$param['operator_id'], | 27 | 'operator_id'=>$param['operator_id'], |
| 28 | 'model'=>$param['model'], | 28 | 'model'=>$param['model'], |
| 29 | - 'remark'=>$param['remark'] | 29 | + 'remark'=>$param['remark'], |
| 30 | + 'project_id'=>$param['project_id'] | ||
| 30 | ]; | 31 | ]; |
| 31 | $model = new UserLogModel(); | 32 | $model = new UserLogModel(); |
| 32 | return $model->add($data); | 33 | return $model->add($data); |
| @@ -644,11 +644,11 @@ if (!function_exists('getFileUrl')) { | @@ -644,11 +644,11 @@ if (!function_exists('getFileUrl')) { | ||
| 644 | * @method :post | 644 | * @method :post |
| 645 | * @time :2023/7/20 16:46 | 645 | * @time :2023/7/20 16:46 |
| 646 | */ | 646 | */ |
| 647 | - function getFileUrl($path,$storage_type = 0,$location = 0){ | 647 | + function getFileUrl($path,$storage_type = 0,$location = 0,$file_cdn = 0){ |
| 648 | if(is_array($path)){ | 648 | if(is_array($path)){ |
| 649 | $url =[]; | 649 | $url =[]; |
| 650 | foreach ($path as $v){ | 650 | foreach ($path as $v){ |
| 651 | - $url[] = getFileUrl($v,$storage_type,$location); | 651 | + $url[] = getFileUrl($v,$storage_type,$location,$file_cdn); |
| 652 | } | 652 | } |
| 653 | }else{ | 653 | }else{ |
| 654 | if(empty($path)){ | 654 | if(empty($path)){ |
| @@ -662,7 +662,7 @@ if (!function_exists('getFileUrl')) { | @@ -662,7 +662,7 @@ if (!function_exists('getFileUrl')) { | ||
| 662 | } | 662 | } |
| 663 | $file_type = pathinfo($path, PATHINFO_EXTENSION); | 663 | $file_type = pathinfo($path, PATHINFO_EXTENSION); |
| 664 | $fileTypeArr = ['zip', 'pdf', 'mp4', 'doc', 'docx', 'm4v', 'xlsx']; | 664 | $fileTypeArr = ['zip', 'pdf', 'mp4', 'doc', 'docx', 'm4v', 'xlsx']; |
| 665 | - if(in_array(strtolower($file_type),$fileTypeArr)){ | 665 | + if(in_array(strtolower($file_type),$fileTypeArr) && ($file_cdn == 0)){ |
| 666 | $cdn2 = config('filesystems.disks.cos')['cdn2']; | 666 | $cdn2 = config('filesystems.disks.cos')['cdn2']; |
| 667 | return $cdn2.$path; | 667 | return $cdn2.$path; |
| 668 | } | 668 | } |
| @@ -145,7 +145,7 @@ class IndexController extends BaseController | @@ -145,7 +145,7 @@ class IndexController extends BaseController | ||
| 145 | $token = md5(uniqid().'auto'.$info['id']); | 145 | $token = md5(uniqid().'auto'.$info['id']); |
| 146 | //存储缓存 | 146 | //存储缓存 |
| 147 | $info['token'] = $token; | 147 | $info['token'] = $token; |
| 148 | - Cache::add($token,$info,3600); | 148 | + Cache::add($token,$info,12 * 3600); |
| 149 | $languageModel = new WebLanguage(); | 149 | $languageModel = new WebLanguage(); |
| 150 | $languageInfo = $languageModel->read(['id'=>$info['main_lang_id']],['short','english','chinese']); | 150 | $languageInfo = $languageModel->read(['id'=>$info['main_lang_id']],['short','english','chinese']); |
| 151 | $data = ['token'=>$token,'main_lang_id'=>$info['main_lang_id'],'language_info'=>$languageInfo]; | 151 | $data = ['token'=>$token,'main_lang_id'=>$info['main_lang_id'],'language_info'=>$languageInfo]; |
| @@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
| 3 | namespace App\Http\Controllers\Aside\Manage; | 3 | namespace App\Http\Controllers\Aside\Manage; |
| 4 | use App\Enums\Common\Code; | 4 | use App\Enums\Common\Code; |
| 5 | use App\Http\Controllers\Aside\BaseController; | 5 | use App\Http\Controllers\Aside\BaseController; |
| 6 | +use App\Http\Requests\Aside\Manage\ManagerHrRequest; | ||
| 6 | use App\Models\Manage\ManageHr; | 7 | use App\Models\Manage\ManageHr; |
| 7 | use App\Models\Manage\Menu; | 8 | use App\Models\Manage\Menu; |
| 8 | use Illuminate\Http\Request; | 9 | use Illuminate\Http\Request; |
| @@ -53,7 +54,8 @@ class HrController extends BaseController | @@ -53,7 +54,8 @@ class HrController extends BaseController | ||
| 53 | * @method :post | 54 | * @method :post |
| 54 | * @time :2023/9/6 10:05 | 55 | * @time :2023/9/6 10:05 |
| 55 | */ | 56 | */ |
| 56 | - public function save(HrLogic $logic){ | 57 | + public function save(ManagerHrRequest $request,HrLogic $logic){ |
| 58 | + $request->validated(); | ||
| 57 | $logic->hrSave(); | 59 | $logic->hrSave(); |
| 58 | $this->response('success'); | 60 | $this->response('success'); |
| 59 | } | 61 | } |
| @@ -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\Models\Project\DeployOptimize; | 14 | use App\Models\Project\DeployOptimize; |
| 15 | use App\Models\Project\Project; | 15 | use App\Models\Project\Project; |
| 16 | +use App\Models\Project\ProjectKeyword; | ||
| 16 | 17 | ||
| 17 | class KeywordsController extends BaseController | 18 | class KeywordsController extends BaseController |
| 18 | { | 19 | { |
| @@ -24,9 +25,9 @@ class KeywordsController extends BaseController | @@ -24,9 +25,9 @@ class KeywordsController extends BaseController | ||
| 24 | * @time :2023/9/4 10:13 | 25 | * @time :2023/9/4 10:13 |
| 25 | */ | 26 | */ |
| 26 | public function lists(){ | 27 | public function lists(){ |
| 27 | - $projectDeployOptimizeModel = new DeployOptimize(); | ||
| 28 | - $ids = $projectDeployOptimizeModel->where('customer_keywords','like','%'.$this->map['search'].'%') | ||
| 29 | - ->orWhere('main_keywords', 'like' , '%'.$this->map['search'].'%')->pluck('project_id')->toArray(); | 28 | + $projectKeywordModel = new ProjectKeyword(); |
| 29 | + $ids = $projectKeywordModel->where('customer_keywords','like','%'.$this->map['search'].'%') | ||
| 30 | + ->orWhere('main_keyword', 'like' , '%'.$this->map['search'].'%')->pluck('project_id')->toArray(); | ||
| 30 | $projectModel = new Project(); | 31 | $projectModel = new Project(); |
| 31 | $lists = $projectModel->formatQuery(['id'=>['in',$ids]])->with('payment')->with('deploy_build') | 32 | $lists = $projectModel->formatQuery(['id'=>['in',$ids]])->with('payment')->with('deploy_build') |
| 32 | ->with('deploy_optimize')->with('domainInfo')->get()->toArray(); | 33 | ->with('deploy_optimize')->with('domainInfo')->get()->toArray(); |
| @@ -12,9 +12,15 @@ use App\Models\Channel\Channel; | @@ -12,9 +12,15 @@ use App\Models\Channel\Channel; | ||
| 12 | use App\Models\Com\KeywordVideoTask; | 12 | use App\Models\Com\KeywordVideoTask; |
| 13 | use App\Models\Domain\DomainInfo; | 13 | use App\Models\Domain\DomainInfo; |
| 14 | use App\Models\Manage\ManageHr; | 14 | use App\Models\Manage\ManageHr; |
| 15 | +use App\Models\Product\Category; | ||
| 16 | +use App\Models\Product\Keyword; | ||
| 17 | +use App\Models\Product\Product; | ||
| 15 | use App\Models\Project\DeployOptimize; | 18 | use App\Models\Project\DeployOptimize; |
| 16 | use App\Models\Project\Project; | 19 | use App\Models\Project\Project; |
| 17 | use App\Models\RankData\RankData; | 20 | use App\Models\RankData\RankData; |
| 21 | +use App\Models\RouteMap\RouteMap; | ||
| 22 | +use App\Services\ProjectServer; | ||
| 23 | +use Illuminate\Support\Facades\DB; | ||
| 18 | 24 | ||
| 19 | /** | 25 | /** |
| 20 | * @remark :优化 | 26 | * @remark :优化 |
| @@ -426,4 +432,58 @@ class OptimizeController extends BaseController | @@ -426,4 +432,58 @@ class OptimizeController extends BaseController | ||
| 426 | $optimizeModel->edit(['ai_video'=>$this->param['status']],['project_id'=>$this->param['project_id']]); | 432 | $optimizeModel->edit(['ai_video'=>$this->param['status']],['project_id'=>$this->param['project_id']]); |
| 427 | $this->response('success'); | 433 | $this->response('success'); |
| 428 | } | 434 | } |
| 435 | + | ||
| 436 | + /** | ||
| 437 | + * @remark :锚文本链接 | ||
| 438 | + * @name :anchorTextList | ||
| 439 | + * @author :lyh | ||
| 440 | + * @method :post | ||
| 441 | + * @time :2024/7/17 14:04 | ||
| 442 | + */ | ||
| 443 | + public function anchorTextList(){ | ||
| 444 | + $this->request->validate([ | ||
| 445 | + 'project_id' => 'required', | ||
| 446 | + ], [ | ||
| 447 | + 'project_id.required' => 'project_id不能为空', | ||
| 448 | + ]); | ||
| 449 | + // 获取当前网站正式域名 | ||
| 450 | + $domainModel = new DomainInfo(); | ||
| 451 | + $domainInfo = $domainModel->read(['project_id' => $this->param['project_id']], ['domain']); | ||
| 452 | + if ($domainInfo === false) { | ||
| 453 | + $this->fail('请先设置域名'); | ||
| 454 | + } | ||
| 455 | + $domain = 'https://' . $domainInfo['domain'] . '/'; | ||
| 456 | + $data = []; | ||
| 457 | + ProjectServer::useProject($this->param['project_id']); | ||
| 458 | + $productModel = new Product(); | ||
| 459 | + $this->processChunkedList($productModel, ['status' => $productModel::STATUS_ON], ['id', 'title', 'route'], $domain, $data, 'product'); | ||
| 460 | + $productCategoryModel = new Category(); | ||
| 461 | + $this->processChunkedList($productCategoryModel, ['status' => $productCategoryModel::STATUS_ACTIVE], ['id', 'title', 'route'], $domain, $data, 'product_category'); | ||
| 462 | + $productKeywordModel = new Keyword(); | ||
| 463 | + $this->processChunkedList($productKeywordModel, ['status' => $productKeywordModel::STATUS_ACTIVE], ['id', 'title', 'route'], $domain, $data, 'product_keyword'); | ||
| 464 | + DB::disconnect('custom_mysql'); | ||
| 465 | + $this->response('success', Code::SUCCESS, $data); | ||
| 466 | + } | ||
| 467 | + | ||
| 468 | + /** | ||
| 469 | + * @remark :分片查询 | ||
| 470 | + * @name :processChunkedList | ||
| 471 | + * @author :lyh | ||
| 472 | + * @method :post | ||
| 473 | + * @time :2024/7/17 14:55 | ||
| 474 | + */ | ||
| 475 | + public function processChunkedList($model, $conditions, $fields, $domain, &$data, $key) { | ||
| 476 | + $offset = 1; | ||
| 477 | + $chunkSize = 5000; // 每次查询的记录数 | ||
| 478 | + while (true) { | ||
| 479 | + $chunk = $model->lists($conditions,$offset,$chunkSize, 'id', $fields); | ||
| 480 | + if (count($chunk['list']) == 0) { | ||
| 481 | + break; | ||
| 482 | + } | ||
| 483 | + foreach ($chunk['list'] as $item) { | ||
| 484 | + $data[$key][] = $domain . $item['route'] . '/{' . $item['title'] . '}'; | ||
| 485 | + } | ||
| 486 | + $offset++; | ||
| 487 | + } | ||
| 488 | + } | ||
| 429 | } | 489 | } |
| @@ -417,9 +417,11 @@ class ProjectController extends BaseController | @@ -417,9 +417,11 @@ class ProjectController extends BaseController | ||
| 417 | public function save(ProjectLogic $logic) | 417 | public function save(ProjectLogic $logic) |
| 418 | { | 418 | { |
| 419 | $this->request->validate([ | 419 | $this->request->validate([ |
| 420 | - 'type'=>'required' | 420 | + 'type'=>'required', |
| 421 | + 'serve_id'=>'required', | ||
| 421 | ],[ | 422 | ],[ |
| 422 | - 'type.required' => '类型不能为空' | 423 | + 'type.required' => '类型不能为空', |
| 424 | + 'serve_id.required' => '请选择服务器' | ||
| 423 | ]); | 425 | ]); |
| 424 | $logic->projectSave(); | 426 | $logic->projectSave(); |
| 425 | $this->response('success'); | 427 | $this->response('success'); |
| @@ -70,7 +70,7 @@ class AutoTaskController extends BaseController | @@ -70,7 +70,7 @@ class AutoTaskController extends BaseController | ||
| 70 | } | 70 | } |
| 71 | } | 71 | } |
| 72 | // 映射信息 以及解析信息 | 72 | // 映射信息 以及解析信息 |
| 73 | - $val['type'] = $type[$val['type']]; | 73 | + $val['type'] = $type[$val['type']] ?? ''; |
| 74 | $val['route'] = $route[$val['route']]; | 74 | $val['route'] = $route[$val['route']]; |
| 75 | $val['status'] = $status[$val['status']]; | 75 | $val['status'] = $status[$val['status']]; |
| 76 | $val['project_title'] = $projects[$val['project_id']] ?? ''; | 76 | $val['project_title'] = $projects[$val['project_id']] ?? ''; |
| @@ -88,7 +88,9 @@ class AyrReleaseController extends BaseController | @@ -88,7 +88,9 @@ class AyrReleaseController extends BaseController | ||
| 88 | } | 88 | } |
| 89 | //发送请求发布社交文章 | 89 | //发送请求发布社交文章 |
| 90 | $res = $ayrShare->post_send_msg($param,$share_info['profile_key']); | 90 | $res = $ayrShare->post_send_msg($param,$share_info['profile_key']); |
| 91 | - $ayrReleaseLogic->release_add($res); | 91 | + if($res){ |
| 92 | + $ayrReleaseLogic->release_add($res); | ||
| 93 | + } | ||
| 92 | //保存返回的内容 | 94 | //保存返回的内容 |
| 93 | $this->response('success',Code::SUCCESS,json_decode($res)); | 95 | $this->response('success',Code::SUCCESS,json_decode($res)); |
| 94 | } | 96 | } |
| @@ -64,18 +64,13 @@ class AyrShareController extends BaseController | @@ -64,18 +64,13 @@ class AyrShareController extends BaseController | ||
| 64 | $str = json_encode($share_info['activeSocialAccounts']); | 64 | $str = json_encode($share_info['activeSocialAccounts']); |
| 65 | if($str != $info['bind_platforms']){ | 65 | if($str != $info['bind_platforms']){ |
| 66 | $ayrShareLogic->ayr_share_edit(['bind_platforms'=>$str],$this->param['id']); | 66 | $ayrShareLogic->ayr_share_edit(['bind_platforms'=>$str],$this->param['id']); |
| 67 | - $res = true; | ||
| 68 | - }else{ | ||
| 69 | - $res = false; | ||
| 70 | } | 67 | } |
| 71 | }else{ | 68 | }else{ |
| 72 | if(!empty($info['bind_platforms'])){ | 69 | if(!empty($info['bind_platforms'])){ |
| 73 | $ayrShareLogic->ayr_share_edit(['bind_platforms'=>''],$this->param['id']); | 70 | $ayrShareLogic->ayr_share_edit(['bind_platforms'=>''],$this->param['id']); |
| 74 | - return true; | ||
| 75 | } | 71 | } |
| 76 | - $res = false; | ||
| 77 | } | 72 | } |
| 78 | - $this->response('success',Code::SUCCESS,['is_true'=>$res]); | 73 | + $this->response('success',Code::SUCCESS,$share_info['activeSocialAccounts'] ?? []); |
| 79 | } | 74 | } |
| 80 | /** | 75 | /** |
| 81 | * @name :(创建ayr_share账户)create_account | 76 | * @name :(创建ayr_share账户)create_account |
| @@ -159,7 +159,7 @@ class BaseController extends Controller | @@ -159,7 +159,7 @@ class BaseController extends Controller | ||
| 159 | $log = config('logging.operator_log'); | 159 | $log = config('logging.operator_log'); |
| 160 | if(isset($log) && $log['log'] == true){ | 160 | if(isset($log) && $log['log'] == true){ |
| 161 | if(empty($log['action']) || (strpos($log['action'],$this->request->route()->getName()) === false)){ | 161 | if(empty($log['action']) || (strpos($log['action'],$this->request->route()->getName()) === false)){ |
| 162 | - Common::set_user_log(['model'=>$this->request->route()->getName(),'remark'=>'请求的参数:param = '.json_encode($this->param),'operator_id'=>$this->uid,'type'=>isset($this->user['manager_id']) ? 1 : 0]); | 162 | + Common::set_user_log(['project_id'=>$this->user['project_id'] ?? 0,'model'=>$this->request->route()->getName(),'remark'=>'请求的参数:param = '.json_encode($this->param),'operator_id'=>$this->uid,'type'=>isset($this->user['manager_id']) ? 1 : 0]); |
| 163 | } | 163 | } |
| 164 | } | 164 | } |
| 165 | return true; | 165 | return true; |
| @@ -85,7 +85,7 @@ class CustomModuleContentController extends BaseController | @@ -85,7 +85,7 @@ class CustomModuleContentController extends BaseController | ||
| 85 | $v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'] ?? 0,$this->user['project_location']); | 85 | $v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'] ?? 0,$this->user['project_location']); |
| 86 | } | 86 | } |
| 87 | if(!empty($v['video'])){ | 87 | if(!empty($v['video'])){ |
| 88 | - $v['video']['url'] = getFileUrl($v['video']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']); | 88 | + $v['video']['url'] = getFileUrl($v['video']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location'],$this->user['file_cdn'] ?? 0); |
| 89 | $v['video']['video_image'] = getImageUrl($v['video']['video_image'],$this->user['storage_type'] ?? 0,$this->user['project_location']); | 89 | $v['video']['video_image'] = getImageUrl($v['video']['video_image'],$this->user['storage_type'] ?? 0,$this->user['project_location']); |
| 90 | } | 90 | } |
| 91 | return $this->success($v); | 91 | return $this->success($v); |
| @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside\Keyword; | @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside\Keyword; | ||
| 12 | use App\Enums\Common\Code; | 12 | use App\Enums\Common\Code; |
| 13 | use App\Http\Controllers\Bside\BaseController; | 13 | use App\Http\Controllers\Bside\BaseController; |
| 14 | use App\Models\Project\DeployOptimize; | 14 | use App\Models\Project\DeployOptimize; |
| 15 | +use App\Models\Project\ProjectKeyword; | ||
| 15 | 16 | ||
| 16 | class ProjectKeywordController extends BaseController | 17 | class ProjectKeywordController extends BaseController |
| 17 | { | 18 | { |
| @@ -28,9 +29,16 @@ class ProjectKeywordController extends BaseController | @@ -28,9 +29,16 @@ class ProjectKeywordController extends BaseController | ||
| 28 | if($info === false){ | 29 | if($info === false){ |
| 29 | $this->response('success'); | 30 | $this->response('success'); |
| 30 | } | 31 | } |
| 31 | - $data['search_keywords'] = $info['search_keywords']; | ||
| 32 | - $data['customer_keywords'] = $info['customer_keywords']; | ||
| 33 | $data['brand_keyword'] = $info['brand_keyword']; | 32 | $data['brand_keyword'] = $info['brand_keyword']; |
| 33 | + $projectKeywordModel = new ProjectKeyword(); | ||
| 34 | + $keywordInfo = $projectKeywordModel->read(['project_id'=>$this->user['project_id']]); | ||
| 35 | + if($keywordInfo === false){ | ||
| 36 | + $data['search_keywords'] = ''; | ||
| 37 | + $data['customer_keywords'] = ''; | ||
| 38 | + $this->response('success',Code::SUCCESS,$data); | ||
| 39 | + } | ||
| 40 | + $data['search_keywords'] = $keywordInfo['search_keywords']; | ||
| 41 | + $data['customer_keywords'] = $keywordInfo['customer_keywords']; | ||
| 34 | $this->response('success',Code::SUCCESS,$data); | 42 | $this->response('success',Code::SUCCESS,$data); |
| 35 | } | 43 | } |
| 36 | 44 |
| @@ -220,7 +220,7 @@ class KeywordController extends BaseController | @@ -220,7 +220,7 @@ class KeywordController extends BaseController | ||
| 220 | 'title.max' => '批量操作不能超过500条数据' | 220 | 'title.max' => '批量操作不能超过500条数据' |
| 221 | ]); | 221 | ]); |
| 222 | $keywordModel = new Keyword(); | 222 | $keywordModel = new Keyword(); |
| 223 | - $rs = $keywordModel->edit(['is_video_keyword'=>$this->param['is_video_keyword']],['title'=>['in',$this->param['title']]]); | 223 | + $rs = $keywordModel->edit(['is_video_keyword'=>$this->param['is_video_keyword'] ?? 0],['title'=>['in',$this->param['title']]]); |
| 224 | if($rs === false){ | 224 | if($rs === false){ |
| 225 | $this->fail('编辑失败,请联系管理员'); | 225 | $this->fail('编辑失败,请联系管理员'); |
| 226 | } | 226 | } |
| @@ -133,11 +133,11 @@ class ProductController extends BaseController | @@ -133,11 +133,11 @@ class ProductController extends BaseController | ||
| 133 | } | 133 | } |
| 134 | } | 134 | } |
| 135 | if(!empty($v['video'])){ | 135 | if(!empty($v['video'])){ |
| 136 | - $v['video']['url'] = getFileUrl($v['video']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']); | 136 | + $v['video']['url'] = getFileUrl($v['video']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location'],$this->user['file_cdn'] ?? 0); |
| 137 | $v['video']['video_image'] = getImageUrl($v['video']['video_image'] ?? '',$this->user['storage_type'] ?? 0,$this->user['project_location']); | 137 | $v['video']['video_image'] = getImageUrl($v['video']['video_image'] ?? '',$this->user['storage_type'] ?? 0,$this->user['project_location']); |
| 138 | } | 138 | } |
| 139 | if(!empty($v['files']) && !empty($v['files']['url'])){ | 139 | if(!empty($v['files']) && !empty($v['files']['url'])){ |
| 140 | - $v['files']['url'] = getFileUrl($v['files']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']); | 140 | + $v['files']['url'] = getFileUrl($v['files']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location'],$this->user['file_cdn'] ?? 0); |
| 141 | } | 141 | } |
| 142 | return $this->success($v); | 142 | return $this->success($v); |
| 143 | } | 143 | } |
| @@ -167,6 +167,29 @@ class ProductController extends BaseController | @@ -167,6 +167,29 @@ class ProductController extends BaseController | ||
| 167 | if(!empty($this->param['start_at']) && !empty($this->param['end_at'])){ | 167 | if(!empty($this->param['start_at']) && !empty($this->param['end_at'])){ |
| 168 | $query->where('created_at', '>=' ,$this->param['start_at'].' 00:00:00')->where('created_at', '<=' ,$this->param['end_at'].' 59:59:59'); | 168 | $query->where('created_at', '>=' ,$this->param['start_at'].' 00:00:00')->where('created_at', '<=' ,$this->param['end_at'].' 59:59:59'); |
| 169 | } | 169 | } |
| 170 | + $this->param['featured_status'] = $this->param['featured_status'] ?? 0; | ||
| 171 | + if($this->param['featured_status'] != Category::STATUS_ACTIVE) { | ||
| 172 | + $cateModel = new Category(); | ||
| 173 | + $featured_ids = $cateModel->where('title', 'like', 'Featured%')->pluck('id')->toArray(); | ||
| 174 | + if(!empty($featured_ids)){ | ||
| 175 | + $status = []; | ||
| 176 | + if(isset($this->map['status'])){ | ||
| 177 | + $status = ['status'=>$this->map['status']]; | ||
| 178 | + } | ||
| 179 | + $cateList = $cateModel->list($status,'id',['id','pid']); | ||
| 180 | + //获取当前的子集 | ||
| 181 | + $featured_arr = []; | ||
| 182 | + foreach ($featured_ids as $id){ | ||
| 183 | + $featured_arr = array_merge($featured_arr,array_unique(_get_all_sub($id,$cateList))); | ||
| 184 | + } | ||
| 185 | + if(!empty($featured_arr)){ | ||
| 186 | + $cateRelated = new CategoryRelated(); | ||
| 187 | + $product_ids = $cateRelated->whereIn('cate_id',$featured_arr)->pluck('product_id')->unique()->toArray(); | ||
| 188 | + $query = $query->whereNotIn('id',$product_ids); | ||
| 189 | + } | ||
| 190 | + } | ||
| 191 | + | ||
| 192 | + } | ||
| 170 | return $query; | 193 | return $query; |
| 171 | } | 194 | } |
| 172 | 195 | ||
| @@ -356,9 +379,9 @@ class ProductController extends BaseController | @@ -356,9 +379,9 @@ class ProductController extends BaseController | ||
| 356 | foreach ($arr1 as $k1=>$v1){ | 379 | foreach ($arr1 as $k1=>$v1){ |
| 357 | $v1 = (array)$v1; | 380 | $v1 = (array)$v1; |
| 358 | if(isset($v1['url'])){ | 381 | if(isset($v1['url'])){ |
| 359 | - $v1['url'] = getFileUrl($v1['url'],$this->user['storage_type'],$this->user['project_location']); | 382 | + $v1['url'] = getFileUrl($v1['url'],$this->user['storage_type'],$this->user['project_location'],$this->user['file_cdn'] ?? 0); |
| 360 | }else{ | 383 | }else{ |
| 361 | - $v1 = getFileUrl($v1,$this->user['storage_type'],$this->user['project_location']); | 384 | + $v1 = getFileUrl($v1,$this->user['storage_type'],$this->user['project_location'],$this->user['file_cdn'] ?? 0); |
| 362 | } | 385 | } |
| 363 | $arr1[$k1] = $v1; | 386 | $arr1[$k1] = $v1; |
| 364 | } | 387 | } |
| @@ -548,8 +571,8 @@ class ProductController extends BaseController | @@ -548,8 +571,8 @@ class ProductController extends BaseController | ||
| 548 | } | 571 | } |
| 549 | 572 | ||
| 550 | /** | 573 | /** |
| 551 | - * @remark :Ai发布新闻 | ||
| 552 | - * @name :sendAiNews | 574 | + * @remark :Ai发布 |
| 575 | + * @name :sendAiProduct | ||
| 553 | * @author :lyh | 576 | * @author :lyh |
| 554 | * @method :post | 577 | * @method :post |
| 555 | * @time :2024/1/26 15:33 | 578 | * @time :2024/1/26 15:33 |
| @@ -221,7 +221,29 @@ class TranslateController extends BaseController | @@ -221,7 +221,29 @@ class TranslateController extends BaseController | ||
| 221 | public function getSixUrl($map){ | 221 | public function getSixUrl($map){ |
| 222 | $data = []; | 222 | $data = []; |
| 223 | $routeMapModel = new RouteMap(); | 223 | $routeMapModel = new RouteMap(); |
| 224 | + //查询路由中是否包含products | ||
| 224 | $list = $routeMapModel->list($map); | 225 | $list = $routeMapModel->list($map); |
| 226 | + $productInfo = $routeMapModel->read(['route'=>'products']); | ||
| 227 | + if($productInfo === false){ | ||
| 228 | + $productModel = new Product(); | ||
| 229 | + $count = $productModel->formatQuery(['status'=>1])->count(); | ||
| 230 | + $v['route'] = 'products'; | ||
| 231 | + $this->pageSixList($data,$count,$v,1,15); | ||
| 232 | + } | ||
| 233 | + $newsInfo = $routeMapModel->read(['route'=>'news']); | ||
| 234 | + if($newsInfo === false){ | ||
| 235 | + $newsModel = new News(); | ||
| 236 | + $count = $newsModel->formatQuery(['status'=>1])->count(); | ||
| 237 | + $v['route'] = 'news'; | ||
| 238 | + $this->pageSixList($data,$count,$v,1,15); | ||
| 239 | + } | ||
| 240 | + $blogInfo = $routeMapModel->read(['route'=>'blog']); | ||
| 241 | + if($blogInfo === false){ | ||
| 242 | + $blogModel = new Blog(); | ||
| 243 | + $count = $blogModel->formatQuery(['status'=>1])->count(); | ||
| 244 | + $v['route'] = 'blog'; | ||
| 245 | + $this->pageSixList($data,$count,$v,1,15); | ||
| 246 | + } | ||
| 225 | foreach ($list as $k => $v){ | 247 | foreach ($list as $k => $v){ |
| 226 | switch ($v['source']){ | 248 | switch ($v['source']){ |
| 227 | case RouteMap::SOURCE_PAGE: | 249 | case RouteMap::SOURCE_PAGE: |
| @@ -293,6 +315,17 @@ class TranslateController extends BaseController | @@ -293,6 +315,17 @@ class TranslateController extends BaseController | ||
| 293 | } | 315 | } |
| 294 | 316 | ||
| 295 | /** | 317 | /** |
| 318 | + * @remark :获取默认数据 | ||
| 319 | + * @name :getDefaultData | ||
| 320 | + * @author :lyh | ||
| 321 | + * @method :post | ||
| 322 | + * @time :2024/7/16 15:28 | ||
| 323 | + */ | ||
| 324 | + public function getDefaultData(){ | ||
| 325 | + | ||
| 326 | + } | ||
| 327 | + | ||
| 328 | + /** | ||
| 296 | * @remark : | 329 | * @remark : |
| 297 | * @name :pageList | 330 | * @name :pageList |
| 298 | * @author :lyh | 331 | * @author :lyh |
| @@ -342,7 +342,7 @@ class FileController | @@ -342,7 +342,7 @@ class FileController | ||
| 342 | if ($info === false) { | 342 | if ($info === false) { |
| 343 | $this->response('指定文件不存在!', Code::USER_ERROR); | 343 | $this->response('指定文件不存在!', Code::USER_ERROR); |
| 344 | } | 344 | } |
| 345 | - $fileUrl = getFileUrl($info['path'],$info['is_cos']); | 345 | + $fileUrl = getFileUrl($info['path'],$this->cache['storage_type'] ?? 0,$this->cache['project_location'] ?? 0,$this->cache['file_cdn'] ?? 0); |
| 346 | // 设置响应头 | 346 | // 设置响应头 |
| 347 | header('Content-Description: File Transfer'); | 347 | header('Content-Description: File Transfer'); |
| 348 | header('Content-Type: application/octet-stream'); | 348 | header('Content-Type: application/octet-stream'); |
| @@ -388,11 +388,11 @@ class FileController | @@ -388,11 +388,11 @@ class FileController | ||
| 388 | if(isset($this->cache['project_id']) && !empty($this->cache['project_id'])){ | 388 | if(isset($this->cache['project_id']) && !empty($this->cache['project_id'])){ |
| 389 | $this->map['project_id'] = $this->cache['project_id']; | 389 | $this->map['project_id'] = $this->cache['project_id']; |
| 390 | } | 390 | } |
| 391 | - $this->map['refer'] = 1; | ||
| 392 | $fileModel = new File(); | 391 | $fileModel = new File(); |
| 392 | + $this->map['type'] = 'mp4'; | ||
| 393 | $lists = $fileModel->list($this->map,'id',['id','hash','type','path','created_at','name']); | 393 | $lists = $fileModel->list($this->map,'id',['id','hash','type','path','created_at','name']); |
| 394 | foreach ($lists as $k => $v){ | 394 | foreach ($lists as $k => $v){ |
| 395 | - $v['file_link'] = getFileUrl($v['path'],$this->cache['storage_type'] ?? 0); | 395 | + $v['file_link'] = getFileUrl($v['path'],$this->cache['storage_type'] ?? 0,$this->cache['project_location'] ?? 0,$this->cache['file_cdn'] ?? 0); |
| 396 | $lists[$k] = $v; | 396 | $lists[$k] = $v; |
| 397 | } | 397 | } |
| 398 | $this->response('success',Code::SUCCESS,$lists); | 398 | $this->response('success',Code::SUCCESS,$lists); |
| @@ -408,7 +408,7 @@ class FileController | @@ -408,7 +408,7 @@ class FileController | ||
| 408 | public function responseData($path, $name){ | 408 | public function responseData($path, $name){ |
| 409 | $data = [ | 409 | $data = [ |
| 410 | 'file'=>$path, | 410 | 'file'=>$path, |
| 411 | - 'file_link'=>getFileUrl($path,$this->cache['storage_type'] ?? 0), | 411 | + 'file_link'=>getFileUrl($path,$this->cache['storage_type'] ?? 0,$this->cache['project_location'] ?? 0,$this->cache['file_cdn'] ?? 0), |
| 412 | 'name'=>$name, | 412 | 'name'=>$name, |
| 413 | 'file_download'=>url('a/download_files?path='.$path) | 413 | 'file_download'=>url('a/download_files?path='.$path) |
| 414 | ]; | 414 | ]; |
| @@ -13,6 +13,7 @@ use App\Http\Logic\Aside\BaseLogic; | @@ -13,6 +13,7 @@ use App\Http\Logic\Aside\BaseLogic; | ||
| 13 | use App\Models\CustomModule\CustomModule; | 13 | use App\Models\CustomModule\CustomModule; |
| 14 | use App\Models\CustomModule\CustomModuleCategory; | 14 | use App\Models\CustomModule\CustomModuleCategory; |
| 15 | use App\Models\CustomModule\CustomModuleContent; | 15 | use App\Models\CustomModule\CustomModuleContent; |
| 16 | +use App\Models\RouteMap\RouteMap; | ||
| 16 | use App\Services\ProjectServer; | 17 | use App\Services\ProjectServer; |
| 17 | use Illuminate\Support\Facades\DB; | 18 | use Illuminate\Support\Facades\DB; |
| 18 | 19 | ||
| @@ -84,9 +85,17 @@ class CustomModuleLogic extends BaseLogic | @@ -84,9 +85,17 @@ class CustomModuleLogic extends BaseLogic | ||
| 84 | * @time :2023/12/5 9:39 | 85 | * @time :2023/12/5 9:39 |
| 85 | */ | 86 | */ |
| 86 | public function moduleAdd(){ | 87 | public function moduleAdd(){ |
| 87 | - $rs = (new CustomModule())->add($this->param); | ||
| 88 | - if($rs === false){ | ||
| 89 | - $this->fail('系统错误,请联系管理员'); | 88 | + $id = (new CustomModule())->addReturnId($this->param); |
| 89 | + if($id){ | ||
| 90 | + //同时创建对应route的分类 | ||
| 91 | + $customModuleCateModel = new CustomModuleCategory(); | ||
| 92 | + $data = [ | ||
| 93 | + 'name'=>$this->param['route'], | ||
| 94 | + 'module_id'=>$id, | ||
| 95 | + 'project_id'=>$this->param['project_id'], | ||
| 96 | + 'route'=>RouteMap::setRoute($this->param['route'],RouteMap::SOURCE_MODULE_CATE,$id,$this->param['project_id']) | ||
| 97 | + ]; | ||
| 98 | + $customModuleCateModel->add($data); | ||
| 90 | } | 99 | } |
| 91 | return $this->success(); | 100 | return $this->success(); |
| 92 | } | 101 | } |
| @@ -315,6 +315,7 @@ class DomainInfoLogic extends BaseLogic | @@ -315,6 +315,7 @@ class DomainInfoLogic extends BaseLogic | ||
| 315 | 'amp_private_cert' => $this->param['amp_cert'] ?? '', | 315 | 'amp_private_cert' => $this->param['amp_cert'] ?? '', |
| 316 | 'not_allow_country'=>json_encode(array_filter($this->param['not_allow_country'] ?? [])), | 316 | 'not_allow_country'=>json_encode(array_filter($this->param['not_allow_country'] ?? [])), |
| 317 | 'not_allow_ip'=>json_encode(array_filter($this->param['not_allow_ip'] ?? [])), | 317 | 'not_allow_ip'=>json_encode(array_filter($this->param['not_allow_ip'] ?? [])), |
| 318 | + 'is_redirect' => $this->param['is_redirect'] ?? 0, | ||
| 318 | ]; | 319 | ]; |
| 319 | $this->model->edit($data,['id'=>$this->param['id']]); | 320 | $this->model->edit($data,['id'=>$this->param['id']]); |
| 320 | //主站生成证书 | 321 | //主站生成证书 |
| @@ -39,7 +39,8 @@ class HrLogic extends BaseLogic | @@ -39,7 +39,8 @@ class HrLogic extends BaseLogic | ||
| 39 | * @time :2023/9/6 10:17 | 39 | * @time :2023/9/6 10:17 |
| 40 | */ | 40 | */ |
| 41 | public function hrSave(){ | 41 | public function hrSave(){ |
| 42 | - //处理参数 | 42 | + $this->handleParam(); |
| 43 | + //处理参数 | ||
| 43 | foreach ($this->model::specieField() as $v){ | 44 | foreach ($this->model::specieField() as $v){ |
| 44 | $this->param = $this->setJson($v,$this->param); | 45 | $this->param = $this->setJson($v,$this->param); |
| 45 | } | 46 | } |
| @@ -52,6 +53,22 @@ class HrLogic extends BaseLogic | @@ -52,6 +53,22 @@ class HrLogic extends BaseLogic | ||
| 52 | } | 53 | } |
| 53 | 54 | ||
| 54 | /** | 55 | /** |
| 56 | + * @remark :处理字段 | ||
| 57 | + * @name :handleParam | ||
| 58 | + * @author :lyh | ||
| 59 | + * @method :post | ||
| 60 | + * @time :2024/7/10 16:32 | ||
| 61 | + */ | ||
| 62 | + public function handleParam(){ | ||
| 63 | + $this->param['status'] = empty($this->param['status']) ? 1 : $this->param['status']; | ||
| 64 | + $this->param['education'] = empty($this->param['education']) ? 1 : $this->param['education']; | ||
| 65 | + $this->param['entry_position'] = empty($this->param['entry_position']) ? 1 : $this->param['entry_position']; | ||
| 66 | + $this->param['p_level'] = empty($this->param['p_level']) ? 1 : $this->param['p_level']; | ||
| 67 | + $this->param['dept_id'] = empty($this->param['dept_id']) ? 1 : $this->param['dept_id']; | ||
| 68 | + $this->param['belong_group'] = empty($this->param['belong_group']) ? 1 : $this->param['belong_group']; | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + /** | ||
| 55 | * @remark :添加人事信息时 同步添加管理员账号 | 72 | * @remark :添加人事信息时 同步添加管理员账号 |
| 56 | * @name :addManager | 73 | * @name :addManager |
| 57 | * @author :lyh | 74 | * @author :lyh |
| @@ -75,10 +92,8 @@ class HrLogic extends BaseLogic | @@ -75,10 +92,8 @@ class HrLogic extends BaseLogic | ||
| 75 | $managerModel = new Manage(); | 92 | $managerModel = new Manage(); |
| 76 | $this->param['manage_id'] = $managerModel->addReturnId($data); | 93 | $this->param['manage_id'] = $managerModel->addReturnId($data); |
| 77 | $this->model->add($this->param); | 94 | $this->model->add($this->param); |
| 78 | - | ||
| 79 | //同步到B端演示项目 | 95 | //同步到B端演示项目 |
| 80 | $this->syncBProjectUser($this->param['mobile'], $this->param['mobile'], $this->param['name'], $this->param['status']); | 96 | $this->syncBProjectUser($this->param['mobile'], $this->param['mobile'], $this->param['name'], $this->param['status']); |
| 81 | - | ||
| 82 | DB::commit(); | 97 | DB::commit(); |
| 83 | }catch (\Exception $e){ | 98 | }catch (\Exception $e){ |
| 84 | DB::rollBack(); | 99 | DB::rollBack(); |
| @@ -120,7 +135,7 @@ class HrLogic extends BaseLogic | @@ -120,7 +135,7 @@ class HrLogic extends BaseLogic | ||
| 120 | DB::commit(); | 135 | DB::commit(); |
| 121 | }catch (\Exception $e){ | 136 | }catch (\Exception $e){ |
| 122 | DB::rollBack(); | 137 | DB::rollBack(); |
| 123 | - $this->fail('系统错误,请联系管理员'); | 138 | + $this->fail('系统错误,请联系管理员'.$e->getMessage()); |
| 124 | } | 139 | } |
| 125 | return $this->success(); | 140 | return $this->success(); |
| 126 | } | 141 | } |
| @@ -236,8 +236,9 @@ class InquiryInfoLogic extends BaseLogic | @@ -236,8 +236,9 @@ class InquiryInfoLogic extends BaseLogic | ||
| 236 | public function getKeywordUrl($map){ | 236 | public function getKeywordUrl($map){ |
| 237 | $projectModel = new Project(); | 237 | $projectModel = new Project(); |
| 238 | $lists = $projectModel->leftJoin('gl_project_deploy_optimize', 'gl_project_deploy_optimize.project_id', '=', 'gl_project.id') | 238 | $lists = $projectModel->leftJoin('gl_project_deploy_optimize', 'gl_project_deploy_optimize.project_id', '=', 'gl_project.id') |
| 239 | - ->where('gl_project_deploy_optimize.main_keywords','like','%'.$map['keyword'].'%') | ||
| 240 | - ->orWhere('gl_project_deploy_optimize.customer_keywords','like','%'.$map['keyword'].'%') | 239 | + ->leftJoin('gl_project_keyword', 'gl_project_keyword.project_id', '=', 'gl_project.id') |
| 240 | + ->where('gl_project_keyword.main_keyword','like','%'.$map['keyword'].'%') | ||
| 241 | + ->orWhere('gl_project_keyword.customer_keywords','like','%'.$map['keyword'].'%') | ||
| 241 | ->select($this->selectParam())->get(); | 242 | ->select($this->selectParam())->get(); |
| 242 | if(!empty($lists)){ | 243 | if(!empty($lists)){ |
| 243 | $lists = $lists->toArray(); | 244 | $lists = $lists->toArray(); |
| @@ -30,6 +30,7 @@ use App\Models\Project\InquiryFilterConfig; | @@ -30,6 +30,7 @@ use App\Models\Project\InquiryFilterConfig; | ||
| 30 | use App\Models\Project\MinorLanguages; | 30 | use App\Models\Project\MinorLanguages; |
| 31 | use App\Models\Project\Payment; | 31 | use App\Models\Project\Payment; |
| 32 | use App\Models\Project\Project; | 32 | use App\Models\Project\Project; |
| 33 | +use App\Models\Project\ProjectKeyword; | ||
| 33 | use App\Models\Project\ProjectRenew; | 34 | use App\Models\Project\ProjectRenew; |
| 34 | use App\Models\Project\WebTrafficConfig; | 35 | use App\Models\Project\WebTrafficConfig; |
| 35 | use App\Models\RankData\ExternalLinks; | 36 | use App\Models\RankData\ExternalLinks; |
| @@ -71,7 +72,8 @@ class ProjectLogic extends BaseLogic | @@ -71,7 +72,8 @@ class ProjectLogic extends BaseLogic | ||
| 71 | * @time :2023/7/28 17:11 | 72 | * @time :2023/7/28 17:11 |
| 72 | */ | 73 | */ |
| 73 | public function getProjectInfo($id){ | 74 | public function getProjectInfo($id){ |
| 74 | - $info = $this->model->with(['payment', 'deploy_build', 'deploy_optimize', 'online_check', 'project_after','inquiry_filter_config','web_traffic_config'])->where(['id'=>$id])->first()->toArray(); | 75 | + $info = $this->model->with(['payment', 'deploy_build', 'deploy_optimize', 'online_check', |
| 76 | + 'project_after','inquiry_filter_config','web_traffic_config','project_keyword'])->where(['id'=>$id])->first()->toArray(); | ||
| 75 | $info['online_check']['name'] = (new Manage())->getName($info['online_check']['created_manage_id'] ?? 0); | 77 | $info['online_check']['name'] = (new Manage())->getName($info['online_check']['created_manage_id'] ?? 0); |
| 76 | $info['init_domain'] = $this->getInitDomain($info['serve_id'])['domain']; | 78 | $info['init_domain'] = $this->getInitDomain($info['serve_id'])['domain']; |
| 77 | if($info['extend_type'] != 0){ | 79 | if($info['extend_type'] != 0){ |
| @@ -148,7 +150,7 @@ class ProjectLogic extends BaseLogic | @@ -148,7 +150,7 @@ class ProjectLogic extends BaseLogic | ||
| 148 | //初始化项目 | 150 | //初始化项目 |
| 149 | $this->createProjectData($this->param); | 151 | $this->createProjectData($this->param); |
| 150 | //双向绑定服务器,需放到保存项目的上方 | 152 | //双向绑定服务器,需放到保存项目的上方 |
| 151 | - $this->setServers($this->param['serve_id'] ?? 0,$this->param['id']); | 153 | + $this->setServers($this->param['serve_id'],$this->param['id']); |
| 152 | //保存项目信息 | 154 | //保存项目信息 |
| 153 | $this->saveProject($this->param); | 155 | $this->saveProject($this->param); |
| 154 | //保存建站部署信息 | 156 | //保存建站部署信息 |
| @@ -157,6 +159,8 @@ class ProjectLogic extends BaseLogic | @@ -157,6 +159,8 @@ class ProjectLogic extends BaseLogic | ||
| 157 | $this->saveProjectPayment($this->param['payment']); | 159 | $this->saveProjectPayment($this->param['payment']); |
| 158 | //保存优化信息 | 160 | //保存优化信息 |
| 159 | $this->saveProjectDeployOptimize($this->param['deploy_optimize']); | 161 | $this->saveProjectDeployOptimize($this->param['deploy_optimize']); |
| 162 | + //保存项目关键字 | ||
| 163 | + $this->saveProjectKeyword($this->param['project_keyword'] ?? [],$this->param['id']); | ||
| 160 | //保存售后信息 | 164 | //保存售后信息 |
| 161 | $this->saveProjectAfter($this->param['project_after']); | 165 | $this->saveProjectAfter($this->param['project_after']); |
| 162 | //单独保存小语种配置 | 166 | //单独保存小语种配置 |
| @@ -354,6 +358,30 @@ class ProjectLogic extends BaseLogic | @@ -354,6 +358,30 @@ class ProjectLogic extends BaseLogic | ||
| 354 | } | 358 | } |
| 355 | 359 | ||
| 356 | /** | 360 | /** |
| 361 | + * @remark :保存项目关键字 | ||
| 362 | + * @name :saveProjectKeyword | ||
| 363 | + * @author :lyh | ||
| 364 | + * @method :post | ||
| 365 | + * @time :2024/7/22 11:45 | ||
| 366 | + */ | ||
| 367 | + public function saveProjectKeyword($project_keyword,$project_id){ | ||
| 368 | + $projectKeywordModel = new ProjectKeyword(); | ||
| 369 | + $info = $projectKeywordModel->read(['project_id'=>$project_id]); | ||
| 370 | + $data = [ | ||
| 371 | + 'main_keyword'=>$project_keyword['main_keyword'] ?? '', | ||
| 372 | + 'customer_keywords'=>$project_keyword['customer_keywords'] ?? '', | ||
| 373 | + 'search_keywords'=>$project_keyword['search_keywords'] ?? '', | ||
| 374 | + ]; | ||
| 375 | + if($info === false){ | ||
| 376 | + $data['project_id'] = $project_id; | ||
| 377 | + $projectKeywordModel->addReturnId($data); | ||
| 378 | + }else{ | ||
| 379 | + $projectKeywordModel->edit($data,['id'=>$info['id']]); | ||
| 380 | + } | ||
| 381 | + return $this->success(); | ||
| 382 | + } | ||
| 383 | + | ||
| 384 | + /** | ||
| 357 | * @remark :保存为售后部署 | 385 | * @remark :保存为售后部署 |
| 358 | * @name :saveProjectAfter | 386 | * @name :saveProjectAfter |
| 359 | * @author :lyh | 387 | * @author :lyh |
| @@ -16,18 +16,15 @@ class TaskOwnerLogic extends BaseLogic | @@ -16,18 +16,15 @@ class TaskOwnerLogic extends BaseLogic | ||
| 16 | public function __construct() | 16 | public function __construct() |
| 17 | { | 17 | { |
| 18 | parent::__construct(); | 18 | parent::__construct(); |
| 19 | - | ||
| 20 | $this->model = new TaskOwner(); | 19 | $this->model = new TaskOwner(); |
| 21 | } | 20 | } |
| 22 | 21 | ||
| 23 | public function save($param){ | 22 | public function save($param){ |
| 24 | //获取已分配了的 | 23 | //获取已分配了的 |
| 25 | $manage_ids = $this->model->where('task_id', $param['task_id'])->pluck('manage_id', 'id')->toArray(); | 24 | $manage_ids = $this->model->where('task_id', $param['task_id'])->pluck('manage_id', 'id')->toArray(); |
| 26 | - | ||
| 27 | //待删除的 | 25 | //待删除的 |
| 28 | $del_manage_ids = array_diff($manage_ids, $param['manage_ids']); | 26 | $del_manage_ids = array_diff($manage_ids, $param['manage_ids']); |
| 29 | $this->delete(array_keys($del_manage_ids)); | 27 | $this->delete(array_keys($del_manage_ids)); |
| 30 | - | ||
| 31 | //新增的 | 28 | //新增的 |
| 32 | $add_manage_ids = array_diff($param['manage_ids'], $manage_ids); | 29 | $add_manage_ids = array_diff($param['manage_ids'], $manage_ids); |
| 33 | foreach ($add_manage_ids as $add_manage_id){ | 30 | foreach ($add_manage_ids as $add_manage_id){ |
| @@ -8,6 +8,7 @@ use App\Helper\Translate; | @@ -8,6 +8,7 @@ use App\Helper\Translate; | ||
| 8 | use App\Http\Logic\Bside\BaseLogic; | 8 | use App\Http\Logic\Bside\BaseLogic; |
| 9 | use App\Models\Ai\AiCommand; | 9 | use App\Models\Ai\AiCommand; |
| 10 | use App\Models\Project\DeployOptimize; | 10 | use App\Models\Project\DeployOptimize; |
| 11 | +use App\Models\Project\ProjectKeyword; | ||
| 11 | use App\Models\WebSetting\WebLanguage; | 12 | use App\Models\WebSetting\WebLanguage; |
| 12 | use Illuminate\Support\Facades\Cache; | 13 | use Illuminate\Support\Facades\Cache; |
| 13 | 14 | ||
| @@ -43,14 +44,14 @@ class AiCommandLogic extends BaseLogic | @@ -43,14 +44,14 @@ class AiCommandLogic extends BaseLogic | ||
| 43 | $prompt = str_replace('{company name}', $company_name, $prompt); | 44 | $prompt = str_replace('{company name}', $company_name, $prompt); |
| 44 | } | 45 | } |
| 45 | if(strpos($prompt, '{core keywords 8}') !== false) { | 46 | if(strpos($prompt, '{core keywords 8}') !== false) { |
| 46 | - $main_keywords = $this->getDeployOptimize('main_keywords'); | ||
| 47 | - if ($main_keywords) { | ||
| 48 | - $main_keywords = explode("\r\n", $main_keywords); | 47 | + $main_keyword = $this->getDeployOptimize('main_keyword'); |
| 48 | + if ($main_keyword) { | ||
| 49 | + $main_keyword = explode("\r\n", $main_keyword); | ||
| 49 | //随机取 | 50 | //随机取 |
| 50 | - shuffle($main_keywords); | ||
| 51 | - $main_keywords = array_slice($main_keywords, 0, 8); | ||
| 52 | - $main_keywords = implode(", ", $main_keywords); | ||
| 53 | - $prompt = str_replace('{core keywords 8}', $main_keywords, $prompt); | 51 | + shuffle($main_keyword); |
| 52 | + $main_keyword = array_slice($main_keyword, 0, 8); | ||
| 53 | + $main_keyword = implode(", ", $main_keyword); | ||
| 54 | + $prompt = str_replace('{core keywords 8}', $main_keyword, $prompt); | ||
| 54 | }else{ | 55 | }else{ |
| 55 | $prompt = ''; | 56 | $prompt = ''; |
| 56 | } | 57 | } |
| @@ -99,7 +100,13 @@ class AiCommandLogic extends BaseLogic | @@ -99,7 +100,13 @@ class AiCommandLogic extends BaseLogic | ||
| 99 | $info = Cache::get($cache_key); | 100 | $info = Cache::get($cache_key); |
| 100 | if(!$info){ | 101 | if(!$info){ |
| 101 | $projectOptimizeModel = new DeployOptimize(); | 102 | $projectOptimizeModel = new DeployOptimize(); |
| 102 | - $info = $projectOptimizeModel->read(['project_id' => $project_id], ['id', 'company_en_name', 'company_en_description', 'main_keywords']); | 103 | + $info = $projectOptimizeModel->read(['project_id' => $project_id], ['id', 'company_en_name', 'company_en_description']); |
| 104 | + $projectKeywordModel = new ProjectKeyword(); | ||
| 105 | + $keywordInfo = $projectKeywordModel->read(['project_id'=>$project_id]); | ||
| 106 | + $info['main_keyword'] = ''; | ||
| 107 | + if($keywordInfo === false){ | ||
| 108 | + $info['main_keyword'] = $keywordInfo['main_keyword']; | ||
| 109 | + } | ||
| 103 | Cache::put($cache_key, $info, 600); | 110 | Cache::put($cache_key, $info, 600); |
| 104 | } | 111 | } |
| 105 | if($key){ | 112 | if($key){ |
| @@ -66,7 +66,7 @@ class AyrReleaseLogic extends BaseLogic | @@ -66,7 +66,7 @@ class AyrReleaseLogic extends BaseLogic | ||
| 66 | $arr[] = getImageUrl($v1); | 66 | $arr[] = getImageUrl($v1); |
| 67 | } | 67 | } |
| 68 | }else{ | 68 | }else{ |
| 69 | - $arr[] = getFileUrl($v); | 69 | + $arr[] = getFileUrl($v,$this->user['storage_type'] ?? 0,$this->user['project_location'] ?? 0,1); |
| 70 | } | 70 | } |
| 71 | } | 71 | } |
| 72 | } | 72 | } |
| @@ -442,36 +442,34 @@ class BTemplateLogic extends BaseLogic | @@ -442,36 +442,34 @@ class BTemplateLogic extends BaseLogic | ||
| 442 | */ | 442 | */ |
| 443 | public function handleVisualizationParam($html,$source, $is_list,$is_custom,$data){ | 443 | public function handleVisualizationParam($html,$source, $is_list,$is_custom,$data){ |
| 444 | if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION){//定制项目 | 444 | if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION){//定制项目 |
| 445 | - $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型 | ||
| 446 | - //查看当前页面是否定制,是否开启可视化 | ||
| 447 | - $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面 | ||
| 448 | - if (in_array($type, $page_array)) {//当前页面是定制界面 | ||
| 449 | - $data['html'] = $html; | ||
| 450 | - $data['type'] = BTemplate::ALL_HTML; | 445 | + //TODO::扩展模块定制单独处理 |
| 446 | + if($is_custom == BTemplate::IS_CUSTOM){ | ||
| 447 | + $customModuleModel = new CustomModule(); | ||
| 448 | + $info = $customModuleModel->read(['id'=>$source]); | ||
| 449 | + if($info === false){ | ||
| 450 | + $this->fail('当前扩展模块不存在或已被删除'); | ||
| 451 | + } | ||
| 452 | + //todo::扩展模块(列表页/详情页)定制 | ||
| 453 | + if($info['list_customized'] == BTemplate::IS_VISUALIZATION || $info['detail_customized'] == BTemplate::IS_VISUALIZATION) { | ||
| 454 | + $data['html'] = $html; | ||
| 455 | + $data['type'] = BTemplate::ALL_HTML; | ||
| 456 | + return $this->success($data); | ||
| 457 | + } | ||
| 451 | }else{ | 458 | }else{ |
| 452 | - //TODO::扩展模块定制单独处理 | ||
| 453 | - if($is_custom == BTemplate::IS_CUSTOM){ | ||
| 454 | - $customModuleModel = new CustomModule(); | ||
| 455 | - $info = $customModuleModel->read(['id'=>$source]); | ||
| 456 | - if($info === false){ | ||
| 457 | - $this->fail('当前扩展模块不存在或已被删除'); | ||
| 458 | - } | ||
| 459 | - //todo::扩展模块(列表页/详情页)定制 | ||
| 460 | - if($info['list_customized'] == BTemplate::IS_VISUALIZATION || $info['detail_customized'] == BTemplate::IS_VISUALIZATION) { | ||
| 461 | - $data['html'] = $html; | ||
| 462 | - $data['type'] = BTemplate::ALL_HTML; | ||
| 463 | - } | 459 | + $type = $this->getCustomizedType($source, $is_list);//获取定制界面类型 |
| 460 | + //查看当前页面是否定制,是否开启可视化 | ||
| 461 | + $page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面 | ||
| 462 | + if (in_array($type, $page_array)) {//当前页面是定制界面 | ||
| 463 | + $data['html'] = $html; | ||
| 464 | + $data['type'] = BTemplate::ALL_HTML; | ||
| 465 | + return $this->success($data); | ||
| 464 | } | 466 | } |
| 465 | - $mainInfo = $this->handleTemplateHtml($html); | ||
| 466 | - $data['main_html'] = $mainInfo['main_html']; | ||
| 467 | - $data['main_css'] = $mainInfo['main_css']; | ||
| 468 | } | 467 | } |
| 469 | - }else{ | ||
| 470 | - $mainInfo = $this->handleTemplateHtml($html); | ||
| 471 | - $data['main_html'] = $mainInfo['main_html']; | ||
| 472 | - $data['main_css'] = $mainInfo['main_css']; | ||
| 473 | } | 468 | } |
| 474 | - return $data; | 469 | + $mainInfo = $this->handleTemplateHtml($html); |
| 470 | + $data['main_html'] = $mainInfo['main_html']; | ||
| 471 | + $data['main_css'] = $mainInfo['main_css']; | ||
| 472 | + return $this->success($data); | ||
| 475 | } | 473 | } |
| 476 | 474 | ||
| 477 | /** | 475 | /** |
| @@ -68,6 +68,9 @@ class CustomTemplateLogic extends BaseLogic | @@ -68,6 +68,9 @@ class CustomTemplateLogic extends BaseLogic | ||
| 68 | if(($this->project['deploy_build']['is_search'] == 0) && ($this->param['url'] == 'search')){ | 68 | if(($this->project['deploy_build']['is_search'] == 0) && ($this->param['url'] == 'search')){ |
| 69 | $this->fail('请先开启搜索页可视化'); | 69 | $this->fail('请先开启搜索页可视化'); |
| 70 | } | 70 | } |
| 71 | + if(($this->project['deploy_build']['is_keyword'] == 0) && ($this->param['url'] == 'keyword')){ | ||
| 72 | + $this->fail('请先开启聚合页可视化'); | ||
| 73 | + } | ||
| 71 | if(isset($this->param['id']) && !empty($this->param['id'])){ | 74 | if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 72 | $id = $this->param['id']; | 75 | $id = $this->param['id']; |
| 73 | $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0 | 76 | $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0 |
| @@ -30,28 +30,21 @@ class BlogLogic extends BaseLogic | @@ -30,28 +30,21 @@ class BlogLogic extends BaseLogic | ||
| 30 | */ | 30 | */ |
| 31 | public function blogSave(){ | 31 | public function blogSave(){ |
| 32 | //拼接参数 | 32 | //拼接参数 |
| 33 | - DB::beginTransaction(); | ||
| 34 | - try { | ||
| 35 | - $this->param = $this->paramProcessing($this->param); | ||
| 36 | - if(isset($this->param['id']) && !empty($this->param['id'])){ | ||
| 37 | - $id = $this->param['id']; | ||
| 38 | - $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0 | ||
| 39 | - $six_read = $this->param['six_read'] ?? 0;//是否按6.0显示 | ||
| 40 | - if($is_upgrade == 0 || $six_read == 1){ | ||
| 41 | - $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']); | ||
| 42 | - } | ||
| 43 | - $route = $this->param['url']; | ||
| 44 | - $this->edit($this->param,['id'=>$id]); | ||
| 45 | - }else{ | ||
| 46 | - $this->param['sort'] = $this->setNewsSort(); | ||
| 47 | - $id = $this->model->addReturnId($this->param); | ||
| 48 | - $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']); | ||
| 49 | - $this->edit(['url'=>$route],['id'=>$id]); | 33 | + $this->param = $this->paramProcessing($this->param); |
| 34 | + if(isset($this->param['id']) && !empty($this->param['id'])){ | ||
| 35 | + $id = $this->param['id']; | ||
| 36 | + $is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0 | ||
| 37 | + $six_read = $this->param['six_read'] ?? 0;//是否按6.0显示 | ||
| 38 | + if($is_upgrade == 0 || $six_read == 1){ | ||
| 39 | + $this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']); | ||
| 50 | } | 40 | } |
| 51 | - DB::commit(); | ||
| 52 | - }catch (\Exception $e){ | ||
| 53 | - DB::rollBack(); | ||
| 54 | - $this->fail('系统错误,请联系管理员'); | 41 | + $route = $this->param['url']; |
| 42 | + $this->edit($this->param,['id'=>$id]); | ||
| 43 | + }else{ | ||
| 44 | + $this->param['sort'] = $this->setNewsSort(); | ||
| 45 | + $id = $this->model->addReturnId($this->param); | ||
| 46 | + $route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']); | ||
| 47 | + $this->edit(['url'=>$route],['id'=>$id]); | ||
| 55 | } | 48 | } |
| 56 | $this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route); | 49 | $this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route); |
| 57 | $this->curlDelRoute(['new_route'=>$route]); | 50 | $this->curlDelRoute(['new_route'=>$route]); |
| @@ -431,7 +424,7 @@ class BlogLogic extends BaseLogic | @@ -431,7 +424,7 @@ class BlogLogic extends BaseLogic | ||
| 431 | public function copyBlogInfo(){ | 424 | public function copyBlogInfo(){ |
| 432 | $info = $this->model->read(['id'=>$this->param['id']]); | 425 | $info = $this->model->read(['id'=>$this->param['id']]); |
| 433 | $param = [ | 426 | $param = [ |
| 434 | - 'name'=>$info['name']."-copy", | 427 | + 'name'=>$info['name']."-1", |
| 435 | 'status'=>0, | 428 | 'status'=>0, |
| 436 | 'sort'=>$info['sort'], | 429 | 'sort'=>$info['sort'], |
| 437 | 'category_id'=>$info['category_id'], | 430 | 'category_id'=>$info['category_id'], |
| @@ -94,7 +94,7 @@ class CustomModuleContentLogic extends BaseLogic | @@ -94,7 +94,7 @@ class CustomModuleContentLogic extends BaseLogic | ||
| 94 | }elseif($v['type'] == 4){ | 94 | }elseif($v['type'] == 4){ |
| 95 | $arr1 = json_decode($info['values']); | 95 | $arr1 = json_decode($info['values']); |
| 96 | foreach ($arr1 as $k1=>$v1){ | 96 | foreach ($arr1 as $k1=>$v1){ |
| 97 | - $v1 = getFileUrl($v1,$this->user['storage_type'],$this->user['project_location']); | 97 | + $v1 = getFileUrl($v1,$this->user['storage_type'],$this->user['project_location'],$this->user['file_cdn'] ?? 0); |
| 98 | $arr1[$k1] = $v1; | 98 | $arr1[$k1] = $v1; |
| 99 | } | 99 | } |
| 100 | $v['values'] = $arr1; | 100 | $v['values'] = $arr1; |
| @@ -60,8 +60,8 @@ class CountLogic extends BaseLogic | @@ -60,8 +60,8 @@ class CountLogic extends BaseLogic | ||
| 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']], | ||
| 64 | - 'service_duration'=>$this->project['deploy_build']['service_duration'], | 63 | + 'scheme'=>!empty($this->project['deploy_build']['plan']) ? Project::planMap()[$this->project['deploy_build']['plan']] : '', |
| 64 | + 'service_duration'=>$this->project['deploy_build']['service_duration'] ?? 0, | ||
| 65 | ]; | 65 | ]; |
| 66 | return $this->success($data); | 66 | return $this->success($data); |
| 67 | } | 67 | } |
| @@ -8,6 +8,7 @@ use App\Models\HomeCount\Count; | @@ -8,6 +8,7 @@ use App\Models\HomeCount\Count; | ||
| 8 | use App\Models\HomeCount\MonthCount; | 8 | use App\Models\HomeCount\MonthCount; |
| 9 | use App\Models\Inquiry\InquiryFormData; | 9 | use App\Models\Inquiry\InquiryFormData; |
| 10 | use App\Models\Project\DeployOptimize; | 10 | use App\Models\Project\DeployOptimize; |
| 11 | +use App\Models\Project\ProjectKeyword; | ||
| 11 | use App\Services\ProjectServer; | 12 | use App\Services\ProjectServer; |
| 12 | use Carbon\Carbon; | 13 | use Carbon\Carbon; |
| 13 | use Illuminate\Support\Facades\DB; | 14 | use Illuminate\Support\Facades\DB; |
| @@ -85,8 +86,14 @@ class MonthCountLogic extends BaseLogic | @@ -85,8 +86,14 @@ class MonthCountLogic extends BaseLogic | ||
| 85 | * @time :2023/7/4 10:19 | 86 | * @time :2023/7/4 10:19 |
| 86 | */ | 87 | */ |
| 87 | public function getKeywordLists(){ | 88 | public function getKeywordLists(){ |
| 88 | - $optimizeModel = new DeployOptimize(); | ||
| 89 | - $info = $optimizeModel->read(['project_id'=>$this->user['project_id']],['main_keywords','customer_keywords']); | 89 | + $projectKeywordModel = new ProjectKeyword(); |
| 90 | + $info = $projectKeywordModel->read(['project_id'=>$this->user['project_id']],['main_keyword','customer_keywords']); | ||
| 91 | + if($info === false){ | ||
| 92 | + $info = [ | ||
| 93 | + 'main_keyword'=>'', | ||
| 94 | + 'customer_keywords'=>'' | ||
| 95 | + ]; | ||
| 96 | + } | ||
| 90 | return $this->success($info); | 97 | return $this->success($info); |
| 91 | } | 98 | } |
| 92 | } | 99 | } |
| @@ -462,7 +462,7 @@ class NewsLogic extends BaseLogic | @@ -462,7 +462,7 @@ class NewsLogic extends BaseLogic | ||
| 462 | public function copyNewsInfo(){ | 462 | public function copyNewsInfo(){ |
| 463 | $info = $this->model->read(['id'=>$this->param['id']]); | 463 | $info = $this->model->read(['id'=>$this->param['id']]); |
| 464 | $param = [ | 464 | $param = [ |
| 465 | - 'name'=>$info['name']."-copy", | 465 | + 'name'=>$info['name']."-1", |
| 466 | 'status'=>0, | 466 | 'status'=>0, |
| 467 | 'sort'=>$info['sort'], | 467 | 'sort'=>$info['sort'], |
| 468 | 'category_id'=>$info['category_id'], | 468 | 'category_id'=>$info['category_id'], |
| @@ -127,6 +127,9 @@ class KeywordLogic extends BaseLogic | @@ -127,6 +127,9 @@ class KeywordLogic extends BaseLogic | ||
| 127 | if(!empty($param['related_blog_ids'])){ | 127 | if(!empty($param['related_blog_ids'])){ |
| 128 | $param['related_blog_ids'] = Arr::arrToSet($param['related_blog_ids'] ?? []); | 128 | $param['related_blog_ids'] = Arr::arrToSet($param['related_blog_ids'] ?? []); |
| 129 | } | 129 | } |
| 130 | + if(!isset($param['is_video_keyword']) || $param['is_video_keyword'] == null){ | ||
| 131 | + $param['is_video_keyword'] = 0; | ||
| 132 | + } | ||
| 130 | return $param; | 133 | return $param; |
| 131 | } | 134 | } |
| 132 | 135 |
| @@ -299,12 +299,14 @@ class ProductLogic extends BaseLogic | @@ -299,12 +299,14 @@ class ProductLogic extends BaseLogic | ||
| 299 | } | 299 | } |
| 300 | if(isset($param['keyword_id']) && !empty($param['keyword_id'])){ | 300 | if(isset($param['keyword_id']) && !empty($param['keyword_id'])){ |
| 301 | $param['keyword_id'] = ','.Arr::arrToSet($param['keyword_id']).','; | 301 | $param['keyword_id'] = ','.Arr::arrToSet($param['keyword_id']).','; |
| 302 | + }else{ | ||
| 303 | + $param['keyword_id'] = ''; | ||
| 302 | } | 304 | } |
| 303 | $param['attrs'] = Arr::a2s($param['attrs'] ?? []); | 305 | $param['attrs'] = Arr::a2s($param['attrs'] ?? []); |
| 304 | $param['attr_id'] = Arr::arrToSet($param['attr_id'] ?? ''); | 306 | $param['attr_id'] = Arr::arrToSet($param['attr_id'] ?? ''); |
| 305 | $param['describe'] = Arr::a2s($param['describe'] ?? []); | 307 | $param['describe'] = Arr::a2s($param['describe'] ?? []); |
| 306 | $param['describe_id'] = Arr::arrToSet($param['describe_id'] ?? ''); | 308 | $param['describe_id'] = Arr::arrToSet($param['describe_id'] ?? ''); |
| 307 | - $param['seo_mate'] = Arr::a2s($param['seo_mate'] ?? ''); | 309 | + $param['seo_mate'] = Arr::a2s($param['seo_mate'] ?? []); |
| 308 | $param['related_product_id'] = Arr::arrToSet($param['related_product_id'] ?? ''); | 310 | $param['related_product_id'] = Arr::arrToSet($param['related_product_id'] ?? ''); |
| 309 | if(isset($param['icon'])){ | 311 | if(isset($param['icon'])){ |
| 310 | foreach ($param['icon'] as $k1 => $v1){ | 312 | foreach ($param['icon'] as $k1 => $v1){ |
| @@ -395,7 +397,11 @@ class ProductLogic extends BaseLogic | @@ -395,7 +397,11 @@ class ProductLogic extends BaseLogic | ||
| 395 | foreach ($data as $k => $v){ | 397 | foreach ($data as $k => $v){ |
| 396 | $map = []; | 398 | $map = []; |
| 397 | $cateModel = new Category(); | 399 | $cateModel = new Category(); |
| 398 | - $cateList = $cateModel->list(['status'=>1],'id',['id','pid']); | 400 | + $status = []; |
| 401 | + if($v != 3){ | ||
| 402 | + $status = ['status'=>$v]; | ||
| 403 | + } | ||
| 404 | + $cateList = $cateModel->list($status,'id',['id','pid']); | ||
| 399 | $this->param['featured_status'] = $this->param['featured_status'] ?? 0; | 405 | $this->param['featured_status'] = $this->param['featured_status'] ?? 0; |
| 400 | if(!empty($cateList) && ($this->param['featured_status'] != $cateModel::STATUS_ACTIVE)){ | 406 | if(!empty($cateList) && ($this->param['featured_status'] != $cateModel::STATUS_ACTIVE)){ |
| 401 | $featured_ids = $cateModel->where('title', 'like', 'Featured%')->pluck('id')->toArray(); | 407 | $featured_ids = $cateModel->where('title', 'like', 'Featured%')->pluck('id')->toArray(); |
| @@ -406,8 +412,8 @@ class ProductLogic extends BaseLogic | @@ -406,8 +412,8 @@ class ProductLogic extends BaseLogic | ||
| 406 | } | 412 | } |
| 407 | if(!empty($featured_arr)){ | 413 | if(!empty($featured_arr)){ |
| 408 | $cateRelated = new CategoryRelated(); | 414 | $cateRelated = new CategoryRelated(); |
| 409 | - $product_ids = $cateRelated->whereNotIn('cate_id',$featured_arr)->pluck('product_id')->unique()->toArray(); | ||
| 410 | - $map['id'] = ['in',$product_ids]; | 415 | + $product_ids = $cateRelated->whereIn('cate_id',$featured_arr)->pluck('product_id')->unique()->toArray(); |
| 416 | + $map['id'] = ['not in',$product_ids]; | ||
| 411 | } | 417 | } |
| 412 | } | 418 | } |
| 413 | if($v == 3){ | 419 | if($v == 3){ |
| @@ -430,16 +436,51 @@ class ProductLogic extends BaseLogic | @@ -430,16 +436,51 @@ class ProductLogic extends BaseLogic | ||
| 430 | public function setCopyProduct(){ | 436 | public function setCopyProduct(){ |
| 431 | $info = $this->model->read(['id'=>$this->param['id']]); | 437 | $info = $this->model->read(['id'=>$this->param['id']]); |
| 432 | $param = $this->setProductParams($info); | 438 | $param = $this->setProductParams($info); |
| 433 | - $save_id = $this->model->insertGetId($param); | ||
| 434 | - $route = preg_replace('/-product.*/', '', $param['route']); | ||
| 435 | - $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT, $save_id, $this->user['project_id']); | ||
| 436 | - $this->model->edit(['route'=>$route],['id'=>$save_id]); | ||
| 437 | - //同步可视化装修数据 | ||
| 438 | - $this->copyTemplate($this->param['id'],$info['project_id'],$save_id); | 439 | + DB::beginTransaction(); |
| 440 | + try { | ||
| 441 | + $save_id = $this->model->insertGetId($param); | ||
| 442 | + CategoryRelated::saveRelated($save_id, $info['category_id']); | ||
| 443 | + $route = preg_replace('/-product.*/', '', $param['route']); | ||
| 444 | + //同步分类关联表 | ||
| 445 | + $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT, $save_id, $this->user['project_id']); | ||
| 446 | + $this->model->edit(['route'=>$route],['id'=>$save_id]); | ||
| 447 | + //同步可视化装修数据 | ||
| 448 | + $this->copyTemplate($this->param['id'],$info['project_id'],$save_id); | ||
| 449 | + //同步扩展字段 | ||
| 450 | + $this->copyExtendInfo($info['id'],$save_id); | ||
| 451 | + DB::commit(); | ||
| 452 | + }catch (\Exception $e){ | ||
| 453 | + DB::rollBack(); | ||
| 454 | + $this->fail('复制失败,请联系管理员'); | ||
| 455 | + } | ||
| 439 | return $this->success(['id'=>$save_id]); | 456 | return $this->success(['id'=>$save_id]); |
| 440 | } | 457 | } |
| 441 | 458 | ||
| 442 | /** | 459 | /** |
| 460 | + * @remark :复制项目扩展字段 | ||
| 461 | + * @name :copyExtendInfo | ||
| 462 | + * @author :lyh | ||
| 463 | + * @method :post | ||
| 464 | + * @time :2024/7/12 9:23 | ||
| 465 | + */ | ||
| 466 | + public function copyExtendInfo($old_id,$new_id){ | ||
| 467 | + $extendInfoModel = new ExtendInfo(); | ||
| 468 | + $extendList = $extendInfoModel->list(['product_id'=>$old_id],'created_at'); | ||
| 469 | + if(!empty($extendList)){ | ||
| 470 | + $data = []; | ||
| 471 | + foreach ($extendList as $k => $v){ | ||
| 472 | + unset($v['id']); | ||
| 473 | + $v['product_id'] = $new_id; | ||
| 474 | + $v['created_at'] = date('Y-m-d H:i:s'); | ||
| 475 | + $v['updated_at'] = date('Y-m-d H:i:s'); | ||
| 476 | + $data[] = $v; | ||
| 477 | + } | ||
| 478 | + return $extendInfoModel->insert($data); | ||
| 479 | + } | ||
| 480 | + return $this->success(); | ||
| 481 | + } | ||
| 482 | + | ||
| 483 | + /** | ||
| 443 | * @remark :同步模版数据 | 484 | * @remark :同步模版数据 |
| 444 | * @name :copyTemplate | 485 | * @name :copyTemplate |
| 445 | * @author :lyh | 486 | * @author :lyh |
| @@ -498,7 +539,7 @@ class ProductLogic extends BaseLogic | @@ -498,7 +539,7 @@ class ProductLogic extends BaseLogic | ||
| 498 | public function setProductParams($info){ | 539 | public function setProductParams($info){ |
| 499 | $param = [ | 540 | $param = [ |
| 500 | 'project_id'=>$info['project_id'], | 541 | 'project_id'=>$info['project_id'], |
| 501 | - 'title'=>$info['title']."-copy", | 542 | + 'title'=>$info['title']."-1", |
| 502 | 'attrs'=>Arr::a2s($info['attrs']), | 543 | 'attrs'=>Arr::a2s($info['attrs']), |
| 503 | 'attr_id'=>Arr::arrToSet($info['attr_id']), | 544 | 'attr_id'=>Arr::arrToSet($info['attr_id']), |
| 504 | 'category_id'=>!empty($info['category_id']) ? ','.Arr::arrToSet($info['category_id']).',' : '', | 545 | 'category_id'=>!empty($info['category_id']) ? ','.Arr::arrToSet($info['category_id']).',' : '', |
| @@ -860,16 +901,16 @@ class ProductLogic extends BaseLogic | @@ -860,16 +901,16 @@ class ProductLogic extends BaseLogic | ||
| 860 | */ | 901 | */ |
| 861 | public function getSearchCategoryList() | 902 | public function getSearchCategoryList() |
| 862 | { | 903 | { |
| 904 | + $data = []; | ||
| 863 | $categoryModel = new Category(); | 905 | $categoryModel = new Category(); |
| 864 | $this->param['deleted_at'] = null; | 906 | $this->param['deleted_at'] = null; |
| 865 | $this->param['featured_status'] = $this->param['featured_status'] ?? 0; | 907 | $this->param['featured_status'] = $this->param['featured_status'] ?? 0; |
| 866 | if(($this->param['featured_status'] != Category::STATUS_ACTIVE)) { | 908 | if(($this->param['featured_status'] != Category::STATUS_ACTIVE)) { |
| 867 | - $this->param['title'] = ['not like','%Featured%']; | 909 | + $this->param['title'] = ['not like','Featured%']; |
| 868 | } | 910 | } |
| 869 | unset($this->param['featured_status']); | 911 | unset($this->param['featured_status']); |
| 870 | $list = $categoryModel->list($this->param, ['sort', 'id'], ['id', 'pid', 'title']); | 912 | $list = $categoryModel->list($this->param, ['sort', 'id'], ['id', 'pid', 'title']); |
| 871 | if (!empty($list)) { | 913 | if (!empty($list)) { |
| 872 | - $data = []; | ||
| 873 | foreach ($list as $v) { | 914 | foreach ($list as $v) { |
| 874 | $v = (array)$v; | 915 | $v = (array)$v; |
| 875 | if ($v['pid'] == 0) { | 916 | if ($v['pid'] == 0) { |
| @@ -34,7 +34,7 @@ class RatingLogic extends BaseLogic | @@ -34,7 +34,7 @@ class RatingLogic extends BaseLogic | ||
| 34 | */ | 34 | */ |
| 35 | public function getRatingRead(){ | 35 | public function getRatingRead(){ |
| 36 | $data = [ | 36 | $data = [ |
| 37 | - 'company'=>$this->project['company'], | 37 | + 'company'=>$this->project['company'] ?? '', |
| 38 | 'mobile'=>$this->user['mobile'], | 38 | 'mobile'=>$this->user['mobile'], |
| 39 | 'uptime'=>$this->project['uptime'], | 39 | 'uptime'=>$this->project['uptime'], |
| 40 | 'domain'=>$this->user['domain'], | 40 | 'domain'=>$this->user['domain'], |
| @@ -80,6 +80,9 @@ class TranslateLogic extends BaseLogic | @@ -80,6 +80,9 @@ class TranslateLogic extends BaseLogic | ||
| 80 | if(!empty($arr2)){ | 80 | if(!empty($arr2)){ |
| 81 | $i = 0; | 81 | $i = 0; |
| 82 | TranslateText: | 82 | TranslateText: |
| 83 | + if($languageInfo['short'] == 'zh-ct'){ | ||
| 84 | + $languageInfo['short'] = 'zh-TW'; | ||
| 85 | + } | ||
| 83 | $translate_list = Translate::tran($arr2, $languageInfo['short']); | 86 | $translate_list = Translate::tran($arr2, $languageInfo['short']); |
| 84 | if(empty($translate_list)){ | 87 | if(empty($translate_list)){ |
| 85 | if ($i < 3) { | 88 | if ($i < 3) { |
| @@ -313,7 +316,7 @@ class TranslateLogic extends BaseLogic | @@ -313,7 +316,7 @@ class TranslateLogic extends BaseLogic | ||
| 313 | if(strtolower($route) == 'all'){ | 316 | if(strtolower($route) == 'all'){ |
| 314 | return $this->success($data); | 317 | return $this->success($data); |
| 315 | } | 318 | } |
| 316 | - if($route == 'index'){ | 319 | + if($route == 'index' || $route == '/'){ |
| 317 | $data['source'] = 1; | 320 | $data['source'] = 1; |
| 318 | return $this->success($data); | 321 | return $this->success($data); |
| 319 | } | 322 | } |
| @@ -177,6 +177,7 @@ class UserLoginLogic | @@ -177,6 +177,7 @@ class UserLoginLogic | ||
| 177 | $info['project_location'] = $project['project_location']; | 177 | $info['project_location'] = $project['project_location']; |
| 178 | $info['is_update_language'] = $project['is_update_language']; | 178 | $info['is_update_language'] = $project['is_update_language']; |
| 179 | $info['configuration'] = $project['deploy_build']['configuration']; | 179 | $info['configuration'] = $project['deploy_build']['configuration']; |
| 180 | + $info['file_cdn'] = $project['deploy_build']['file_cdn']; | ||
| 180 | $info['project_type'] = $project['type']; | 181 | $info['project_type'] = $project['type']; |
| 181 | $info['service_duration'] = $project['deploy_build']['service_duration']; | 182 | $info['service_duration'] = $project['deploy_build']['service_duration']; |
| 182 | $info['remain_day'] = $project['remain_day']; | 183 | $info['remain_day'] = $project['remain_day']; |
| @@ -279,6 +280,7 @@ class UserLoginLogic | @@ -279,6 +280,7 @@ class UserLoginLogic | ||
| 279 | $info['project_type'] = $project['type']; | 280 | $info['project_type'] = $project['type']; |
| 280 | $info['storage_type'] = $project['storage_type']; | 281 | $info['storage_type'] = $project['storage_type']; |
| 281 | $info['project_location'] = $project['project_location']; | 282 | $info['project_location'] = $project['project_location']; |
| 283 | + $info['file_cdn'] = $project['deploy_build']['file_cdn']; | ||
| 282 | $info['service_duration'] = $project['deploy_build']['service_duration'] ?? 0; | 284 | $info['service_duration'] = $project['deploy_build']['service_duration'] ?? 0; |
| 283 | $info['remain_day'] = $project['remain_day'] ?? 0; | 285 | $info['remain_day'] = $project['remain_day'] ?? 0; |
| 284 | if($info['is_customized'] == 1){ | 286 | if($info['is_customized'] == 1){ |
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :ManagerHrRequest.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2024/7/10 15:59 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Http\Requests\Aside\Manage; | ||
| 11 | +use App\Models\Manage\Manage; | ||
| 12 | +use App\Rules\Mobile; | ||
| 13 | +use Illuminate\Foundation\Http\FormRequest; | ||
| 14 | +use Illuminate\Validation\Rule; | ||
| 15 | + | ||
| 16 | +class ManagerHrRequest extends FormRequest | ||
| 17 | +{ | ||
| 18 | + /** | ||
| 19 | + * Determine if the user is authorized to make this request. | ||
| 20 | + * | ||
| 21 | + * @return bool | ||
| 22 | + */ | ||
| 23 | + public function authorize() | ||
| 24 | + { | ||
| 25 | + return true; | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + /** | ||
| 29 | + * Get the validation rules that apply to the request. | ||
| 30 | + * | ||
| 31 | + * @return array | ||
| 32 | + */ | ||
| 33 | + public function rules() | ||
| 34 | + { | ||
| 35 | + return [ | ||
| 36 | + 'name'=>'required', | ||
| 37 | + 'mobile'=>'required', | ||
| 38 | +// 'status'=>'required', | ||
| 39 | +// 'education'=>'required', | ||
| 40 | +// 'entry_position'=>'required', | ||
| 41 | +// 'p_level'=>'required', | ||
| 42 | +// 'dept_id'=>'required', | ||
| 43 | +// 'belong_group'=>'required', | ||
| 44 | + ]; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + public function messages() | ||
| 48 | + { | ||
| 49 | + return [ | ||
| 50 | + 'name.required' => '名称不能为空', | ||
| 51 | + 'mobile.required' => '手机号码不能为空', | ||
| 52 | +// 'status.required' => '请选择用户状态', | ||
| 53 | +// 'education.required' => '请选择学历', | ||
| 54 | +// 'entry_position.required' => '请选择入职岗位', | ||
| 55 | +// 'belong_group.required' => '请选择小组', | ||
| 56 | +// 'p_level.required' => '请选择入职岗位级别', | ||
| 57 | +// 'dept_id.required' => '请选择部门', | ||
| 58 | + ]; | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | +} |
| @@ -26,7 +26,9 @@ class BlogRequest extends FormRequest | @@ -26,7 +26,9 @@ class BlogRequest extends FormRequest | ||
| 26 | return [ | 26 | return [ |
| 27 | 'name'=>'required|max:200', | 27 | 'name'=>'required|max:200', |
| 28 | 'seo_keywords'=>'max:500', | 28 | 'seo_keywords'=>'max:500', |
| 29 | + 'remark'=>'max:1000', | ||
| 29 | 'url'=>'required', | 30 | 'url'=>'required', |
| 31 | +// 'text'=>'max:5000', | ||
| 30 | ]; | 32 | ]; |
| 31 | } | 33 | } |
| 32 | 34 | ||
| @@ -36,7 +38,9 @@ class BlogRequest extends FormRequest | @@ -36,7 +38,9 @@ class BlogRequest extends FormRequest | ||
| 36 | 'name.required'=>'请填写名称', | 38 | 'name.required'=>'请填写名称', |
| 37 | 'name.max'=>'名称超过最长长度200', | 39 | 'name.max'=>'名称超过最长长度200', |
| 38 | 'url.required'=>'链接不能为空', | 40 | 'url.required'=>'链接不能为空', |
| 39 | - 'seo_keywords.max'=>'seo_keywords太长,请重新编辑' | 41 | + 'seo_keywords.max'=>'seo_keywords太长,请重新编辑', |
| 42 | + 'remark.max'=>'描述超过最长长度1000', | ||
| 43 | +// 'text.max'=>'详情内容超过最大长度', | ||
| 40 | ]; | 44 | ]; |
| 41 | } | 45 | } |
| 42 | } | 46 | } |
| @@ -25,7 +25,7 @@ class NewsRequest extends FormRequest | @@ -25,7 +25,7 @@ class NewsRequest extends FormRequest | ||
| 25 | { | 25 | { |
| 26 | return [ | 26 | return [ |
| 27 | 'name'=>'required|max:200', | 27 | 'name'=>'required|max:200', |
| 28 | -// 'remark'=>'max:500', | 28 | + 'remark'=>'max:1000', |
| 29 | 'url'=>'required', | 29 | 'url'=>'required', |
| 30 | ]; | 30 | ]; |
| 31 | } | 31 | } |
| @@ -36,7 +36,7 @@ class NewsRequest extends FormRequest | @@ -36,7 +36,7 @@ class NewsRequest 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 | + 'remark.max'=>'描述超过最长长度1000' |
| 40 | ]; | 40 | ]; |
| 41 | } | 41 | } |
| 42 | } | 42 | } |
| @@ -67,7 +67,8 @@ class EditAmpDomainBt implements ShouldQueue | @@ -67,7 +67,8 @@ class EditAmpDomainBt implements ShouldQueue | ||
| 67 | $api_param_amp = [ | 67 | $api_param_amp = [ |
| 68 | 'domain' => $domain_info['domain'], | 68 | 'domain' => $domain_info['domain'], |
| 69 | 'not_allow_country' => $domain_info['not_allow_country'], | 69 | 'not_allow_country' => $domain_info['not_allow_country'], |
| 70 | - 'not_allow_ip' => $domain_info['not_allow_ip'] | 70 | + 'not_allow_ip' => $domain_info['not_allow_ip'], |
| 71 | + 'is_redirect' => $domain_info['is_redirect'] | ||
| 71 | ]; | 72 | ]; |
| 72 | if ($domain_info['amp_type'] == 2) { | 73 | if ($domain_info['amp_type'] == 2) { |
| 73 | $api_param_amp['private_key'] = $domain_info['amp_private_key']; | 74 | $api_param_amp['private_key'] = $domain_info['amp_private_key']; |
| @@ -74,7 +74,8 @@ class EditDomainBt implements ShouldQueue | @@ -74,7 +74,8 @@ class EditDomainBt implements ShouldQueue | ||
| 74 | 'other_domain' => $domain_info['other_domain'], | 74 | 'other_domain' => $domain_info['other_domain'], |
| 75 | 'is_https' => $domain_info['is_https'], | 75 | 'is_https' => $domain_info['is_https'], |
| 76 | 'not_allow_country' => $domain_info['not_allow_country'], | 76 | 'not_allow_country' => $domain_info['not_allow_country'], |
| 77 | - 'not_allow_ip' => $domain_info['not_allow_ip'] | 77 | + 'not_allow_ip' => $domain_info['not_allow_ip'], |
| 78 | + 'is_redirect' => $domain_info['is_redirect'] | ||
| 78 | ]; | 79 | ]; |
| 79 | } else { | 80 | } else { |
| 80 | $api_url = 'http://' . $server_info['domain'] . '/api/applySsl'; | 81 | $api_url = 'http://' . $server_info['domain'] . '/api/applySsl'; |
| @@ -84,7 +85,8 @@ class EditDomainBt implements ShouldQueue | @@ -84,7 +85,8 @@ class EditDomainBt implements ShouldQueue | ||
| 84 | 'other_domain' => $domain_info['other_domain'], | 85 | 'other_domain' => $domain_info['other_domain'], |
| 85 | 'is_https' => $domain_info['is_https'], | 86 | 'is_https' => $domain_info['is_https'], |
| 86 | 'not_allow_country' => $domain_info['not_allow_country'], | 87 | 'not_allow_country' => $domain_info['not_allow_country'], |
| 87 | - 'not_allow_ip' => $domain_info['not_allow_ip'] | 88 | + 'not_allow_ip' => $domain_info['not_allow_ip'], |
| 89 | + 'is_redirect' => $domain_info['is_redirect'] | ||
| 88 | ]; | 90 | ]; |
| 89 | } | 91 | } |
| 90 | 92 |
| @@ -274,4 +274,15 @@ class Base extends Model | @@ -274,4 +274,15 @@ class Base extends Model | ||
| 274 | }, ARRAY_FILTER_USE_KEY); | 274 | }, ARRAY_FILTER_USE_KEY); |
| 275 | } | 275 | } |
| 276 | 276 | ||
| 277 | + /** | ||
| 278 | + * @remark :查询一个字段返回数组 | ||
| 279 | + * @name :selectField | ||
| 280 | + * @author :lyh | ||
| 281 | + * @method :post | ||
| 282 | + * @time :2024/7/15 17:11 | ||
| 283 | + */ | ||
| 284 | + public function selectField($data,$filed){ | ||
| 285 | + $data = $this->filterRequestData($data); | ||
| 286 | + return $this->formatQuery($data)->pluck($filed)->toArray(); | ||
| 287 | + } | ||
| 277 | } | 288 | } |
| @@ -10,6 +10,8 @@ | @@ -10,6 +10,8 @@ | ||
| 10 | namespace App\Models\Com; | 10 | namespace App\Models\Com; |
| 11 | 11 | ||
| 12 | use App\Models\Base; | 12 | use App\Models\Base; |
| 13 | +use Illuminate\Support\Carbon; | ||
| 14 | +use Illuminate\Support\Facades\Cache; | ||
| 13 | 15 | ||
| 14 | class KeywordVideoTaskLog extends Base | 16 | class KeywordVideoTaskLog extends Base |
| 15 | { | 17 | { |
| @@ -19,4 +21,26 @@ class KeywordVideoTaskLog extends Base | @@ -19,4 +21,26 @@ class KeywordVideoTaskLog extends Base | ||
| 19 | const STATUS_ERROR = 3; | 21 | const STATUS_ERROR = 3; |
| 20 | 22 | ||
| 21 | protected $table = 'gl_keyword_video_task_log'; | 23 | protected $table = 'gl_keyword_video_task_log'; |
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 获取当月视频生成数量 | ||
| 27 | + * FIXME 混剪视频订阅计划 50000/m | ||
| 28 | + * @return mixed | ||
| 29 | + */ | ||
| 30 | + public static function getMonthVideoNum() | ||
| 31 | + { | ||
| 32 | + $key = 'video_keyword_number_month'; | ||
| 33 | + $num = Cache::get($key, function () use ($key) { | ||
| 34 | + $this_day = date('d'); | ||
| 35 | + if($this_day >= 13) { | ||
| 36 | + $start_date = Carbon::now()->day(13)->format('Y-m-d 00:00:00'); | ||
| 37 | + } else { | ||
| 38 | + $start_date = Carbon::now()->subMonth()->day(13)->format('Y-m-d 00:00:00'); | ||
| 39 | + } | ||
| 40 | + $num = self::where('created_at', '>', $start_date)->count(); | ||
| 41 | + Cache::put($key, $num, 3600); | ||
| 42 | + return $num; | ||
| 43 | + }); | ||
| 44 | + return $num; | ||
| 45 | + } | ||
| 22 | } | 46 | } |
| @@ -14,6 +14,7 @@ class Notify extends Base | @@ -14,6 +14,7 @@ class Notify extends Base | ||
| 14 | const STATUS_FINISH_ROUTE = 1; | 14 | const STATUS_FINISH_ROUTE = 1; |
| 15 | const STATUS_FINISH_PAGE = 2; | 15 | const STATUS_FINISH_PAGE = 2; |
| 16 | const STATUS_FINISH_SITEMAP = 3; | 16 | const STATUS_FINISH_SITEMAP = 3; |
| 17 | + const STATUS_ING_SITEMAP = 4; | ||
| 17 | const STATUS_ERROR = 9; | 18 | const STATUS_ERROR = 9; |
| 18 | 19 | ||
| 19 | /** | 20 | /** |
| @@ -75,11 +76,12 @@ class Notify extends Base | @@ -75,11 +76,12 @@ class Notify extends Base | ||
| 75 | public static function statusMap() | 76 | public static function statusMap() |
| 76 | { | 77 | { |
| 77 | return [ | 78 | return [ |
| 78 | - self::STATUS_INIT => '排队中', | 79 | + self::STATUS_INIT => '页面排队中', |
| 79 | self::STATUS_FINISH_ROUTE => '页面生成中', | 80 | self::STATUS_FINISH_ROUTE => '页面生成中', |
| 80 | - self::STATUS_FINISH_PAGE => 'sitemap生成中', | 81 | + self::STATUS_FINISH_PAGE => 'sitemap排队中', |
| 82 | + self::STATUS_ING_SITEMAP => 'sitemap生成中', | ||
| 81 | self::STATUS_FINISH_SITEMAP => '完成', | 83 | self::STATUS_FINISH_SITEMAP => '完成', |
| 82 | - self::STATUS_ERROR => 'sitemap生成失败', | 84 | + self::STATUS_ERROR => '失败', |
| 83 | ]; | 85 | ]; |
| 84 | } | 86 | } |
| 85 | } | 87 | } |
| @@ -16,6 +16,7 @@ class Keyword extends Base | @@ -16,6 +16,7 @@ class Keyword extends Base | ||
| 16 | //连接数据库 | 16 | //连接数据库 |
| 17 | protected $connection = 'custom_mysql'; | 17 | protected $connection = 'custom_mysql'; |
| 18 | 18 | ||
| 19 | + const STATUS_ACTIVE = 1; | ||
| 19 | /** | 20 | /** |
| 20 | * @remark :视频 | 21 | * @remark :视频 |
| 21 | * @name :getKeywordVideoAttribute | 22 | * @name :getKeywordVideoAttribute |
| @@ -231,7 +231,17 @@ class Project extends Base | @@ -231,7 +231,17 @@ class Project extends Base | ||
| 231 | return self::hasOne(After::class, 'project_id', 'id'); | 231 | return self::hasOne(After::class, 'project_id', 'id'); |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | - | 234 | + /** |
| 235 | + * @remark :项目关键字 | ||
| 236 | + * @name :project_keyword | ||
| 237 | + * @author :lyh | ||
| 238 | + * @method :post | ||
| 239 | + * @time :2024/7/22 11:38 | ||
| 240 | + */ | ||
| 241 | + public function project_keyword() | ||
| 242 | + { | ||
| 243 | + return self::hasOne(ProjectKeyword::class, 'project_id', 'id'); | ||
| 244 | + } | ||
| 235 | /** | 245 | /** |
| 236 | * 询盘过滤配置 | 246 | * 询盘过滤配置 |
| 237 | * @return \Illuminate\Database\Eloquent\Relations\HasOne | 247 | * @return \Illuminate\Database\Eloquent\Relations\HasOne |
app/Models/Project/ProjectKeyword.php
0 → 100644
| 1 | +<?php | ||
| 2 | +/** | ||
| 3 | + * @remark : | ||
| 4 | + * @name :ProjectKeyword.php | ||
| 5 | + * @author :lyh | ||
| 6 | + * @method :post | ||
| 7 | + * @time :2024/7/22 11:35 | ||
| 8 | + */ | ||
| 9 | + | ||
| 10 | +namespace App\Models\Project; | ||
| 11 | + | ||
| 12 | +use App\Models\Base; | ||
| 13 | + | ||
| 14 | +class ProjectKeyword extends Base | ||
| 15 | +{ | ||
| 16 | + //设置关联表名 | ||
| 17 | + protected $table = 'gl_project_keyword'; | ||
| 18 | +} |
| @@ -9,10 +9,10 @@ use Illuminate\Support\Facades\Route; | @@ -9,10 +9,10 @@ use Illuminate\Support\Facades\Route; | ||
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | Route::middleware(['aloginauth'])->group(function () { | 11 | Route::middleware(['aloginauth'])->group(function () { |
| 12 | - Route::get('/', [Aside\Com\IndexController::class, 'index'])->name('admin.home.white'); | ||
| 13 | - Route::get('/get_menu', [Aside\Com\IndexController::class, 'get_menu'])->name('admin.get_menu.white'); | 12 | + Route::any('/', [Aside\Com\IndexController::class, 'index'])->name('admin.home.white'); |
| 13 | + Route::any('/get_menu', [Aside\Com\IndexController::class, 'get_menu'])->name('admin.get_menu.white'); | ||
| 14 | Route::any('/editPassword', [Aside\Com\IndexController::class, 'editPassword'])->name('admin.editPassword.white'); | 14 | Route::any('/editPassword', [Aside\Com\IndexController::class, 'editPassword'])->name('admin.editPassword.white'); |
| 15 | - Route::get('/logout', [Aside\LoginController::class, 'logout'])->name('admin.logout.white'); | 15 | + Route::any('/logout', [Aside\LoginController::class, 'logout'])->name('admin.logout.white'); |
| 16 | Route::any('/getAccessAddress', [Aside\LoginController::class, 'getAccessAddress'])->name('admin.getAccessAddress');//获取B端地址 | 16 | Route::any('/getAccessAddress', [Aside\LoginController::class, 'getAccessAddress'])->name('admin.getAccessAddress');//获取B端地址 |
| 17 | Route::any('/sendNotify', [Aside\Com\CNoticeController::class, 'sendNotify'])->name('admin.sendNotify'); | 17 | Route::any('/sendNotify', [Aside\Com\CNoticeController::class, 'sendNotify'])->name('admin.sendNotify'); |
| 18 | Route::any('/getCountry', [Aside\Com\CNoticeController::class, 'getCountry'])->name('admin.getCountry'); | 18 | Route::any('/getCountry', [Aside\Com\CNoticeController::class, 'getCountry'])->name('admin.getCountry'); |
| @@ -106,8 +106,8 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -106,8 +106,8 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 106 | 106 | ||
| 107 | //菜单 | 107 | //菜单 |
| 108 | Route::prefix('menu')->group(function () { | 108 | Route::prefix('menu')->group(function () { |
| 109 | - Route::get('/', [Aside\Manage\MenuController::class, 'list'])->name('admin.menu'); | ||
| 110 | - Route::get('/info', [Aside\Manage\MenuController::class, 'info'])->name('admin.menu_info'); | 109 | + Route::any('/', [Aside\Manage\MenuController::class, 'list'])->name('admin.menu'); |
| 110 | + Route::any('/info', [Aside\Manage\MenuController::class, 'info'])->name('admin.menu_info'); | ||
| 111 | Route::post('/save', [Aside\Manage\MenuController::class, 'save'])->name('admin.menu_save'); | 111 | Route::post('/save', [Aside\Manage\MenuController::class, 'save'])->name('admin.menu_save'); |
| 112 | Route::any('/delete', [Aside\Manage\MenuController::class, 'delete'])->name('admin.menu_delete'); | 112 | Route::any('/delete', [Aside\Manage\MenuController::class, 'delete'])->name('admin.menu_delete'); |
| 113 | Route::any('/sort', [Aside\Manage\MenuController::class, 'setSort'])->name('admin.menu_sort'); | 113 | Route::any('/sort', [Aside\Manage\MenuController::class, 'setSort'])->name('admin.menu_sort'); |
| @@ -122,27 +122,27 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -122,27 +122,27 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 122 | }); | 122 | }); |
| 123 | //权限组 | 123 | //权限组 |
| 124 | Route::prefix('group')->group(function () { | 124 | Route::prefix('group')->group(function () { |
| 125 | - Route::get('/', [Aside\Manage\GroupController::class, 'list'])->name('admin.group'); | ||
| 126 | - Route::get('/info', [Aside\Manage\GroupController::class, 'info'])->name('admin.group_info'); | 125 | + Route::any('/', [Aside\Manage\GroupController::class, 'list'])->name('admin.group'); |
| 126 | + Route::any('/info', [Aside\Manage\GroupController::class, 'info'])->name('admin.group_info'); | ||
| 127 | Route::post('/save', [Aside\Manage\GroupController::class, 'save'])->name('admin.group_save'); | 127 | Route::post('/save', [Aside\Manage\GroupController::class, 'save'])->name('admin.group_save'); |
| 128 | Route::any('/delete', [Aside\Manage\GroupController::class, 'delete'])->name('admin.group_delete'); | 128 | Route::any('/delete', [Aside\Manage\GroupController::class, 'delete'])->name('admin.group_delete'); |
| 129 | }); | 129 | }); |
| 130 | 130 | ||
| 131 | //部门 | 131 | //部门 |
| 132 | Route::prefix('dept')->group(function () { | 132 | Route::prefix('dept')->group(function () { |
| 133 | - Route::get('/', [Aside\Manage\DeptController::class, 'lists'])->name('admin.dept'); | ||
| 134 | - Route::get('/info', [Aside\Manage\DeptController::class, 'info'])->name('admin.dept_info'); | 133 | + Route::any('/', [Aside\Manage\DeptController::class, 'lists'])->name('admin.dept'); |
| 134 | + Route::any('/info', [Aside\Manage\DeptController::class, 'info'])->name('admin.dept_info'); | ||
| 135 | Route::post('/save', [Aside\Manage\DeptController::class, 'save'])->name('admin.dept_save'); | 135 | Route::post('/save', [Aside\Manage\DeptController::class, 'save'])->name('admin.dept_save'); |
| 136 | Route::any('/delete', [Aside\Manage\DeptController::class, 'delete'])->name('admin.dept_delete'); | 136 | Route::any('/delete', [Aside\Manage\DeptController::class, 'delete'])->name('admin.dept_delete'); |
| 137 | }); | 137 | }); |
| 138 | 138 | ||
| 139 | //人事管理 | 139 | //人事管理 |
| 140 | Route::prefix('hr')->group(function () { | 140 | Route::prefix('hr')->group(function () { |
| 141 | - Route::get('/', [Aside\Manage\HrController::class, 'list'])->name('admin.hr'); | ||
| 142 | - Route::get('/info', [Aside\Manage\HrController::class, 'info'])->name('admin.hr_info'); | 141 | + Route::any('/', [Aside\Manage\HrController::class, 'list'])->name('admin.hr'); |
| 142 | + Route::any('/info', [Aside\Manage\HrController::class, 'info'])->name('admin.hr_info'); | ||
| 143 | Route::post('/save', [Aside\Manage\HrController::class, 'save'])->name('admin.hr_save'); | 143 | Route::post('/save', [Aside\Manage\HrController::class, 'save'])->name('admin.hr_save'); |
| 144 | Route::post('/sort', [Aside\Manage\HrController::class, 'sort'])->name('admin.hr_sort'); | 144 | Route::post('/sort', [Aside\Manage\HrController::class, 'sort'])->name('admin.hr_sort'); |
| 145 | - Route::get('/getSearchParamsList', [Aside\Manage\HrController::class, 'getSearchParamsList'])->name('admin.hr_getSearchParamsList'); | 145 | + Route::any('/getSearchParamsList', [Aside\Manage\HrController::class, 'getSearchParamsList'])->name('admin.hr_getSearchParamsList'); |
| 146 | }); | 146 | }); |
| 147 | 147 | ||
| 148 | //管理员日志 | 148 | //管理员日志 |
| @@ -159,8 +159,8 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -159,8 +159,8 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 159 | 159 | ||
| 160 | //项目管理 | 160 | //项目管理 |
| 161 | Route::prefix('project')->group(function () { | 161 | Route::prefix('project')->group(function () { |
| 162 | - Route::get('/', [Aside\Project\ProjectController::class, 'lists'])->name('admin.project'); | ||
| 163 | - Route::get('/info', [Aside\Project\ProjectController::class, 'info'])->name('admin.project_info'); | 162 | + Route::any('/', [Aside\Project\ProjectController::class, 'lists'])->name('admin.project'); |
| 163 | + Route::any('/info', [Aside\Project\ProjectController::class, 'info'])->name('admin.project_info'); | ||
| 164 | Route::post('/save', [Aside\Project\ProjectController::class, 'save'])->name('admin.project_save'); | 164 | Route::post('/save', [Aside\Project\ProjectController::class, 'save'])->name('admin.project_save'); |
| 165 | Route::any('/deleteMinorLanguages', [Aside\Project\ProjectController::class, 'deleteMinorLanguages'])->name('admin.project_deleteMinorLanguages'); | 165 | Route::any('/deleteMinorLanguages', [Aside\Project\ProjectController::class, 'deleteMinorLanguages'])->name('admin.project_deleteMinorLanguages'); |
| 166 | Route::any('/inquiry_set', [Aside\Project\ProjectController::class, 'inquiry_set'])->name('admin.project_inquiry_set'); | 166 | Route::any('/inquiry_set', [Aside\Project\ProjectController::class, 'inquiry_set'])->name('admin.project_inquiry_set'); |
| @@ -220,8 +220,8 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -220,8 +220,8 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 220 | }); | 220 | }); |
| 221 | //工单管理 | 221 | //工单管理 |
| 222 | Route::prefix('task')->group(function () { | 222 | Route::prefix('task')->group(function () { |
| 223 | - Route::get('/', [Aside\Task\TaskController::class, 'list'])->name('admin.task'); | ||
| 224 | - Route::get('/info', [Aside\Task\TaskController::class, 'info'])->name('admin.task_info'); | 223 | + Route::any('/', [Aside\Task\TaskController::class, 'list'])->name('admin.task'); |
| 224 | + Route::any('/info', [Aside\Task\TaskController::class, 'info'])->name('admin.task_info'); | ||
| 225 | Route::post('/save', [Aside\Task\TaskController::class, 'save'])->name('admin.task_save'); | 225 | Route::post('/save', [Aside\Task\TaskController::class, 'save'])->name('admin.task_save'); |
| 226 | Route::post('/status', [Aside\Task\TaskController::class, 'status'])->name('admin.task_status'); | 226 | Route::post('/status', [Aside\Task\TaskController::class, 'status'])->name('admin.task_status'); |
| 227 | Route::post('/save_follow', [Aside\Task\TaskController::class, 'save_follow'])->name('admin.task_save_follow'); | 227 | Route::post('/save_follow', [Aside\Task\TaskController::class, 'save_follow'])->name('admin.task_save_follow'); |
| @@ -281,6 +281,7 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -281,6 +281,7 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 281 | Route::any('/setRobots', [Aside\Optimize\OptimizeController::class, 'setRobots'])->name('admin.optimize_setRobots');//设置robots开关 | 281 | Route::any('/setRobots', [Aside\Optimize\OptimizeController::class, 'setRobots'])->name('admin.optimize_setRobots');//设置robots开关 |
| 282 | Route::any('/editBacklink', [Aside\Optimize\OptimizeController::class, 'editBacklink'])->name('admin.optimize_editBacklink');//设置backlink开关 | 282 | Route::any('/editBacklink', [Aside\Optimize\OptimizeController::class, 'editBacklink'])->name('admin.optimize_editBacklink');//设置backlink开关 |
| 283 | Route::any('/setAiVideo', [Aside\Optimize\OptimizeController::class, 'setAiVideo'])->name('admin.optimize_setAiVideo');//设置backlink开关 | 283 | Route::any('/setAiVideo', [Aside\Optimize\OptimizeController::class, 'setAiVideo'])->name('admin.optimize_setAiVideo');//设置backlink开关 |
| 284 | + Route::any('/anchorTextList', [Aside\Optimize\OptimizeController::class, 'anchorTextList'])->name('admin.optimize_anchorTextList');//设置backlink开关 | ||
| 284 | Route::any('/editTranslateStatus', [Aside\Optimize\OptimizeController::class, 'editTranslateStatus'])->name('admin.optimize_editTranslateStatus');//设置robots开关 | 285 | Route::any('/editTranslateStatus', [Aside\Optimize\OptimizeController::class, 'editTranslateStatus'])->name('admin.optimize_editTranslateStatus');//设置robots开关 |
| 285 | }); | 286 | }); |
| 286 | //生成关键字 | 287 | //生成关键字 |
-
请 注册 或 登录 后发表评论