作者 赵彬吉
正在显示 69 个修改的文件 包含 682 行增加331 行删除
... ... @@ -44,9 +44,9 @@ class ShareUser extends Command
//获取所有ayr_share用户
$ayr_share_model = new AyrShareModel();
$ayr_release = new AyrReleaseModel();
$ayr_share_list = $ayr_share_model->list(['profile_key'=>['!=','']]);
$ayr_share_list = $ayr_share_model->list(['profile_key'=>['!=',''],'project_id'=>410]);
foreach ($ayr_share_list as $v){
$time = Carbon::now()->modify('-7 days')->toDateString();
$time = Carbon::now()->modify('-1 days')->toDateString();
//创建时间小于7天前的当前时间
if($v['created_at'] > $time){
continue;
... ...
... ... @@ -43,7 +43,7 @@ class Count extends Command
public function handle()
{
$list = DB::table('gl_project')->where('gl_project.extend_type','=',0)
->where('gl_project.type','!=',0)
->whereIn('gl_project.type',[1,2,3,4,6])
->leftJoin('gl_project_deploy_build', 'gl_project.id', '=', 'gl_project_deploy_build.project_id')
->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id')
->select($this->selectParam())->get();
... ...
... ... @@ -38,7 +38,7 @@ class CountAll extends Command
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['delete_status'=>0]);
$list = $projectModel->list(['delete_status'=>0,'type'=>['in',[1,2,3,4,6]]]);
foreach ($list as $v) {
echo date('Y-m-d H:i:s') . '项目id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
... ...
... ... @@ -10,6 +10,7 @@
namespace App\Console\Commands\DeleteTemplate;
use App\Models\Project\Project;
use App\Models\Template\BTemplateLog;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
... ... @@ -46,6 +47,7 @@ class TemplateLog extends Command
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
$this->deleteTemplate();
DB::disconnect('custom_mysql');
}
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
... ... @@ -59,6 +61,9 @@ class TemplateLog extends Command
* @time :2024/7/10 14:48
*/
public function deleteTemplate(){
$startDate = date("Y-m-01 00:00:00");
$endDate = date("Y-m-t 23:59:59");
$templateLogModel = new BTemplateLog();
return $templateLogModel->del(['created_at'=>['not between'=>[$startDate,$endDate]]]);
}
}
... ...
... ... @@ -153,7 +153,7 @@ class DomainInfo extends Command
$servers_ip_info = $serverIpModel->read(['id' => $project_info['serve_id']], ['servers_id']);
if ($servers_ip_info && $servers_ip_info['servers_id'] != ServerConfig::SELF_SITE_ID) {
//非自建站项目,申请免费证书
$this->updateAmpPrivate($v['domain']);
$this->updateAmpPrivate($v);
$ssl_new = $this->updateDomainSsl($v['domain']);
$ssl_new['from'] && $data['certificate_start_time'] = $ssl_new['from'];
... ... @@ -212,24 +212,28 @@ class DomainInfo extends Command
"rewrite" => $param['extend_config'],
'other_domain' => $param['other_domain'],
'is_https' => $param['is_https'],
'not_allow_country' => $param['not_allow_country'],
'not_allow_ip' => $param['not_allow_ip'],
'is_redirect' => $param['is_redirect']
];
return $this->curlRequest($url, $param);
}
/**
* 更新amp站证书
* @param $domain
* @param $param
* @return array
* @author Akun
* @date 2024/02/26 10:25
*/
public function updateAmpPrivate($domain)
public function updateAmpPrivate($param)
{
$url = 'https://' . $domain . '/api/createSiteAmp/';
$url = 'https://' . $param['domain'] . '/api/createSiteAmp/';
$param = [
"domain" => $domain,
'private_key' => '',
'cert' => ''
"domain" => $param['domain'],
'not_allow_country' => $param['not_allow_country'],
'not_allow_ip' => $param['not_allow_ip'],
'is_redirect' => $param['is_redirect']
];
return $this->curlRequest($url, $param);
}
... ...
... ... @@ -2,6 +2,7 @@
namespace App\Console\Commands\Domain;
use App\Models\Project\DeployOptimize;
use App\Models\Project\OnlineCheck;
use App\Models\Project\Project;
use Illuminate\Console\Command;
... ... @@ -22,6 +23,9 @@ class RemainDay extends Command
*/
protected $signature = 'remain_day';
protected $projectId = [
1434
];//需要单独处理的项目
/**
* The console command description.
*
... ... @@ -44,20 +48,29 @@ class RemainDay extends Command
*/
public function handle()
{
$list = Project::whereIn('type', [2,3,4])->get();
$list = Project::whereIn('type', [Project::TYPE_TWO,Project::TYPE_THREE,Project::TYPE_FOUR])->get();
foreach ($list as $item){
if($item['type'] == Project::TYPE_TWO){
//获取当前项目的达标天数
$compliance_day = Project::where(['id' => $item['id']])->value('finish_remain_day') ?: 0;
$remain_day = $item['deploy_build']['service_duration'] - $compliance_day;
if(in_array($item->id,$this->projectId)){//已开始优化的时间结算
$optimizeModel = new DeployOptimize();
$opInfo = $optimizeModel->read(['project_id'=>$item->id],['start_date']);
if($opInfo === false){
continue;
}
$diff = time() - strtotime($opInfo['start_date'] ?? $item->uptime);
$remain_day = $item['deploy_build']['service_duration'] - floor($diff / (60 * 60 * 24));
}else{
//审核上线后开始
$check_time = OnlineCheck::where('project_id', $item['id'])->where('status', 1)->value('created_at') ?: '';
if(!$check_time){
$remain_day = $item['deploy_build']['service_duration'];
if($item['type'] == Project::TYPE_TWO){
//获取当前项目的达标天数
$compliance_day = $item->finish_remain_day ?? 0;
$remain_day = $item['deploy_build']['service_duration'] - $compliance_day;
}else{
$diff = time() - strtotime($check_time);
$remain_day = floor($diff / (60 * 60 * 24));
if($item->uptime){
$diff = time() - strtotime($item->uptime);
$item->finish_remain_day = floor($diff / (60 * 60 * 24));
$remain_day = $item['deploy_build']['service_duration'] - floor($diff / (60 * 60 * 24));
}else{
$remain_day = $item['deploy_build']['service_duration'];
}
}
}
$item->remain_day = $remain_day > 0 ? $remain_day : 0;
... ...
... ... @@ -16,9 +16,12 @@ use App\Models\Product\Keyword;
use App\Models\Product\Product;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redis;
class VideoTask extends Command
{
... ... @@ -50,15 +53,19 @@ class VideoTask extends Command
* @var int 最大子任务
*/
public $max_sub_task = 200;
public $max_num = 49000;
/**
* @return bool
*/
public function handle()
{
echo '开始:'.PHP_EOL;
Log::info('开始视频推广任务');
$this->createSubTask();
$number = KeywordVideoTaskLog::getMonthVideoNum();
if($number >= $this->max_num){
Log::info('当月以达到最大视频生成数,任务执行数:' . $number);
return true;
}
$this->createSubTask($number);
$this->sendSubTask();
Log::info('结束视频推广任务');
return true;
... ... @@ -69,13 +76,16 @@ class VideoTask extends Command
* TODO 获取需要生成子任务的项目,获取项目中未生成视频的关键词,通过关键词生成初始化子任务
* @return bool
*/
public function createSubTask()
public function createSubTask($number)
{
$sub_task_num = $this->max_sub_task;
while (true) {
if ($sub_task_num <= 0){
break;
}
if($number >= $this->max_num){
break;
}
$task_project = KeywordVideoTask::where(['status' => KeywordVideoTask::STATUS_OPEN])->orderBy('sort', 'desc')->orderBy('id', 'desc')->first();
if (empty($task_project)){
break;
... ... @@ -101,7 +111,7 @@ class VideoTask extends Command
}
$logo_bg = $this->getImage($domainInfo);
foreach ($keyword as $val) {
$log = KeywordVideoTaskLog::where(['project_id' => $task_project->project_id, 'keyword_id' => $val->id])->first();
$log = KeywordVideoTaskLog::where(['project_id' => $task_project->project_id, 'keyword_id' => $val->id , 'result_status'=>'200'])->first();
if ($log){
continue;
}
... ... @@ -124,6 +134,7 @@ class VideoTask extends Command
}
}
}
Cache::put('video_keyword_number_month',$number + count($keyword),3600);
$task_project->status = KeywordVideoTask::STATUS_CLOSE;
$task_project->save();
}
... ...
... ... @@ -39,7 +39,7 @@ class MonthAllCount extends Command
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['delete_status'=>0]);
$list = $projectModel->list(['delete_status'=>0,'type'=>['in',[1,2,3,4,6]]]);
foreach ($list as $v) {
if($v['is_upgrade'] == 1){
$oldModel = new UpdateOldInfo();
... ...
... ... @@ -36,7 +36,7 @@ class MonthCount extends Command
public function handle(){
$list = DB::table('gl_project')->where('gl_project.extend_type','=',0)
->where('gl_project.type','!=',0)
->whereIn('gl_project.type',[1,2,3,4,6])
->leftJoin('gl_project_deploy_build', 'gl_project.id', '=', 'gl_project_deploy_build.project_id')
->leftJoin('gl_project_deploy_optimize', 'gl_project.id', '=', 'gl_project_deploy_optimize.project_id')
->select($this->selectParam())->get()->toArray();
... ...
... ... @@ -105,7 +105,7 @@ class ReplaceHtml extends Command
'source_id'=>$v['id'],
'is_rollback'=>$info['is_rollback'],
'template_id'=>$info['template_id'],
'name'=>$v['name'],
'source_name'=>$v['name'],
'created_at'=>date('Y-m-d H:i:s'),
'updated_at'=>date('Y-m-d H:i:s')
];
... ...
... ... @@ -10,6 +10,7 @@ use App\Models\Domain\DomainInfo;
use App\Models\Mail\Mail;
use App\Models\Project\DeployBuild;
use App\Models\Project\DeployOptimize;
use App\Models\Project\ProjectKeyword;
use App\Models\Project\ProjectUpdateTdk;
use App\Models\User\User;
use App\Models\WebSetting\WebLanguage;
... ... @@ -375,7 +376,13 @@ class UpdateSeoTdk extends Command
$info = Cache::get($cache_key);
if(!$info){
$projectOptimizeModel = new DeployOptimize();
$info = $projectOptimizeModel->read(['project_id' => $project_id], ['id', 'company_en_name', 'company_en_description', 'main_keywords']);
$info = $projectOptimizeModel->read(['project_id' => $project_id], ['id', 'company_en_name', 'company_en_description']);
$projectKeywordModel = new ProjectKeyword();
$keywordInfo = $projectKeywordModel->read(['project_id'=>$project_id]);
$info['main_keyword'] = '';
if($keywordInfo === false){
$info['main_keyword'] = $keywordInfo['main_keyword'];
}
Cache::put($cache_key, $info, 600);
}
return $info;
... ... @@ -412,12 +419,12 @@ class UpdateSeoTdk extends Command
{
$str = '';
$info = $this->getDeployOptimize($project_id);
if (!empty($info['main_keywords'])) {
$main_keywords = explode("\r\n", $info['main_keywords']);
if (!empty($info['main_keyword'])) {
$main_keyword = explode("\r\n", $info['main_keyword']);
//随机取
shuffle($main_keywords);
$main_keywords = array_slice($main_keywords, 0, $num);
$str = implode(", ", $main_keywords);
shuffle($main_keyword);
$main_keyword = array_slice($main_keyword, 0, $num);
$str = implode(", ", $main_keyword);
}
return $str;
}
... ...
... ... @@ -10,6 +10,7 @@ use App\Models\Domain\DomainInfo;
use App\Models\Mail\Mail;
use App\Models\Project\DeployBuild;
use App\Models\Project\DeployOptimize;
use App\Models\Project\ProjectKeyword;
use App\Models\Project\ProjectUpdateTdk;
use App\Models\User\User;
use App\Models\WebSetting\WebLanguage;
... ... @@ -373,7 +374,13 @@ class UpdateSeoTdkByTaskId extends Command
$info = Cache::get($cache_key);
if(!$info){
$projectOptimizeModel = new DeployOptimize();
$info = $projectOptimizeModel->read(['project_id' => $project_id], ['id', 'company_en_name', 'company_en_description', 'main_keywords']);
$info = $projectOptimizeModel->read(['project_id' => $project_id], ['id', 'company_en_name', 'company_en_description']);
$projectKeywordModel = new ProjectKeyword();
$keywordInfo = $projectKeywordModel->read(['project_id'=>$project_id]);
$info['main_keyword'] = '';
if($keywordInfo === false){
$info['main_keyword'] = $keywordInfo['main_keyword'];
}
Cache::put($cache_key, $info, 600);
}
return $info;
... ... @@ -410,12 +417,12 @@ class UpdateSeoTdkByTaskId extends Command
{
$str = '';
$info = $this->getDeployOptimize($project_id);
if (!empty($info['main_keywords'])) {
$main_keywords = explode("\r\n", $info['main_keywords']);
if (!empty($info['main_keyword'])) {
$main_keyword = explode("\r\n", $info['main_keyword']);
//随机取
shuffle($main_keywords);
$main_keywords = array_slice($main_keywords, 0, $num);
$str = implode(", ", $main_keywords);
shuffle($main_keyword);
$main_keyword = array_slice($main_keyword, 0, $num);
$str = implode(", ", $main_keyword);
}
return $str;
}
... ...
... ... @@ -48,113 +48,14 @@ class Demo extends Command
protected $description = 'demo';
public function handle(){
$p = new PurchaserInfo();
$lists = $p->list();
foreach ($lists as $k => $v){
$info = $p->read(['project_id'=>$v['project_id'],'keyword'=>$v['keyword'],'buyer'=>$v['buyer']]);
if($info === false){
continue;
}
$p->del(['project_id'=>$v['project_id'],'keyword'=>$v['keyword'],'buyer'=>$v['buyer'],'id'=>['!=',$v['id']]]);
}
return true;
$this->synchronizationFile('/upload/m/file/2024-07/tongli-haiyuan-keywords.pdf');
}
// public function handle(){
// $keywordVideoModel = new KeywordVideoTask();
// $project_id_arr = $keywordVideoModel::where('id','>',0)->pluck('project_id')->toArray();
// //查看是否有子记录
// foreach ($project_id_arr as $values){
// $logModel = new KeywordVideoTaskLog();
// $logInfo = $logModel->read(['project_id'=>$values]);
// if($logInfo === false){
// echo date('Y-m-d H:i:s') . '开启的项目project_id:'.$values . PHP_EOL;
// $keywordVideoModel->edit(['status'=>0],['project_id'=>$values]);
// }
// }
// $projectModel = new Project();
// $list = $projectModel->list(['type'=>['!=',0],'delete_status'=>0,'id'=>['in',$project_id_arr]]);
// $data = [];
// foreach ($list as $v){
// echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
// ProjectServer::useProject($v['id']);
// $this->getProductList();
// DB::disconnect('custom_mysql');
// }
// echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
// }
// public function getProductList(){
// $productModel = new Product();
// $product_all_id = $productModel::whereRaw('LENGTH(keyword_id) > 50')->pluck('id')->toArray();
// if(empty($product_all_id)){
// return true;
// }
// $lists = $productModel->whereIn("id", $product_all_id)->orderByRaw(DB::raw("FIELD(id, " . implode(',', $product_all_id) . ")"))->get()->toArray();
// foreach ($lists as $k => $v){
// echo date('Y-m-d H:i:s') . '项目id:'.$v['project_id'].'+产品product_id:'.$v['id'] . PHP_EOL;
// $str = ',';
// shuffle($v['keyword_id']);
// foreach ($v['keyword_id'] as $key => $value){
// if($key == 6){
// break;
// }
// $str .= $value.',';
// }
// $productModel->edit(['keyword_id'=>$str],['id'=>$v['id']]);
// }
// return true;
// }
//
// /**
// * @remark :关键字有视频的改为1
// * @name :getProductKeywordInfo
// * @author :lyh
// * @method :post
// * @time :2024/5/31 9:54
// */
// public function saveKeyword(){
// $keywordModel = new Keyword();
// $rs = $keywordModel->edit(['is_video_keyword'=>0],['video'=>'']);
// echo date('Y-m-d H:i:s') . 'end'.$rs . PHP_EOL;
// return true;
// }
// public function handle(){
// //切换数据库配置
// ProjectServer::useProject(1862);
// return $this->initTable(1380,1862);
// }
//
// public function initTable($project_id, $news_project_id)
// {
// config(['database.connections.custom_tmp_mysql_copy.database' => 'gl_data_' . $project_id]);
// $database_name = DB::connection('custom_tmp_mysql_copy')->getDatabaseName();
// $tables = Schema::connection('custom_tmp_mysql_copy')->getAllTables();
// $tables = array_column($tables, 'Tables_in_' . $database_name);
// foreach ($tables as $table) {
// $has_table = Schema::connection('custom_mysql')->hasTable($table);
// if (!$has_table) {
// $sql = DB::connection('custom_tmp_mysql_copy')->select("SHOW CREATE TABLE {$table}");
// DB::connection('custom_mysql')->statement(array_values((array)$sql[0])[0]); // 修正此处的sql语句获取方式
// }
//
// if ($table == 'gl_customer_visit' || $table == 'gl_customer_visit_item' || $table == 'gl_inquiry_other' || $table == 'gl_inquiry_form_data' || $table == 'gl_inquiry_form') {
// continue;
// }
// DB::connection('custom_mysql')->table($table)->truncate(); // 清空目标表数据
// DB::connection('custom_mysql')->table($table)->insertUsing(
// [], // 列名数组,留空表示插入所有列
// function ($query) use ($table, $project_id) {
// $name = 'gl_data_' . $project_id . '.' . $table;
// $query->select('*')->from("{$name}");
// }
// );
//
// if (Schema::connection('custom_mysql')->hasColumn($table, 'project_id')) {
// DB::connection('custom_mysql')->table($table)->update(['project_id' => $news_project_id]);
// }
// }
// return true;
// }
public function synchronizationFile($path_name){
//同步到大文件
$file_path = config('filesystems.disks.cos')['cdn1'].$path_name;
$directoryPath = pathinfo($path_name, PATHINFO_DIRNAME);
$cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$directoryPath.'" https://v6-file.globalso.com/upload.php';
return shell_exec($cmd);
}
}
... ...
... ... @@ -93,4 +93,9 @@ class TdkTest extends Command
}
}
}
public function ceshi(){
//under_ceshi
$model = new Cesjo();
}
}
... ...
... ... @@ -47,7 +47,7 @@ class HtmlCollect extends Command
public function handle()
{
ini_set('memory_limit', '512M');
ini_set('memory_limit', '1024M');
while (true) {
$this->start_collect();
}
... ... @@ -442,7 +442,12 @@ class HtmlCollect extends Command
foreach ($source as $vs) {
if ($vs['download']) {
$new_source = CosService::uploadRemote($project_id, 'source', $vs['url_complete']);
if ($project_id == 1355 && in_array(substr($vs['url_complete'], -3), ['pdf', 'zip', 'rar', '.gz'])) {
//项目id为1355的项目,可下载类资源要保持原名称,做特殊处理
$new_source = CosService::uploadRemote($project_id, 'source', $vs['url_complete'], '', '', 1);
} else {
$new_source = CosService::uploadRemote($project_id, 'source', $vs['url_complete']);
}
if ($new_source) {
CollectSource::insert([
'project_id' => $project_id,
... ...
... ... @@ -308,6 +308,13 @@ class ProjectUpdate extends Command
$keyword_id = ',' . implode(',', array_column($keyword_arr, 'id')) . ',';
}
}
//产品参数
$attrs = [];
if ($item['attr'] ?? []) {
foreach ($item['attr'] as $k_attr => $attr) {
$attrs[] = ['key' => $k_attr, 'value' => $attr];
}
}
//名称去掉特殊符号
$item['ttile'] = $this->special2str($item['ttile'] ?? '');
... ... @@ -323,6 +330,7 @@ class ProjectUpdate extends Command
'keyword_id' => $keyword_id,
'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
'gallery' => Arr::a2s($gallery),
'attrs' => Arr::a2s($attrs),
'seo_mate' => Arr::a2s([
'title' => $item['ttile'],
'keyword' => $item['keywords'] ?? '',
... ... @@ -353,6 +361,7 @@ class ProjectUpdate extends Command
'keyword_id' => $keyword_id,
'thumb' => isset($gallery[0]) ? Arr::a2s($gallery[0]) : '',
'gallery' => Arr::a2s($gallery),
'attrs' => Arr::a2s($attrs),
'seo_mate' => Arr::a2s([
'title' => $item['ttile'],
'keyword' => $item['keywords'] ?? '',
... ... @@ -361,15 +370,20 @@ class ProjectUpdate extends Command
'send_time' => $item['post_date'] ?? date('Y-m-d H:i:s'),
'sort' => $item['sort'] ?? 0,
], ['id' => $id]);
} else {
//按6.0展示只更新分类
$model->edit([
'category_id' => $category_id
], ['id' => $id]);
}
}
if ($six_read) {
//关联分类
if ($category_arr) {
CategoryRelated::saveRelated($id, array_column($category_arr, 'id'));
}
//关联分类
if ($category_arr) {
CategoryRelated::saveRelated($id, array_column($category_arr, 'id'));
}
if ($six_read) {
//扩展字段
if ($item['extend'] ?? []) {
foreach (array_reverse($item['extend']) as $ke => $ve) {
... ... @@ -651,15 +665,15 @@ class ProjectUpdate extends Command
$item['title'] = $this->special2str($item['title'] ?? '');
//排序
$sort = 0;
if(isset($item['listorder'])){
if (isset($item['listorder'])) {
$sort = $item['listorder'];
}
if(isset($item['sort'])){
if (isset($item['sort'])) {
$sort = $item['sort'];
}
try {
$custom_content = $model->read(['route' => $route], ['id','six_read']);
$custom_content = $model->read(['route' => $route], ['id', 'six_read']);
if (!$custom_content) {
$id = $model->insertGetId([
'project_id' => $project_id,
... ... @@ -683,7 +697,7 @@ class ProjectUpdate extends Command
} else {
$id = $custom_content['id'];
$six_read = $custom_content['six_read'];
if($six_read){
if ($six_read) {
$model->edit([
'name' => $item['title'],
'category_id' => $category_id,
... ... @@ -696,7 +710,7 @@ class ProjectUpdate extends Command
}
//扩展字段
if($six_read){
if ($six_read) {
if ($item['extend'] ?? []) {
foreach ($item['extend'] as $ke => $ve) {
$extend = $extend_model->read(['title' => $ke]);
... ...
... ... @@ -19,7 +19,7 @@ class Kernel extends ConsoleKernel
$schedule->command('template_label')->dailyAt('01:00')->withoutOverlapping(1);//最新模块
$schedule->command('popular_template_label')->dailyAt('01:30')->withoutOverlapping(1);//热门模块
// $schedule->command('inspire')->hourly();
$schedule->command('remain_day')->dailyAt('09:00')->withoutOverlapping(1); // 项目剩余服务时长
$schedule->command('remain_day')->dailyAt('06:00')->withoutOverlapping(1); // 项目剩余服务时长
$schedule->command('rank_data_task')->everyMinute()->withoutOverlapping(1); // 排名数据更新任务
$schedule->command('service_count')->dailyAt('01:00')->withoutOverlapping(1); //服务器使用情况,每天凌晨1点执行一次
$schedule->command('web_traffic_special')->everyMinute()->withoutOverlapping(1); // 特殊引流
... ... @@ -29,12 +29,15 @@ class Kernel extends ConsoleKernel
$schedule->command('inquiry_delay')->everyMinute()->withoutOverlapping(1);//TODO::上线放开,转发询盘,每分钟执行一次
$schedule->command('inquiry_count')->dailyAt('01:00')->withoutOverlapping(1); // 询盘统计数据,每天凌晨执行一次
// $schedule->command('domain_info')->dailyAt('01:20')->withoutOverlapping(1);// 更新域名|证书结束时间,每天凌晨1点执行一次
$schedule->command('share_user')->dailyAt('01:20')->withoutOverlapping(1);// 每天凌晨1点执行一次
$schedule->command('last_inquiry')->dailyAt('04:00')->withoutOverlapping(1);// 最近一次询盘信息
$schedule->command('update_seo_tdk_crontab')->dailyAt('20:00')->withoutOverlapping(1); //更新上线项目TDK
$schedule->command('sync_manager')->dailyAt('01:00')->withoutOverlapping(1); //TODO::手机号码同步 每天执行一次
$schedule->command('update_keyword_route')->dailyAt('01:00')->withoutOverlapping(1); //升级项目--清除路由相同的关键字
$schedule->command('recommended_suppliers')->dailyAt('03:00')->withoutOverlapping(1); //每天凌晨1点执行一次生成推荐商
$schedule->command('update_keyword_content')->hourly()->withoutOverlapping(1);
// 每月15号执行任务
$schedule->command('delete_template_log')->monthlyOn(15, '00:01')->withoutOverlapping();
// 每日推送已完成视频任务项目生成对应界面
$schedule->command('notice_c')->dailyAt('04:00')->withoutOverlapping(1);
}
... ...
... ... @@ -116,29 +116,22 @@ zFePUMXy1bFghAfzNKlrc5XgH4ixeeMh3cDtU97K
//平台参数处理
$param['idempotencyKey'] = uniqid().time();
$url = $this->path.'/api/post';
return $this->http_post_ayr($url,$param,$api_key);
}
public function http_post_ayr($url,$param,$api_key){
$curl = curl_init();
curl_setopt_array($curl, array(
curl_setopt_array($curl, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => http_build_query($param),
CURLOPT_HTTPHEADER => array(
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode($param),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.$api_key,
'Accept-Encoding: gzip'
),
));
'Content-Type: application/json'
],
]);
$response = curl_exec($curl);
curl_close($curl);
return $response;
}
/**
* @name :(上传图片或视频到ayr_share)post_media_upload
* @author :lyh
... ...
... ... @@ -26,7 +26,8 @@ class Common
$data = [
'operator_id'=>$param['operator_id'],
'model'=>$param['model'],
'remark'=>$param['remark']
'remark'=>$param['remark'],
'project_id'=>$param['project_id']
];
$model = new UserLogModel();
return $model->add($data);
... ...
... ... @@ -644,11 +644,11 @@ if (!function_exists('getFileUrl')) {
* @method :post
* @time :2023/7/20 16:46
*/
function getFileUrl($path,$storage_type = 0,$location = 0){
function getFileUrl($path,$storage_type = 0,$location = 0,$file_cdn = 0){
if(is_array($path)){
$url =[];
foreach ($path as $v){
$url[] = getFileUrl($v,$storage_type,$location);
$url[] = getFileUrl($v,$storage_type,$location,$file_cdn);
}
}else{
if(empty($path)){
... ... @@ -662,7 +662,7 @@ if (!function_exists('getFileUrl')) {
}
$file_type = pathinfo($path, PATHINFO_EXTENSION);
$fileTypeArr = ['zip', 'pdf', 'mp4', 'doc', 'docx', 'm4v', 'xlsx'];
if(in_array(strtolower($file_type),$fileTypeArr)){
if(in_array(strtolower($file_type),$fileTypeArr) && ($file_cdn == 0)){
$cdn2 = config('filesystems.disks.cos')['cdn2'];
return $cdn2.$path;
}
... ...
... ... @@ -145,7 +145,7 @@ class IndexController extends BaseController
$token = md5(uniqid().'auto'.$info['id']);
//存储缓存
$info['token'] = $token;
Cache::add($token,$info,3600);
Cache::add($token,$info,12 * 3600);
$languageModel = new WebLanguage();
$languageInfo = $languageModel->read(['id'=>$info['main_lang_id']],['short','english','chinese']);
$data = ['token'=>$token,'main_lang_id'=>$info['main_lang_id'],'language_info'=>$languageInfo];
... ...
... ... @@ -3,6 +3,7 @@
namespace App\Http\Controllers\Aside\Manage;
use App\Enums\Common\Code;
use App\Http\Controllers\Aside\BaseController;
use App\Http\Requests\Aside\Manage\ManagerHrRequest;
use App\Models\Manage\ManageHr;
use App\Models\Manage\Menu;
use Illuminate\Http\Request;
... ... @@ -53,7 +54,8 @@ class HrController extends BaseController
* @method :post
* @time :2023/9/6 10:05
*/
public function save(HrLogic $logic){
public function save(ManagerHrRequest $request,HrLogic $logic){
$request->validated();
$logic->hrSave();
$this->response('success');
}
... ...
... ... @@ -13,6 +13,7 @@ use App\Enums\Common\Code;
use App\Http\Controllers\Aside\BaseController;
use App\Models\Project\DeployOptimize;
use App\Models\Project\Project;
use App\Models\Project\ProjectKeyword;
class KeywordsController extends BaseController
{
... ... @@ -24,9 +25,9 @@ class KeywordsController extends BaseController
* @time :2023/9/4 10:13
*/
public function lists(){
$projectDeployOptimizeModel = new DeployOptimize();
$ids = $projectDeployOptimizeModel->where('customer_keywords','like','%'.$this->map['search'].'%')
->orWhere('main_keywords', 'like' , '%'.$this->map['search'].'%')->pluck('project_id')->toArray();
$projectKeywordModel = new ProjectKeyword();
$ids = $projectKeywordModel->where('customer_keywords','like','%'.$this->map['search'].'%')
->orWhere('main_keyword', 'like' , '%'.$this->map['search'].'%')->pluck('project_id')->toArray();
$projectModel = new Project();
$lists = $projectModel->formatQuery(['id'=>['in',$ids]])->with('payment')->with('deploy_build')
->with('deploy_optimize')->with('domainInfo')->get()->toArray();
... ...
... ... @@ -12,9 +12,15 @@ use App\Models\Channel\Channel;
use App\Models\Com\KeywordVideoTask;
use App\Models\Domain\DomainInfo;
use App\Models\Manage\ManageHr;
use App\Models\Product\Category;
use App\Models\Product\Keyword;
use App\Models\Product\Product;
use App\Models\Project\DeployOptimize;
use App\Models\Project\Project;
use App\Models\RankData\RankData;
use App\Models\RouteMap\RouteMap;
use App\Services\ProjectServer;
use Illuminate\Support\Facades\DB;
/**
* @remark :优化
... ... @@ -426,4 +432,58 @@ class OptimizeController extends BaseController
$optimizeModel->edit(['ai_video'=>$this->param['status']],['project_id'=>$this->param['project_id']]);
$this->response('success');
}
/**
* @remark :锚文本链接
* @name :anchorTextList
* @author :lyh
* @method :post
* @time :2024/7/17 14:04
*/
public function anchorTextList(){
$this->request->validate([
'project_id' => 'required',
], [
'project_id.required' => 'project_id不能为空',
]);
// 获取当前网站正式域名
$domainModel = new DomainInfo();
$domainInfo = $domainModel->read(['project_id' => $this->param['project_id']], ['domain']);
if ($domainInfo === false) {
$this->fail('请先设置域名');
}
$domain = 'https://' . $domainInfo['domain'] . '/';
$data = [];
ProjectServer::useProject($this->param['project_id']);
$productModel = new Product();
$this->processChunkedList($productModel, ['status' => $productModel::STATUS_ON], ['id', 'title', 'route'], $domain, $data, 'product');
$productCategoryModel = new Category();
$this->processChunkedList($productCategoryModel, ['status' => $productCategoryModel::STATUS_ACTIVE], ['id', 'title', 'route'], $domain, $data, 'product_category');
$productKeywordModel = new Keyword();
$this->processChunkedList($productKeywordModel, ['status' => $productKeywordModel::STATUS_ACTIVE], ['id', 'title', 'route'], $domain, $data, 'product_keyword');
DB::disconnect('custom_mysql');
$this->response('success', Code::SUCCESS, $data);
}
/**
* @remark :分片查询
* @name :processChunkedList
* @author :lyh
* @method :post
* @time :2024/7/17 14:55
*/
public function processChunkedList($model, $conditions, $fields, $domain, &$data, $key) {
$offset = 1;
$chunkSize = 5000; // 每次查询的记录数
while (true) {
$chunk = $model->lists($conditions,$offset,$chunkSize, 'id', $fields);
if (count($chunk['list']) == 0) {
break;
}
foreach ($chunk['list'] as $item) {
$data[$key][] = $domain . $item['route'] . '/{' . $item['title'] . '}';
}
$offset++;
}
}
}
... ...
... ... @@ -417,9 +417,11 @@ class ProjectController extends BaseController
public function save(ProjectLogic $logic)
{
$this->request->validate([
'type'=>'required'
'type'=>'required',
'serve_id'=>'required',
],[
'type.required' => '类型不能为空'
'type.required' => '类型不能为空',
'serve_id.required' => '请选择服务器'
]);
$logic->projectSave();
$this->response('success');
... ...
... ... @@ -70,7 +70,7 @@ class AutoTaskController extends BaseController
}
}
// 映射信息 以及解析信息
$val['type'] = $type[$val['type']];
$val['type'] = $type[$val['type']] ?? '';
$val['route'] = $route[$val['route']];
$val['status'] = $status[$val['status']];
$val['project_title'] = $projects[$val['project_id']] ?? '';
... ...
... ... @@ -88,7 +88,9 @@ class AyrReleaseController extends BaseController
}
//发送请求发布社交文章
$res = $ayrShare->post_send_msg($param,$share_info['profile_key']);
$ayrReleaseLogic->release_add($res);
if($res){
$ayrReleaseLogic->release_add($res);
}
//保存返回的内容
$this->response('success',Code::SUCCESS,json_decode($res));
}
... ...
... ... @@ -64,18 +64,13 @@ class AyrShareController extends BaseController
$str = json_encode($share_info['activeSocialAccounts']);
if($str != $info['bind_platforms']){
$ayrShareLogic->ayr_share_edit(['bind_platforms'=>$str],$this->param['id']);
$res = true;
}else{
$res = false;
}
}else{
if(!empty($info['bind_platforms'])){
$ayrShareLogic->ayr_share_edit(['bind_platforms'=>''],$this->param['id']);
return true;
}
$res = false;
}
$this->response('success',Code::SUCCESS,['is_true'=>$res]);
$this->response('success',Code::SUCCESS,$share_info['activeSocialAccounts'] ?? []);
}
/**
* @name :(创建ayr_share账户)create_account
... ...
... ... @@ -159,7 +159,7 @@ class BaseController extends Controller
$log = config('logging.operator_log');
if(isset($log) && $log['log'] == true){
if(empty($log['action']) || (strpos($log['action'],$this->request->route()->getName()) === false)){
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]);
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]);
}
}
return true;
... ...
... ... @@ -85,7 +85,7 @@ class CustomModuleContentController extends BaseController
$v['image_link'] = getImageUrl($v['image'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
}
if(!empty($v['video'])){
$v['video']['url'] = getFileUrl($v['video']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
$v['video']['url'] = getFileUrl($v['video']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location'],$this->user['file_cdn'] ?? 0);
$v['video']['video_image'] = getImageUrl($v['video']['video_image'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
}
return $this->success($v);
... ...
... ... @@ -12,6 +12,7 @@ namespace App\Http\Controllers\Bside\Keyword;
use App\Enums\Common\Code;
use App\Http\Controllers\Bside\BaseController;
use App\Models\Project\DeployOptimize;
use App\Models\Project\ProjectKeyword;
class ProjectKeywordController extends BaseController
{
... ... @@ -28,9 +29,16 @@ class ProjectKeywordController extends BaseController
if($info === false){
$this->response('success');
}
$data['search_keywords'] = $info['search_keywords'];
$data['customer_keywords'] = $info['customer_keywords'];
$data['brand_keyword'] = $info['brand_keyword'];
$projectKeywordModel = new ProjectKeyword();
$keywordInfo = $projectKeywordModel->read(['project_id'=>$this->user['project_id']]);
if($keywordInfo === false){
$data['search_keywords'] = '';
$data['customer_keywords'] = '';
$this->response('success',Code::SUCCESS,$data);
}
$data['search_keywords'] = $keywordInfo['search_keywords'];
$data['customer_keywords'] = $keywordInfo['customer_keywords'];
$this->response('success',Code::SUCCESS,$data);
}
... ...
... ... @@ -220,7 +220,7 @@ class KeywordController extends BaseController
'title.max' => '批量操作不能超过500条数据'
]);
$keywordModel = new Keyword();
$rs = $keywordModel->edit(['is_video_keyword'=>$this->param['is_video_keyword']],['title'=>['in',$this->param['title']]]);
$rs = $keywordModel->edit(['is_video_keyword'=>$this->param['is_video_keyword'] ?? 0],['title'=>['in',$this->param['title']]]);
if($rs === false){
$this->fail('编辑失败,请联系管理员');
}
... ...
... ... @@ -133,11 +133,11 @@ class ProductController extends BaseController
}
}
if(!empty($v['video'])){
$v['video']['url'] = getFileUrl($v['video']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
$v['video']['url'] = getFileUrl($v['video']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location'],$this->user['file_cdn'] ?? 0);
$v['video']['video_image'] = getImageUrl($v['video']['video_image'] ?? '',$this->user['storage_type'] ?? 0,$this->user['project_location']);
}
if(!empty($v['files']) && !empty($v['files']['url'])){
$v['files']['url'] = getFileUrl($v['files']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location']);
$v['files']['url'] = getFileUrl($v['files']['url'],$this->user['storage_type'] ?? 0,$this->user['project_location'],$this->user['file_cdn'] ?? 0);
}
return $this->success($v);
}
... ... @@ -167,6 +167,29 @@ class ProductController extends BaseController
if(!empty($this->param['start_at']) && !empty($this->param['end_at'])){
$query->where('created_at', '>=' ,$this->param['start_at'].' 00:00:00')->where('created_at', '<=' ,$this->param['end_at'].' 59:59:59');
}
$this->param['featured_status'] = $this->param['featured_status'] ?? 0;
if($this->param['featured_status'] != Category::STATUS_ACTIVE) {
$cateModel = new Category();
$featured_ids = $cateModel->where('title', 'like', 'Featured%')->pluck('id')->toArray();
if(!empty($featured_ids)){
$status = [];
if(isset($this->map['status'])){
$status = ['status'=>$this->map['status']];
}
$cateList = $cateModel->list($status,'id',['id','pid']);
//获取当前的子集
$featured_arr = [];
foreach ($featured_ids as $id){
$featured_arr = array_merge($featured_arr,array_unique(_get_all_sub($id,$cateList)));
}
if(!empty($featured_arr)){
$cateRelated = new CategoryRelated();
$product_ids = $cateRelated->whereIn('cate_id',$featured_arr)->pluck('product_id')->unique()->toArray();
$query = $query->whereNotIn('id',$product_ids);
}
}
}
return $query;
}
... ... @@ -356,9 +379,9 @@ class ProductController extends BaseController
foreach ($arr1 as $k1=>$v1){
$v1 = (array)$v1;
if(isset($v1['url'])){
$v1['url'] = getFileUrl($v1['url'],$this->user['storage_type'],$this->user['project_location']);
$v1['url'] = getFileUrl($v1['url'],$this->user['storage_type'],$this->user['project_location'],$this->user['file_cdn'] ?? 0);
}else{
$v1 = getFileUrl($v1,$this->user['storage_type'],$this->user['project_location']);
$v1 = getFileUrl($v1,$this->user['storage_type'],$this->user['project_location'],$this->user['file_cdn'] ?? 0);
}
$arr1[$k1] = $v1;
}
... ... @@ -548,8 +571,8 @@ class ProductController extends BaseController
}
/**
* @remark :Ai发布新闻
* @name :sendAiNews
* @remark :Ai发布
* @name :sendAiProduct
* @author :lyh
* @method :post
* @time :2024/1/26 15:33
... ...
... ... @@ -221,7 +221,29 @@ class TranslateController extends BaseController
public function getSixUrl($map){
$data = [];
$routeMapModel = new RouteMap();
//查询路由中是否包含products
$list = $routeMapModel->list($map);
$productInfo = $routeMapModel->read(['route'=>'products']);
if($productInfo === false){
$productModel = new Product();
$count = $productModel->formatQuery(['status'=>1])->count();
$v['route'] = 'products';
$this->pageSixList($data,$count,$v,1,15);
}
$newsInfo = $routeMapModel->read(['route'=>'news']);
if($newsInfo === false){
$newsModel = new News();
$count = $newsModel->formatQuery(['status'=>1])->count();
$v['route'] = 'news';
$this->pageSixList($data,$count,$v,1,15);
}
$blogInfo = $routeMapModel->read(['route'=>'blog']);
if($blogInfo === false){
$blogModel = new Blog();
$count = $blogModel->formatQuery(['status'=>1])->count();
$v['route'] = 'blog';
$this->pageSixList($data,$count,$v,1,15);
}
foreach ($list as $k => $v){
switch ($v['source']){
case RouteMap::SOURCE_PAGE:
... ... @@ -293,6 +315,17 @@ class TranslateController extends BaseController
}
/**
* @remark :获取默认数据
* @name :getDefaultData
* @author :lyh
* @method :post
* @time :2024/7/16 15:28
*/
public function getDefaultData(){
}
/**
* @remark :
* @name :pageList
* @author :lyh
... ...
... ... @@ -342,7 +342,7 @@ class FileController
if ($info === false) {
$this->response('指定文件不存在!', Code::USER_ERROR);
}
$fileUrl = getFileUrl($info['path'],$info['is_cos']);
$fileUrl = getFileUrl($info['path'],$this->cache['storage_type'] ?? 0,$this->cache['project_location'] ?? 0,$this->cache['file_cdn'] ?? 0);
// 设置响应头
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
... ... @@ -388,11 +388,11 @@ class FileController
if(isset($this->cache['project_id']) && !empty($this->cache['project_id'])){
$this->map['project_id'] = $this->cache['project_id'];
}
$this->map['refer'] = 1;
$fileModel = new File();
$this->map['type'] = 'mp4';
$lists = $fileModel->list($this->map,'id',['id','hash','type','path','created_at','name']);
foreach ($lists as $k => $v){
$v['file_link'] = getFileUrl($v['path'],$this->cache['storage_type'] ?? 0);
$v['file_link'] = getFileUrl($v['path'],$this->cache['storage_type'] ?? 0,$this->cache['project_location'] ?? 0,$this->cache['file_cdn'] ?? 0);
$lists[$k] = $v;
}
$this->response('success',Code::SUCCESS,$lists);
... ... @@ -408,7 +408,7 @@ class FileController
public function responseData($path, $name){
$data = [
'file'=>$path,
'file_link'=>getFileUrl($path,$this->cache['storage_type'] ?? 0),
'file_link'=>getFileUrl($path,$this->cache['storage_type'] ?? 0,$this->cache['project_location'] ?? 0,$this->cache['file_cdn'] ?? 0),
'name'=>$name,
'file_download'=>url('a/download_files?path='.$path)
];
... ...
... ... @@ -13,6 +13,7 @@ use App\Http\Logic\Aside\BaseLogic;
use App\Models\CustomModule\CustomModule;
use App\Models\CustomModule\CustomModuleCategory;
use App\Models\CustomModule\CustomModuleContent;
use App\Models\RouteMap\RouteMap;
use App\Services\ProjectServer;
use Illuminate\Support\Facades\DB;
... ... @@ -84,9 +85,17 @@ class CustomModuleLogic extends BaseLogic
* @time :2023/12/5 9:39
*/
public function moduleAdd(){
$rs = (new CustomModule())->add($this->param);
if($rs === false){
$this->fail('系统错误,请联系管理员');
$id = (new CustomModule())->addReturnId($this->param);
if($id){
//同时创建对应route的分类
$customModuleCateModel = new CustomModuleCategory();
$data = [
'name'=>$this->param['route'],
'module_id'=>$id,
'project_id'=>$this->param['project_id'],
'route'=>RouteMap::setRoute($this->param['route'],RouteMap::SOURCE_MODULE_CATE,$id,$this->param['project_id'])
];
$customModuleCateModel->add($data);
}
return $this->success();
}
... ...
... ... @@ -315,6 +315,7 @@ class DomainInfoLogic extends BaseLogic
'amp_private_cert' => $this->param['amp_cert'] ?? '',
'not_allow_country'=>json_encode(array_filter($this->param['not_allow_country'] ?? [])),
'not_allow_ip'=>json_encode(array_filter($this->param['not_allow_ip'] ?? [])),
'is_redirect' => $this->param['is_redirect'] ?? 0,
];
$this->model->edit($data,['id'=>$this->param['id']]);
//主站生成证书
... ...
... ... @@ -39,7 +39,8 @@ class HrLogic extends BaseLogic
* @time :2023/9/6 10:17
*/
public function hrSave(){
//处理参数
$this->handleParam();
//处理参数
foreach ($this->model::specieField() as $v){
$this->param = $this->setJson($v,$this->param);
}
... ... @@ -52,6 +53,22 @@ class HrLogic extends BaseLogic
}
/**
* @remark :处理字段
* @name :handleParam
* @author :lyh
* @method :post
* @time :2024/7/10 16:32
*/
public function handleParam(){
$this->param['status'] = empty($this->param['status']) ? 1 : $this->param['status'];
$this->param['education'] = empty($this->param['education']) ? 1 : $this->param['education'];
$this->param['entry_position'] = empty($this->param['entry_position']) ? 1 : $this->param['entry_position'];
$this->param['p_level'] = empty($this->param['p_level']) ? 1 : $this->param['p_level'];
$this->param['dept_id'] = empty($this->param['dept_id']) ? 1 : $this->param['dept_id'];
$this->param['belong_group'] = empty($this->param['belong_group']) ? 1 : $this->param['belong_group'];
}
/**
* @remark :添加人事信息时 同步添加管理员账号
* @name :addManager
* @author :lyh
... ... @@ -75,10 +92,8 @@ class HrLogic extends BaseLogic
$managerModel = new Manage();
$this->param['manage_id'] = $managerModel->addReturnId($data);
$this->model->add($this->param);
//同步到B端演示项目
$this->syncBProjectUser($this->param['mobile'], $this->param['mobile'], $this->param['name'], $this->param['status']);
DB::commit();
}catch (\Exception $e){
DB::rollBack();
... ... @@ -120,7 +135,7 @@ class HrLogic extends BaseLogic
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('系统错误,请联系管理员');
$this->fail('系统错误,请联系管理员'.$e->getMessage());
}
return $this->success();
}
... ...
... ... @@ -236,8 +236,9 @@ class InquiryInfoLogic extends BaseLogic
public function getKeywordUrl($map){
$projectModel = new Project();
$lists = $projectModel->leftJoin('gl_project_deploy_optimize', 'gl_project_deploy_optimize.project_id', '=', 'gl_project.id')
->where('gl_project_deploy_optimize.main_keywords','like','%'.$map['keyword'].'%')
->orWhere('gl_project_deploy_optimize.customer_keywords','like','%'.$map['keyword'].'%')
->leftJoin('gl_project_keyword', 'gl_project_keyword.project_id', '=', 'gl_project.id')
->where('gl_project_keyword.main_keyword','like','%'.$map['keyword'].'%')
->orWhere('gl_project_keyword.customer_keywords','like','%'.$map['keyword'].'%')
->select($this->selectParam())->get();
if(!empty($lists)){
$lists = $lists->toArray();
... ...
... ... @@ -30,6 +30,7 @@ use App\Models\Project\InquiryFilterConfig;
use App\Models\Project\MinorLanguages;
use App\Models\Project\Payment;
use App\Models\Project\Project;
use App\Models\Project\ProjectKeyword;
use App\Models\Project\ProjectRenew;
use App\Models\Project\WebTrafficConfig;
use App\Models\RankData\ExternalLinks;
... ... @@ -71,7 +72,8 @@ class ProjectLogic extends BaseLogic
* @time :2023/7/28 17:11
*/
public function getProjectInfo($id){
$info = $this->model->with(['payment', 'deploy_build', 'deploy_optimize', 'online_check', 'project_after','inquiry_filter_config','web_traffic_config'])->where(['id'=>$id])->first()->toArray();
$info = $this->model->with(['payment', 'deploy_build', 'deploy_optimize', 'online_check',
'project_after','inquiry_filter_config','web_traffic_config','project_keyword'])->where(['id'=>$id])->first()->toArray();
$info['online_check']['name'] = (new Manage())->getName($info['online_check']['created_manage_id'] ?? 0);
$info['init_domain'] = $this->getInitDomain($info['serve_id'])['domain'];
if($info['extend_type'] != 0){
... ... @@ -148,7 +150,7 @@ class ProjectLogic extends BaseLogic
//初始化项目
$this->createProjectData($this->param);
//双向绑定服务器,需放到保存项目的上方
$this->setServers($this->param['serve_id'] ?? 0,$this->param['id']);
$this->setServers($this->param['serve_id'],$this->param['id']);
//保存项目信息
$this->saveProject($this->param);
//保存建站部署信息
... ... @@ -157,6 +159,8 @@ class ProjectLogic extends BaseLogic
$this->saveProjectPayment($this->param['payment']);
//保存优化信息
$this->saveProjectDeployOptimize($this->param['deploy_optimize']);
//保存项目关键字
$this->saveProjectKeyword($this->param['project_keyword'] ?? [],$this->param['id']);
//保存售后信息
$this->saveProjectAfter($this->param['project_after']);
//单独保存小语种配置
... ... @@ -354,6 +358,30 @@ class ProjectLogic extends BaseLogic
}
/**
* @remark :保存项目关键字
* @name :saveProjectKeyword
* @author :lyh
* @method :post
* @time :2024/7/22 11:45
*/
public function saveProjectKeyword($project_keyword,$project_id){
$projectKeywordModel = new ProjectKeyword();
$info = $projectKeywordModel->read(['project_id'=>$project_id]);
$data = [
'main_keyword'=>$project_keyword['main_keyword'] ?? '',
'customer_keywords'=>$project_keyword['customer_keywords'] ?? '',
'search_keywords'=>$project_keyword['search_keywords'] ?? '',
];
if($info === false){
$data['project_id'] = $project_id;
$projectKeywordModel->addReturnId($data);
}else{
$projectKeywordModel->edit($data,['id'=>$info['id']]);
}
return $this->success();
}
/**
* @remark :保存为售后部署
* @name :saveProjectAfter
* @author :lyh
... ...
... ... @@ -16,18 +16,15 @@ class TaskOwnerLogic extends BaseLogic
public function __construct()
{
parent::__construct();
$this->model = new TaskOwner();
}
public function save($param){
//获取已分配了的
$manage_ids = $this->model->where('task_id', $param['task_id'])->pluck('manage_id', 'id')->toArray();
//待删除的
$del_manage_ids = array_diff($manage_ids, $param['manage_ids']);
$this->delete(array_keys($del_manage_ids));
//新增的
$add_manage_ids = array_diff($param['manage_ids'], $manage_ids);
foreach ($add_manage_ids as $add_manage_id){
... ...
... ... @@ -8,6 +8,7 @@ use App\Helper\Translate;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\Ai\AiCommand;
use App\Models\Project\DeployOptimize;
use App\Models\Project\ProjectKeyword;
use App\Models\WebSetting\WebLanguage;
use Illuminate\Support\Facades\Cache;
... ... @@ -43,14 +44,14 @@ class AiCommandLogic extends BaseLogic
$prompt = str_replace('{company name}', $company_name, $prompt);
}
if(strpos($prompt, '{core keywords 8}') !== false) {
$main_keywords = $this->getDeployOptimize('main_keywords');
if ($main_keywords) {
$main_keywords = explode("\r\n", $main_keywords);
$main_keyword = $this->getDeployOptimize('main_keyword');
if ($main_keyword) {
$main_keyword = explode("\r\n", $main_keyword);
//随机取
shuffle($main_keywords);
$main_keywords = array_slice($main_keywords, 0, 8);
$main_keywords = implode(", ", $main_keywords);
$prompt = str_replace('{core keywords 8}', $main_keywords, $prompt);
shuffle($main_keyword);
$main_keyword = array_slice($main_keyword, 0, 8);
$main_keyword = implode(", ", $main_keyword);
$prompt = str_replace('{core keywords 8}', $main_keyword, $prompt);
}else{
$prompt = '';
}
... ... @@ -99,7 +100,13 @@ class AiCommandLogic extends BaseLogic
$info = Cache::get($cache_key);
if(!$info){
$projectOptimizeModel = new DeployOptimize();
$info = $projectOptimizeModel->read(['project_id' => $project_id], ['id', 'company_en_name', 'company_en_description', 'main_keywords']);
$info = $projectOptimizeModel->read(['project_id' => $project_id], ['id', 'company_en_name', 'company_en_description']);
$projectKeywordModel = new ProjectKeyword();
$keywordInfo = $projectKeywordModel->read(['project_id'=>$project_id]);
$info['main_keyword'] = '';
if($keywordInfo === false){
$info['main_keyword'] = $keywordInfo['main_keyword'];
}
Cache::put($cache_key, $info, 600);
}
if($key){
... ...
... ... @@ -66,7 +66,7 @@ class AyrReleaseLogic extends BaseLogic
$arr[] = getImageUrl($v1);
}
}else{
$arr[] = getFileUrl($v);
$arr[] = getFileUrl($v,$this->user['storage_type'] ?? 0,$this->user['project_location'] ?? 0,1);
}
}
}
... ...
... ... @@ -442,36 +442,34 @@ class BTemplateLogic extends BaseLogic
*/
public function handleVisualizationParam($html,$source, $is_list,$is_custom,$data){
if($this->user['is_customized'] == BTemplate::IS_VISUALIZATION){//定制项目
$type = $this->getCustomizedType($source, $is_list);//获取定制界面类型
//查看当前页面是否定制,是否开启可视化
$page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面
if (in_array($type, $page_array)) {//当前页面是定制界面
$data['html'] = $html;
$data['type'] = BTemplate::ALL_HTML;
//TODO::扩展模块定制单独处理
if($is_custom == BTemplate::IS_CUSTOM){
$customModuleModel = new CustomModule();
$info = $customModuleModel->read(['id'=>$source]);
if($info === false){
$this->fail('当前扩展模块不存在或已被删除');
}
//todo::扩展模块(列表页/详情页)定制
if($info['list_customized'] == BTemplate::IS_VISUALIZATION || $info['detail_customized'] == BTemplate::IS_VISUALIZATION) {
$data['html'] = $html;
$data['type'] = BTemplate::ALL_HTML;
return $this->success($data);
}
}else{
//TODO::扩展模块定制单独处理
if($is_custom == BTemplate::IS_CUSTOM){
$customModuleModel = new CustomModule();
$info = $customModuleModel->read(['id'=>$source]);
if($info === false){
$this->fail('当前扩展模块不存在或已被删除');
}
//todo::扩展模块(列表页/详情页)定制
if($info['list_customized'] == BTemplate::IS_VISUALIZATION || $info['detail_customized'] == BTemplate::IS_VISUALIZATION) {
$data['html'] = $html;
$data['type'] = BTemplate::ALL_HTML;
}
$type = $this->getCustomizedType($source, $is_list);//获取定制界面类型
//查看当前页面是否定制,是否开启可视化
$page_array = (array)$this->user['is_visualization']->page_array;//获取所有定制界面
if (in_array($type, $page_array)) {//当前页面是定制界面
$data['html'] = $html;
$data['type'] = BTemplate::ALL_HTML;
return $this->success($data);
}
$mainInfo = $this->handleTemplateHtml($html);
$data['main_html'] = $mainInfo['main_html'];
$data['main_css'] = $mainInfo['main_css'];
}
}else{
$mainInfo = $this->handleTemplateHtml($html);
$data['main_html'] = $mainInfo['main_html'];
$data['main_css'] = $mainInfo['main_css'];
}
return $data;
$mainInfo = $this->handleTemplateHtml($html);
$data['main_html'] = $mainInfo['main_html'];
$data['main_css'] = $mainInfo['main_css'];
return $this->success($data);
}
/**
... ...
... ... @@ -68,6 +68,9 @@ class CustomTemplateLogic extends BaseLogic
if(($this->project['deploy_build']['is_search'] == 0) && ($this->param['url'] == 'search')){
$this->fail('请先开启搜索页可视化');
}
if(($this->project['deploy_build']['is_keyword'] == 0) && ($this->param['url'] == 'keyword')){
$this->fail('请先开启聚合页可视化');
}
if(isset($this->param['id']) && !empty($this->param['id'])){
$id = $this->param['id'];
$is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
... ...
... ... @@ -30,28 +30,21 @@ class BlogLogic extends BaseLogic
*/
public function blogSave(){
//拼接参数
DB::beginTransaction();
try {
$this->param = $this->paramProcessing($this->param);
if(isset($this->param['id']) && !empty($this->param['id'])){
$id = $this->param['id'];
$is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
$six_read = $this->param['six_read'] ?? 0;//是否按6.0显示
if($is_upgrade == 0 || $six_read == 1){
$this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']);
}
$route = $this->param['url'];
$this->edit($this->param,['id'=>$id]);
}else{
$this->param['sort'] = $this->setNewsSort();
$id = $this->model->addReturnId($this->param);
$route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']);
$this->edit(['url'=>$route],['id'=>$id]);
$this->param = $this->paramProcessing($this->param);
if(isset($this->param['id']) && !empty($this->param['id'])){
$id = $this->param['id'];
$is_upgrade = $this->param['is_upgrade'] ?? 0;//1:5.0数据 0:6.0
$six_read = $this->param['six_read'] ?? 0;//是否按6.0显示
if($is_upgrade == 0 || $six_read == 1){
$this->param['url'] = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']);
}
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('系统错误,请联系管理员');
$route = $this->param['url'];
$this->edit($this->param,['id'=>$id]);
}else{
$this->param['sort'] = $this->setNewsSort();
$id = $this->model->addReturnId($this->param);
$route = RouteMap::setRoute($this->param['url'], RouteMap::SOURCE_BLOG, $id, $this->user['project_id']);
$this->edit(['url'=>$route],['id'=>$id]);
}
$this->addUpdateNotify(RouteMap::SOURCE_BLOG,$route);
$this->curlDelRoute(['new_route'=>$route]);
... ... @@ -431,7 +424,7 @@ class BlogLogic extends BaseLogic
public function copyBlogInfo(){
$info = $this->model->read(['id'=>$this->param['id']]);
$param = [
'name'=>$info['name']."-copy",
'name'=>$info['name']."-1",
'status'=>0,
'sort'=>$info['sort'],
'category_id'=>$info['category_id'],
... ...
... ... @@ -94,7 +94,7 @@ class CustomModuleContentLogic extends BaseLogic
}elseif($v['type'] == 4){
$arr1 = json_decode($info['values']);
foreach ($arr1 as $k1=>$v1){
$v1 = getFileUrl($v1,$this->user['storage_type'],$this->user['project_location']);
$v1 = getFileUrl($v1,$this->user['storage_type'],$this->user['project_location'],$this->user['file_cdn'] ?? 0);
$arr1[$k1] = $v1;
}
$v['values'] = $arr1;
... ...
... ... @@ -60,8 +60,8 @@ class CountLogic extends BaseLogic
public function scheme_info(){
$data = [
'company'=>$this->project['company'] ?? '',
'scheme'=>Project::planMap()[$this->project['deploy_build']['plan']],
'service_duration'=>$this->project['deploy_build']['service_duration'],
'scheme'=>!empty($this->project['deploy_build']['plan']) ? Project::planMap()[$this->project['deploy_build']['plan']] : '',
'service_duration'=>$this->project['deploy_build']['service_duration'] ?? 0,
];
return $this->success($data);
}
... ...
... ... @@ -8,6 +8,7 @@ use App\Models\HomeCount\Count;
use App\Models\HomeCount\MonthCount;
use App\Models\Inquiry\InquiryFormData;
use App\Models\Project\DeployOptimize;
use App\Models\Project\ProjectKeyword;
use App\Services\ProjectServer;
use Carbon\Carbon;
use Illuminate\Support\Facades\DB;
... ... @@ -85,8 +86,14 @@ class MonthCountLogic extends BaseLogic
* @time :2023/7/4 10:19
*/
public function getKeywordLists(){
$optimizeModel = new DeployOptimize();
$info = $optimizeModel->read(['project_id'=>$this->user['project_id']],['main_keywords','customer_keywords']);
$projectKeywordModel = new ProjectKeyword();
$info = $projectKeywordModel->read(['project_id'=>$this->user['project_id']],['main_keyword','customer_keywords']);
if($info === false){
$info = [
'main_keyword'=>'',
'customer_keywords'=>''
];
}
return $this->success($info);
}
}
... ...
... ... @@ -462,7 +462,7 @@ class NewsLogic extends BaseLogic
public function copyNewsInfo(){
$info = $this->model->read(['id'=>$this->param['id']]);
$param = [
'name'=>$info['name']."-copy",
'name'=>$info['name']."-1",
'status'=>0,
'sort'=>$info['sort'],
'category_id'=>$info['category_id'],
... ...
... ... @@ -127,6 +127,9 @@ class KeywordLogic extends BaseLogic
if(!empty($param['related_blog_ids'])){
$param['related_blog_ids'] = Arr::arrToSet($param['related_blog_ids'] ?? []);
}
if(!isset($param['is_video_keyword']) || $param['is_video_keyword'] == null){
$param['is_video_keyword'] = 0;
}
return $param;
}
... ...
... ... @@ -299,12 +299,14 @@ class ProductLogic extends BaseLogic
}
if(isset($param['keyword_id']) && !empty($param['keyword_id'])){
$param['keyword_id'] = ','.Arr::arrToSet($param['keyword_id']).',';
}else{
$param['keyword_id'] = '';
}
$param['attrs'] = Arr::a2s($param['attrs'] ?? []);
$param['attr_id'] = Arr::arrToSet($param['attr_id'] ?? '');
$param['describe'] = Arr::a2s($param['describe'] ?? []);
$param['describe_id'] = Arr::arrToSet($param['describe_id'] ?? '');
$param['seo_mate'] = Arr::a2s($param['seo_mate'] ?? '');
$param['seo_mate'] = Arr::a2s($param['seo_mate'] ?? []);
$param['related_product_id'] = Arr::arrToSet($param['related_product_id'] ?? '');
if(isset($param['icon'])){
foreach ($param['icon'] as $k1 => $v1){
... ... @@ -395,7 +397,11 @@ class ProductLogic extends BaseLogic
foreach ($data as $k => $v){
$map = [];
$cateModel = new Category();
$cateList = $cateModel->list(['status'=>1],'id',['id','pid']);
$status = [];
if($v != 3){
$status = ['status'=>$v];
}
$cateList = $cateModel->list($status,'id',['id','pid']);
$this->param['featured_status'] = $this->param['featured_status'] ?? 0;
if(!empty($cateList) && ($this->param['featured_status'] != $cateModel::STATUS_ACTIVE)){
$featured_ids = $cateModel->where('title', 'like', 'Featured%')->pluck('id')->toArray();
... ... @@ -406,8 +412,8 @@ class ProductLogic extends BaseLogic
}
if(!empty($featured_arr)){
$cateRelated = new CategoryRelated();
$product_ids = $cateRelated->whereNotIn('cate_id',$featured_arr)->pluck('product_id')->unique()->toArray();
$map['id'] = ['in',$product_ids];
$product_ids = $cateRelated->whereIn('cate_id',$featured_arr)->pluck('product_id')->unique()->toArray();
$map['id'] = ['not in',$product_ids];
}
}
if($v == 3){
... ... @@ -430,16 +436,51 @@ class ProductLogic extends BaseLogic
public function setCopyProduct(){
$info = $this->model->read(['id'=>$this->param['id']]);
$param = $this->setProductParams($info);
$save_id = $this->model->insertGetId($param);
$route = preg_replace('/-product.*/', '', $param['route']);
$route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT, $save_id, $this->user['project_id']);
$this->model->edit(['route'=>$route],['id'=>$save_id]);
//同步可视化装修数据
$this->copyTemplate($this->param['id'],$info['project_id'],$save_id);
DB::beginTransaction();
try {
$save_id = $this->model->insertGetId($param);
CategoryRelated::saveRelated($save_id, $info['category_id']);
$route = preg_replace('/-product.*/', '', $param['route']);
//同步分类关联表
$route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT, $save_id, $this->user['project_id']);
$this->model->edit(['route'=>$route],['id'=>$save_id]);
//同步可视化装修数据
$this->copyTemplate($this->param['id'],$info['project_id'],$save_id);
//同步扩展字段
$this->copyExtendInfo($info['id'],$save_id);
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('复制失败,请联系管理员');
}
return $this->success(['id'=>$save_id]);
}
/**
* @remark :复制项目扩展字段
* @name :copyExtendInfo
* @author :lyh
* @method :post
* @time :2024/7/12 9:23
*/
public function copyExtendInfo($old_id,$new_id){
$extendInfoModel = new ExtendInfo();
$extendList = $extendInfoModel->list(['product_id'=>$old_id],'created_at');
if(!empty($extendList)){
$data = [];
foreach ($extendList as $k => $v){
unset($v['id']);
$v['product_id'] = $new_id;
$v['created_at'] = date('Y-m-d H:i:s');
$v['updated_at'] = date('Y-m-d H:i:s');
$data[] = $v;
}
return $extendInfoModel->insert($data);
}
return $this->success();
}
/**
* @remark :同步模版数据
* @name :copyTemplate
* @author :lyh
... ... @@ -498,7 +539,7 @@ class ProductLogic extends BaseLogic
public function setProductParams($info){
$param = [
'project_id'=>$info['project_id'],
'title'=>$info['title']."-copy",
'title'=>$info['title']."-1",
'attrs'=>Arr::a2s($info['attrs']),
'attr_id'=>Arr::arrToSet($info['attr_id']),
'category_id'=>!empty($info['category_id']) ? ','.Arr::arrToSet($info['category_id']).',' : '',
... ... @@ -860,16 +901,16 @@ class ProductLogic extends BaseLogic
*/
public function getSearchCategoryList()
{
$data = [];
$categoryModel = new Category();
$this->param['deleted_at'] = null;
$this->param['featured_status'] = $this->param['featured_status'] ?? 0;
if(($this->param['featured_status'] != Category::STATUS_ACTIVE)) {
$this->param['title'] = ['not like','%Featured%'];
$this->param['title'] = ['not like','Featured%'];
}
unset($this->param['featured_status']);
$list = $categoryModel->list($this->param, ['sort', 'id'], ['id', 'pid', 'title']);
if (!empty($list)) {
$data = [];
foreach ($list as $v) {
$v = (array)$v;
if ($v['pid'] == 0) {
... ...
... ... @@ -34,7 +34,7 @@ class RatingLogic extends BaseLogic
*/
public function getRatingRead(){
$data = [
'company'=>$this->project['company'],
'company'=>$this->project['company'] ?? '',
'mobile'=>$this->user['mobile'],
'uptime'=>$this->project['uptime'],
'domain'=>$this->user['domain'],
... ...
... ... @@ -80,6 +80,9 @@ class TranslateLogic extends BaseLogic
if(!empty($arr2)){
$i = 0;
TranslateText:
if($languageInfo['short'] == 'zh-ct'){
$languageInfo['short'] = 'zh-TW';
}
$translate_list = Translate::tran($arr2, $languageInfo['short']);
if(empty($translate_list)){
if ($i < 3) {
... ... @@ -313,7 +316,7 @@ class TranslateLogic extends BaseLogic
if(strtolower($route) == 'all'){
return $this->success($data);
}
if($route == 'index'){
if($route == 'index' || $route == '/'){
$data['source'] = 1;
return $this->success($data);
}
... ...
... ... @@ -177,6 +177,7 @@ class UserLoginLogic
$info['project_location'] = $project['project_location'];
$info['is_update_language'] = $project['is_update_language'];
$info['configuration'] = $project['deploy_build']['configuration'];
$info['file_cdn'] = $project['deploy_build']['file_cdn'];
$info['project_type'] = $project['type'];
$info['service_duration'] = $project['deploy_build']['service_duration'];
$info['remain_day'] = $project['remain_day'];
... ... @@ -279,6 +280,7 @@ class UserLoginLogic
$info['project_type'] = $project['type'];
$info['storage_type'] = $project['storage_type'];
$info['project_location'] = $project['project_location'];
$info['file_cdn'] = $project['deploy_build']['file_cdn'];
$info['service_duration'] = $project['deploy_build']['service_duration'] ?? 0;
$info['remain_day'] = $project['remain_day'] ?? 0;
if($info['is_customized'] == 1){
... ...
<?php
/**
* @remark :
* @name :ManagerHrRequest.php
* @author :lyh
* @method :post
* @time :2024/7/10 15:59
*/
namespace App\Http\Requests\Aside\Manage;
use App\Models\Manage\Manage;
use App\Rules\Mobile;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class ManagerHrRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'name'=>'required',
'mobile'=>'required',
// 'status'=>'required',
// 'education'=>'required',
// 'entry_position'=>'required',
// 'p_level'=>'required',
// 'dept_id'=>'required',
// 'belong_group'=>'required',
];
}
public function messages()
{
return [
'name.required' => '名称不能为空',
'mobile.required' => '手机号码不能为空',
// 'status.required' => '请选择用户状态',
// 'education.required' => '请选择学历',
// 'entry_position.required' => '请选择入职岗位',
// 'belong_group.required' => '请选择小组',
// 'p_level.required' => '请选择入职岗位级别',
// 'dept_id.required' => '请选择部门',
];
}
}
... ...
... ... @@ -26,7 +26,9 @@ class BlogRequest extends FormRequest
return [
'name'=>'required|max:200',
'seo_keywords'=>'max:500',
'remark'=>'max:1000',
'url'=>'required',
// 'text'=>'max:5000',
];
}
... ... @@ -36,7 +38,9 @@ class BlogRequest extends FormRequest
'name.required'=>'请填写名称',
'name.max'=>'名称超过最长长度200',
'url.required'=>'链接不能为空',
'seo_keywords.max'=>'seo_keywords太长,请重新编辑'
'seo_keywords.max'=>'seo_keywords太长,请重新编辑',
'remark.max'=>'描述超过最长长度1000',
// 'text.max'=>'详情内容超过最大长度',
];
}
}
... ...
... ... @@ -25,7 +25,7 @@ class NewsRequest extends FormRequest
{
return [
'name'=>'required|max:200',
// 'remark'=>'max:500',
'remark'=>'max:1000',
'url'=>'required',
];
}
... ... @@ -36,7 +36,7 @@ class NewsRequest extends FormRequest
'name.required'=>'请填写名称',
'name.max'=>'名称超过最长长度200',
'url.required'=>'链接不能为空',
// 'remark.max'=>'描述超过最长长度500'
'remark.max'=>'描述超过最长长度1000'
];
}
}
... ...
... ... @@ -67,7 +67,8 @@ class EditAmpDomainBt implements ShouldQueue
$api_param_amp = [
'domain' => $domain_info['domain'],
'not_allow_country' => $domain_info['not_allow_country'],
'not_allow_ip' => $domain_info['not_allow_ip']
'not_allow_ip' => $domain_info['not_allow_ip'],
'is_redirect' => $domain_info['is_redirect']
];
if ($domain_info['amp_type'] == 2) {
$api_param_amp['private_key'] = $domain_info['amp_private_key'];
... ...
... ... @@ -74,7 +74,8 @@ class EditDomainBt implements ShouldQueue
'other_domain' => $domain_info['other_domain'],
'is_https' => $domain_info['is_https'],
'not_allow_country' => $domain_info['not_allow_country'],
'not_allow_ip' => $domain_info['not_allow_ip']
'not_allow_ip' => $domain_info['not_allow_ip'],
'is_redirect' => $domain_info['is_redirect']
];
} else {
$api_url = 'http://' . $server_info['domain'] . '/api/applySsl';
... ... @@ -84,7 +85,8 @@ class EditDomainBt implements ShouldQueue
'other_domain' => $domain_info['other_domain'],
'is_https' => $domain_info['is_https'],
'not_allow_country' => $domain_info['not_allow_country'],
'not_allow_ip' => $domain_info['not_allow_ip']
'not_allow_ip' => $domain_info['not_allow_ip'],
'is_redirect' => $domain_info['is_redirect']
];
}
... ...
... ... @@ -274,4 +274,15 @@ class Base extends Model
}, ARRAY_FILTER_USE_KEY);
}
/**
* @remark :查询一个字段返回数组
* @name :selectField
* @author :lyh
* @method :post
* @time :2024/7/15 17:11
*/
public function selectField($data,$filed){
$data = $this->filterRequestData($data);
return $this->formatQuery($data)->pluck($filed)->toArray();
}
}
... ...
... ... @@ -10,6 +10,8 @@
namespace App\Models\Com;
use App\Models\Base;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Cache;
class KeywordVideoTaskLog extends Base
{
... ... @@ -19,4 +21,26 @@ class KeywordVideoTaskLog extends Base
const STATUS_ERROR = 3;
protected $table = 'gl_keyword_video_task_log';
/**
* 获取当月视频生成数量
* FIXME 混剪视频订阅计划 50000/m
* @return mixed
*/
public static function getMonthVideoNum()
{
$key = 'video_keyword_number_month';
$num = Cache::get($key, function () use ($key) {
$this_day = date('d');
if($this_day >= 13) {
$start_date = Carbon::now()->day(13)->format('Y-m-d 00:00:00');
} else {
$start_date = Carbon::now()->subMonth()->day(13)->format('Y-m-d 00:00:00');
}
$num = self::where('created_at', '>', $start_date)->count();
Cache::put($key, $num, 3600);
return $num;
});
return $num;
}
}
... ...
... ... @@ -14,6 +14,7 @@ class Notify extends Base
const STATUS_FINISH_ROUTE = 1;
const STATUS_FINISH_PAGE = 2;
const STATUS_FINISH_SITEMAP = 3;
const STATUS_ING_SITEMAP = 4;
const STATUS_ERROR = 9;
/**
... ... @@ -75,11 +76,12 @@ class Notify extends Base
public static function statusMap()
{
return [
self::STATUS_INIT => '排队中',
self::STATUS_INIT => '页面排队中',
self::STATUS_FINISH_ROUTE => '页面生成中',
self::STATUS_FINISH_PAGE => 'sitemap生成中',
self::STATUS_FINISH_PAGE => 'sitemap排队中',
self::STATUS_ING_SITEMAP => 'sitemap生成中',
self::STATUS_FINISH_SITEMAP => '完成',
self::STATUS_ERROR => 'sitemap生成失败',
self::STATUS_ERROR => '失败',
];
}
}
... ...
... ... @@ -16,6 +16,7 @@ class Keyword extends Base
//连接数据库
protected $connection = 'custom_mysql';
const STATUS_ACTIVE = 1;
/**
* @remark :视频
* @name :getKeywordVideoAttribute
... ...
... ... @@ -231,7 +231,17 @@ class Project extends Base
return self::hasOne(After::class, 'project_id', 'id');
}
/**
* @remark :项目关键字
* @name :project_keyword
* @author :lyh
* @method :post
* @time :2024/7/22 11:38
*/
public function project_keyword()
{
return self::hasOne(ProjectKeyword::class, 'project_id', 'id');
}
/**
* 询盘过滤配置
* @return \Illuminate\Database\Eloquent\Relations\HasOne
... ...
<?php
/**
* @remark :
* @name :ProjectKeyword.php
* @author :lyh
* @method :post
* @time :2024/7/22 11:35
*/
namespace App\Models\Project;
use App\Models\Base;
class ProjectKeyword extends Base
{
//设置关联表名
protected $table = 'gl_project_keyword';
}
... ...
... ... @@ -169,7 +169,7 @@ return [
],
//操作日志
'operator_log' =>[
'log'=>false,//true开启
'log'=>true,//true开启
'action' => [],//不需要写入日志的方法
],
];
... ...
... ... @@ -9,10 +9,10 @@ use Illuminate\Support\Facades\Route;
Route::middleware(['aloginauth'])->group(function () {
Route::get('/', [Aside\Com\IndexController::class, 'index'])->name('admin.home.white');
Route::get('/get_menu', [Aside\Com\IndexController::class, 'get_menu'])->name('admin.get_menu.white');
Route::any('/', [Aside\Com\IndexController::class, 'index'])->name('admin.home.white');
Route::any('/get_menu', [Aside\Com\IndexController::class, 'get_menu'])->name('admin.get_menu.white');
Route::any('/editPassword', [Aside\Com\IndexController::class, 'editPassword'])->name('admin.editPassword.white');
Route::get('/logout', [Aside\LoginController::class, 'logout'])->name('admin.logout.white');
Route::any('/logout', [Aside\LoginController::class, 'logout'])->name('admin.logout.white');
Route::any('/getAccessAddress', [Aside\LoginController::class, 'getAccessAddress'])->name('admin.getAccessAddress');//获取B端地址
Route::any('/sendNotify', [Aside\Com\CNoticeController::class, 'sendNotify'])->name('admin.sendNotify');
Route::any('/getCountry', [Aside\Com\CNoticeController::class, 'getCountry'])->name('admin.getCountry');
... ... @@ -106,8 +106,8 @@ Route::middleware(['aloginauth'])->group(function () {
//菜单
Route::prefix('menu')->group(function () {
Route::get('/', [Aside\Manage\MenuController::class, 'list'])->name('admin.menu');
Route::get('/info', [Aside\Manage\MenuController::class, 'info'])->name('admin.menu_info');
Route::any('/', [Aside\Manage\MenuController::class, 'list'])->name('admin.menu');
Route::any('/info', [Aside\Manage\MenuController::class, 'info'])->name('admin.menu_info');
Route::post('/save', [Aside\Manage\MenuController::class, 'save'])->name('admin.menu_save');
Route::any('/delete', [Aside\Manage\MenuController::class, 'delete'])->name('admin.menu_delete');
Route::any('/sort', [Aside\Manage\MenuController::class, 'setSort'])->name('admin.menu_sort');
... ... @@ -122,27 +122,27 @@ Route::middleware(['aloginauth'])->group(function () {
});
//权限组
Route::prefix('group')->group(function () {
Route::get('/', [Aside\Manage\GroupController::class, 'list'])->name('admin.group');
Route::get('/info', [Aside\Manage\GroupController::class, 'info'])->name('admin.group_info');
Route::any('/', [Aside\Manage\GroupController::class, 'list'])->name('admin.group');
Route::any('/info', [Aside\Manage\GroupController::class, 'info'])->name('admin.group_info');
Route::post('/save', [Aside\Manage\GroupController::class, 'save'])->name('admin.group_save');
Route::any('/delete', [Aside\Manage\GroupController::class, 'delete'])->name('admin.group_delete');
});
//部门
Route::prefix('dept')->group(function () {
Route::get('/', [Aside\Manage\DeptController::class, 'lists'])->name('admin.dept');
Route::get('/info', [Aside\Manage\DeptController::class, 'info'])->name('admin.dept_info');
Route::any('/', [Aside\Manage\DeptController::class, 'lists'])->name('admin.dept');
Route::any('/info', [Aside\Manage\DeptController::class, 'info'])->name('admin.dept_info');
Route::post('/save', [Aside\Manage\DeptController::class, 'save'])->name('admin.dept_save');
Route::any('/delete', [Aside\Manage\DeptController::class, 'delete'])->name('admin.dept_delete');
});
//人事管理
Route::prefix('hr')->group(function () {
Route::get('/', [Aside\Manage\HrController::class, 'list'])->name('admin.hr');
Route::get('/info', [Aside\Manage\HrController::class, 'info'])->name('admin.hr_info');
Route::any('/', [Aside\Manage\HrController::class, 'list'])->name('admin.hr');
Route::any('/info', [Aside\Manage\HrController::class, 'info'])->name('admin.hr_info');
Route::post('/save', [Aside\Manage\HrController::class, 'save'])->name('admin.hr_save');
Route::post('/sort', [Aside\Manage\HrController::class, 'sort'])->name('admin.hr_sort');
Route::get('/getSearchParamsList', [Aside\Manage\HrController::class, 'getSearchParamsList'])->name('admin.hr_getSearchParamsList');
Route::any('/getSearchParamsList', [Aside\Manage\HrController::class, 'getSearchParamsList'])->name('admin.hr_getSearchParamsList');
});
//管理员日志
... ... @@ -159,8 +159,8 @@ Route::middleware(['aloginauth'])->group(function () {
//项目管理
Route::prefix('project')->group(function () {
Route::get('/', [Aside\Project\ProjectController::class, 'lists'])->name('admin.project');
Route::get('/info', [Aside\Project\ProjectController::class, 'info'])->name('admin.project_info');
Route::any('/', [Aside\Project\ProjectController::class, 'lists'])->name('admin.project');
Route::any('/info', [Aside\Project\ProjectController::class, 'info'])->name('admin.project_info');
Route::post('/save', [Aside\Project\ProjectController::class, 'save'])->name('admin.project_save');
Route::any('/deleteMinorLanguages', [Aside\Project\ProjectController::class, 'deleteMinorLanguages'])->name('admin.project_deleteMinorLanguages');
Route::any('/inquiry_set', [Aside\Project\ProjectController::class, 'inquiry_set'])->name('admin.project_inquiry_set');
... ... @@ -220,8 +220,8 @@ Route::middleware(['aloginauth'])->group(function () {
});
//工单管理
Route::prefix('task')->group(function () {
Route::get('/', [Aside\Task\TaskController::class, 'list'])->name('admin.task');
Route::get('/info', [Aside\Task\TaskController::class, 'info'])->name('admin.task_info');
Route::any('/', [Aside\Task\TaskController::class, 'list'])->name('admin.task');
Route::any('/info', [Aside\Task\TaskController::class, 'info'])->name('admin.task_info');
Route::post('/save', [Aside\Task\TaskController::class, 'save'])->name('admin.task_save');
Route::post('/status', [Aside\Task\TaskController::class, 'status'])->name('admin.task_status');
Route::post('/save_follow', [Aside\Task\TaskController::class, 'save_follow'])->name('admin.task_save_follow');
... ... @@ -281,6 +281,7 @@ Route::middleware(['aloginauth'])->group(function () {
Route::any('/setRobots', [Aside\Optimize\OptimizeController::class, 'setRobots'])->name('admin.optimize_setRobots');//设置robots开关
Route::any('/editBacklink', [Aside\Optimize\OptimizeController::class, 'editBacklink'])->name('admin.optimize_editBacklink');//设置backlink开关
Route::any('/setAiVideo', [Aside\Optimize\OptimizeController::class, 'setAiVideo'])->name('admin.optimize_setAiVideo');//设置backlink开关
Route::any('/anchorTextList', [Aside\Optimize\OptimizeController::class, 'anchorTextList'])->name('admin.optimize_anchorTextList');//设置backlink开关
Route::any('/editTranslateStatus', [Aside\Optimize\OptimizeController::class, 'editTranslateStatus'])->name('admin.optimize_editTranslateStatus');//设置robots开关
});
//生成关键字
... ...
<?php
/**
* @remark :
* @name :toH.php
* @author :lyh
* @method :post
* @time :2024/7/23 14:14
*/
class toH
{
}
... ...