作者 lyh

gx

正在显示 33 个修改的文件 包含 158 行增加174 行删除
<?php
namespace App\Console\Commands;
namespace App\Console\Commands\Domain;
use App\Models\Devops\DevopsTask as DevopsTaskModel;
use App\Models\Devops\DevopsTaskLog;
use App\Models\Project\Project;
use App\Utils\EncryptUtils;
use Illuminate\Console\Command;
use App\Models\Devops\DevopsTask as DevopsTaskModel;
/**
* Class DevopsTask
... ...
<?php
namespace App\Console\Commands;
namespace App\Console\Commands\Domain;
use App\Helper\Arr;
use App\Models\Product\Category;
use App\Models\Product\Product;
use App\Models\Project\OnlineCheck;
use App\Models\Project\Project;
use App\Models\RankData\RankData as GoogleRankModel;
use App\Models\RouteMap\RouteMap;
use GuzzleHttp\Client;
use GuzzleHttp\Promise\Utils;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
/**
* 剩余服务时长
... ...
... ... @@ -7,7 +7,7 @@
* @time :2024/1/29 15:29
*/
namespace App\Console\Commands;
namespace App\Console\Commands\Domain;
use App\Models\Devops\ServerConfig;
use App\Models\Project\Project;
... ...
... ... @@ -7,11 +7,12 @@
* @time :2023/9/25 15:31
*/
namespace App\Console\Commands;
namespace App\Console\Commands\Import;
use App\Helper\OaGlobalsoApi;
use App\Models\Channel\Channel;
use App\Models\Project\Project;
use Illuminate\Console\Command;
class ImportChannel extends Command
{
/**
... ...
... ... @@ -7,7 +7,7 @@
* @time :2023/8/7 17:47
*/
namespace App\Console\Commands;
namespace App\Console\Commands\Import;
use App\Models\Manage\EntryPosition;
use App\Models\Manage\JobLevel;
... ...
<?php
namespace App\Console\Commands;
namespace App\Console\Commands\Inquiry;
use App\Helper\FormGlobalsoApi;
use App\Models\Inquiry\InquiryFormData;
... ...
<?php
namespace App\Console\Commands;
namespace App\Console\Commands\Project;
use App\Models\Com\NoticeLog;
use App\Models\Product\Keyword;
... ...
<?php
namespace App\Console\Commands;
namespace App\Console\Commands\Project;
use App\Http\Logic\Aside\Project\ProjectLogic;
use App\Models\Com\NoticeLog;
use App\Models\Project\Project;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
/**
* 初始化项目
... ...
<?php
namespace App\Console\Commands;
namespace App\Console\Commands\Project;
use App\Helper\Arr;
use App\Helper\Common;
... ... @@ -21,7 +21,6 @@ use App\Services\ProjectServer;
use App\Utils\LogUtils;
use Hashids\Hashids;
use Illuminate\Console\Command;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Http;
... ...
<?php
namespace App\Console\Commands;
namespace App\Console\Commands\Sync;
use App\Helper\OaGlobalsoApi;
... ...
... ... @@ -7,7 +7,7 @@
* @time :2024/4/17 10:05
*/
namespace App\Console\Commands\SyncFile;
namespace App\Console\Commands\Sync;
use App\Models\File\ErrorFile;
use Illuminate\Console\Command;
... ...
... ... @@ -7,7 +7,7 @@
* @time :2023/12/25 15:00
*/
namespace App\Console\Commands;
namespace App\Console\Commands\Sync;
use App\Models\User\User;
use Illuminate\Console\Command;
... ...
<?php
namespace App\Console\Commands;
namespace App\Console\Commands\Sync;
use App\Exceptions\InquiryFilterException;
use App\Models\Project\Project;
use App\Models\SyncSubmitTask\SyncSubmitTask as SyncSubmitTaskModel;
use App\Services\SyncSubmitTaskService;
use Illuminate\Console\Command;
use App\Models\SyncSubmitTask\SyncSubmitTask as SyncSubmitTaskModel;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
use Illuminate\Support\Facades\Schema;
... ...
<?php
namespace App\Console\Commands;
namespace App\Console\Commands\Tdk;
use App\Services\ProjectServer;
... ...
<?php
namespace App\Console\Commands;
namespace App\Console\Commands\Tdk;
use App\Helper\Arr;
use App\Helper\Common;
use App\Helper\Gpt;
use App\Helper\Translate;
use App\Models\Ai\AiCommand;
use App\Models\Domain\DomainInfo;
use App\Models\Mail\Mail;
... ... @@ -16,7 +15,6 @@ use App\Models\User\User;
use App\Models\WebSetting\WebLanguage;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
... ...
<?php
namespace App\Console\Commands;
namespace App\Console\Commands\Tdk;
use App\Models\Project\Project;
use App\Models\Project\ProjectUpdateTdk;
... ...
... ... @@ -24,6 +24,8 @@ use App\Models\Product\Product;
use App\Models\Project\DeployOptimize;
use App\Models\Project\MinorLanguages;
use App\Models\Project\Project;
use App\Models\RouteMap\RouteMap;
use App\Models\Template\BCustomTemplate;
use App\Models\WebSetting\WebSettingService;
use App\Services\ProjectServer;
use App\Services\SyncService;
... ... @@ -49,6 +51,50 @@ class Demo extends Command
protected $description = 'demo';
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['is_upgrade'=>0]);
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
$this->initSearch($v['id']);
DB::disconnect('custom_mysql');
}
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
}
/**
* @remark :创建search页面
* @name :initSearch
* @author :lyh
* @method :post
* @time :2024/4/25 11:35
*/
public function initSearch($project_id){
$bCustomTemplateModel = new BCustomTemplate();
$info = $bCustomTemplateModel->read(['url'=>'search']);
if($info === false){
$time = date('Y-m-d H:i:s');
$info = DB::connection('custom_mysql')->table('gl_web_custom_template')->first();
if(empty($info)) {
$data = [
'project_id' => $project_id,
'name' => 'search',
'status' => 1,
'url' => 'search',
'html' => '',
'html_style' =>'search',
'title' => 'search',
'description' => 'Sorry. The page has either moved or cannot be found.',
'created_at' => $time, 'updated_at' => $time];
$id = DB::connection('custom_mysql')->table('gl_web_custom_template')->insertGetId($data);
//路由
$info = DB::connection('custom_mysql')->table('gl_route_map')->first();
if(empty($info)) {
$data = ['project_id' => $project_id, 'source' => RouteMap::SOURCE_PAGE, 'source_id' => $id, 'route' => 'search', 'created_at' => $time, 'updated_at' => $time];
DB::connection('custom_mysql')->table('gl_route_map')->insert($data);
}
}
}
return true;
}
}
... ...
... ... @@ -7,7 +7,7 @@
* @time :2023/11/13 10:06
*/
namespace App\Console\Commands;
namespace App\Console\Commands\Test;
use App\Models\Project\Project;
use App\Models\RouteMap\RouteMap;
... ...
... ... @@ -7,7 +7,7 @@
* @time :2023/11/30 10:29
*/
namespace App\Console\Commands;
namespace App\Console\Commands\Test;
use App\Models\WebSetting\WebLanguage;
use Illuminate\Console\Command;
... ...
<?php
namespace App\Console\Commands;
namespace App\Console\Commands\Test;
use App\Models\Project\Project;
use App\Services\ProjectServer;
... ...
<?php
namespace App\Console\Commands;
namespace App\Console\Commands\Test;
... ... @@ -15,9 +15,6 @@ use App\Models\SyncSubmitTask\SyncSubmitTask as SyncSubmitTaskModel;
use App\Models\WebSetting\Translate as TranslateModel;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use mysql_xdevapi\Exception;
/**
* Class Test
... ...
... ... @@ -7,22 +7,15 @@
* @time :2023/11/20 15:07
*/
namespace App\Console\Commands;
namespace App\Console\Commands\Test;
use App\Models\Blog\Blog;
use App\Models\Blog\BlogCategory;
use App\Models\CustomModule\CustomModule;
use App\Models\CustomModule\CustomModuleCategory;
use App\Models\CustomModule\CustomModuleContent;
use App\Models\News\News;
use App\Models\News\NewsCategory;
use App\Models\Product\Category;
use App\Models\Product\Keyword;
use App\Models\Product\Product;
use App\Models\Project\Project;
use App\Models\RouteMap\RouteMap;
use App\Models\Template\BTemplate;
use App\Models\Template\BTemplateMain;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
... ...
... ... @@ -7,7 +7,7 @@
* @time :2023/12/6 16:07
*/
namespace App\Console\Commands;
namespace App\Console\Commands\Test;
use App\Models\Product\Category;
use App\Models\Product\CategoryRelated;
... ...
... ... @@ -7,7 +7,7 @@
* @time :2023/11/1 9:22
*/
namespace App\Console\Commands;
namespace App\Console\Commands\Test;
use App\Models\Mail\Mail;
use App\Models\Project\Project;
... ... @@ -15,8 +15,6 @@ use App\Models\User\User;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
use App\Models\Com\UpdateProgress as UpdateProgressModel;
class UpdateProgress extends Command
{
... ...
... ... @@ -7,18 +7,16 @@
* @time :2023/11/20 15:07
*/
namespace App\Console\Commands;
namespace App\Console\Commands\Test;
use App\Helper\Arr;
use App\Helper\Translate;
use App\Models\CustomModule\CustomModuleCategory;
use App\Models\CustomModule\CustomModuleContent;
use App\Models\Product\CategoryRelated;
use App\Models\Product\Keyword;
use App\Models\Product\Product;
use App\Models\Project\Project;
use App\Models\RouteMap\RouteMap;
use App\Models\Template\BTemplate;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
... ...
<?php
/**
* @remark :
* @name :TranslateRead.php
* @author :lyh
* @method :post
* @time :2024/1/17 16:47
*/
namespace App\Console\Commands;
use App\Models\Project\Project;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class TranslateRead extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'translate_read';
/**
* The console command description.
*
* @var string
*/
protected $description = '生成视频模块';
/**
* @remark :统一更新路由
* @name :handle
* @author :lyh
* @method :post
* @time :2023/11/20 15:13
*/
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['type'=>['!=',0]]);
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
DB::disconnect('custom_mysql');
}
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
}
public function read(){
}
}
<?php
namespace App\Console\Commands;
namespace App\Console\Commands\WebTraffic;
use App\Helper\Arr;
use App\Models\Product\Category;
... ... @@ -8,7 +8,6 @@ use App\Models\Product\Product;
use App\Models\Project\OnlineCheck;
use App\Models\Project\Project;
use App\Models\Project\WebTrafficConfig;
use App\Models\Template\BCustomTemplate;
use App\Models\WebSetting\WebLanguage;
use App\Services\ProjectServer;
use Carbon\Carbon;
... ...
<?php
namespace App\Console\Commands;
namespace App\Console\Commands\WebTraffic;
use App\Helper\Arr;
use App\Models\Product\Category;
... ... @@ -8,7 +8,6 @@ use App\Models\Product\Product;
use App\Models\Project\OnlineCheck;
use App\Models\Project\Project;
use App\Models\Project\WebTrafficConfig;
use App\Models\Template\BCustomTemplate;
use App\Models\WebSetting\WebLanguage;
use App\Services\ProjectServer;
use Carbon\Carbon;
... ...
<?php
namespace App\Console\Commands;
namespace App\Console\Commands\WebTraffic;
use App\Helper\Arr;
use App\Models\Product\Category;
... ... @@ -8,10 +8,8 @@ use App\Models\Product\Product;
use App\Models\Project\OnlineCheck;
use App\Models\Project\Project;
use App\Models\Project\WebTrafficConfig;
use App\Models\Template\BCustomTemplate;
use App\Models\WebSetting\WebLanguage;
use App\Services\ProjectServer;
use Carbon\Carbon;
use GuzzleHttp\Client;
use GuzzleHttp\Promise\Utils;
use Illuminate\Console\Command;
... ...
<?php
namespace App\Console\Commands;
namespace App\Console\Commands\WebTraffic;
use App\Helper\Arr;
use App\Models\Product\Category;
... ... @@ -8,10 +8,8 @@ use App\Models\Product\Product;
use App\Models\Project\OnlineCheck;
use App\Models\Project\Project;
use App\Models\Project\WebTrafficConfig;
use App\Models\Template\BCustomTemplate;
use App\Models\WebSetting\WebLanguage;
use App\Services\ProjectServer;
use Carbon\Carbon;
use GuzzleHttp\Client;
use GuzzleHttp\Promise\Utils;
use Illuminate\Console\Command;
... ...
... ... @@ -2,19 +2,34 @@
namespace App\Http\Logic\Aside\Project;
use App\Console\Commands\Languages;
use App\Enums\Common\Code;
use App\Events\CopyImageFile;
use App\Events\CopyProject;
use App\Exceptions\AsideGlobalException;
use App\Helper\Arr;
use App\Helper\Common;
use App\Helper\FormGlobalsoApi;
use App\Http\Logic\Aside\BaseLogic;
use App\Http\Logic\Aside\Domain\DomainInfoLogic;
use App\Jobs\CopyImageFileJob;
use App\Jobs\CopyProjectJob;
use App\Models\Channel\Channel;
use App\Models\Channel\User;
use App\Models\Channel\Zone;
use App\Models\Com\NoticeLog;
use App\Models\Com\UpdateLog;
use App\Models\Devops\ServerConfig;
use App\Models\Domain\DomainInfo;
use App\Models\Inquiry\InquiryIP;
use App\Models\Inquiry\InquirySet;
use App\Models\Manage\Manage;
use App\Models\Project\After;
use App\Models\Project\DeployBuild;
use App\Models\Project\DeployOptimize;
use App\Models\Project\InquiryFilterConfig;
use App\Models\Project\MinorLanguages;
use App\Models\Project\Payment;
use App\Models\Project\Project;
use App\Models\Project\ProjectRenew;
use App\Models\Project\WebTrafficConfig;
use App\Models\RankData\ExternalLinks;
... ... @@ -23,38 +38,18 @@ use App\Models\RankData\RankData;
use App\Models\RankData\RankWeek;
use App\Models\RankData\RecommDomain;
use App\Models\RankData\Speed;
use App\Models\Template\Setting;
use App\Models\User\ProjectMenu;
use App\Models\User\ProjectRole;
use App\Models\User\User as UserModel;
use App\Models\WebSetting\WebLanguage;
use App\Services\ProjectServer;
use App\Services\SyncService;
use App\Utils\HttpUtils;
use App\Utils\LogUtils;
use GuzzleHttp\Exception\GuzzleException;
use App\Helper\Arr;
use App\Helper\Common;
use App\Helper\FormGlobalsoApi;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Channel\Channel;
use App\Models\Channel\User;
use App\Models\Channel\Zone;
use App\Models\Domain\DomainInfo;
use App\Models\Inquiry\InquirySet;
use App\Models\Manage\Manage;
use App\Models\Project\After;
use App\Models\Project\DeployBuild;
use App\Models\Project\DeployOptimize;
use App\Models\Project\Payment;
use App\Models\Project\Project;
use App\Models\Task\Task;
use App\Services\ProjectServer;
use Hashids\Hashids;
use App\Models\User\User as UserModel;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Schema;
use App\Http\Logic\Aside\Domain\DomainInfoLogic;
/**
* Class ProjectLogic
... ...
... ... @@ -386,10 +386,8 @@ class CustomTemplateLogic extends BaseLogic
$type = $this->getType();
//还原头部+底部
$commonData = [
'head_html'=>$logInfo['head_html'],
'head_css'=>$logInfo['head_css'],
'footer_html'=>$logInfo['footer_html'],
'footer_css'=>$logInfo['footer_css']
'head_html'=>$logInfo['head_html'], 'head_css'=>$logInfo['head_css'],
'footer_html'=>$logInfo['footer_html'], 'footer_css'=>$logInfo['footer_css']
];
$commonTemplateModel = new BTemplateCommon();
$commonTemplateModel->edit($commonData,['template_id'=>$logInfo['template_id'],'type'=>$type,'project_id'=>$this->user['project_id']]);
... ...
... ... @@ -21,6 +21,33 @@ use Illuminate\Support\Facades\Schema;
*/
class ProjectServer
{
public static $main404Html = '<main>
<section data-section="section" data-screen="screen-large" class="section-404-wrap-block section-block-error404"
id="sectionIdyxqu938">
<div class="layout" data-unable="demo01-error404">
<img src="https://ecdn6.globalso.com/upload/m/image_other/2023-10/6528a87e594db30162.png" />
</div>
<p style="text-align: center">SORRY. THE PAGE HAS EITHER MOVED OR CANNOT BE FOUND.</p>
<style>
.section-block-error404 .layout {
height: 700px;
display: flex;
align-items: center;
justify-content: center;
}
.section-block-error404 img {
width: 400px;
}
@media only screen and (max-width:500) {
.section-block-error404 img {
max-width: 100%;
}
}
</style>
<script>
</script>
</section>
</main>';
/**
* @param $project_id
* @return Project|false
... ... @@ -105,6 +132,8 @@ class ProjectServer
self::init404Page($project_id);
//初始化模块数据
self::initModule($project_id);
//初始化search页面
self::initSearchPage($project_id);
DB::disconnect('custom_mysql');
return true;
}
... ... @@ -174,39 +203,12 @@ class ProjectServer
$time = date('Y-m-d H:i:s');
$info = DB::connection('custom_mysql')->table('gl_web_custom_template')->first();
if(empty($info)) {
$main_404_html = '<main>
<section data-section="section" data-screen="screen-large" class="section-404-wrap-block section-block-error404"
id="sectionIdyxqu938">
<div class="layout" data-unable="demo01-error404">
<img src="https://ecdn6.globalso.com/upload/m/image_other/2023-10/6528a87e594db30162.png" />
</div>
<p style="text-align: center">SORRY. THE PAGE HAS EITHER MOVED OR CANNOT BE FOUND.</p>
<style>
.section-block-error404 .layout {
height: 700px;
display: flex;
align-items: center;
justify-content: center;
}
.section-block-error404 img {
width: 400px;
}
@media only screen and (max-width:500) {
.section-block-error404 img {
max-width: 100%;
}
}
</style>
<script>
</script>
</section>
</main>';
$data = [
'project_id' => $project_id,
'name' => BCustomTemplate::NOT_FOUND_PAGE_URL,
'status' => 1,
'url' => BCustomTemplate::NOT_FOUND_PAGE_URL,
'html' => $main_404_html,
'html' => self::$main404Html,
'html_style' => '<style id="globalsojs-styles"></style>',
'title' => '404-Page not found',
'description' => 'Sorry. The page has either moved or cannot be found.',
... ... @@ -220,4 +222,35 @@ class ProjectServer
}
}
}
/**
* @remark :初始化search页面
* @name :init404Page
* @author :lyh
* @method :post
* @time :2023/12/29 9:32
*/
public static function initSearchPage($project_id){
$time = date('Y-m-d H:i:s');
$info = DB::connection('custom_mysql')->table('gl_web_custom_template')->first();
if(empty($info)) {
$data = [
'project_id' => $project_id,
'name' => 'search',
'status' => 1,
'url' => 'search',
'html' => '',
'html_style' =>'search',
'title' => 'search',
'description' => 'Sorry. The page has either moved or cannot be found.',
'created_at' => $time, 'updated_at' => $time];
$id = DB::connection('custom_mysql')->table('gl_web_custom_template')->insertGetId($data);
//路由
$info = DB::connection('custom_mysql')->table('gl_route_map')->first();
if(empty($info)) {
$data = ['project_id' => $project_id, 'source' => RouteMap::SOURCE_PAGE, 'source_id' => $id, 'route' => 'search', 'created_at' => $time, 'updated_at' => $time];
DB::connection('custom_mysql')->table('gl_route_map')->insert($data);
}
}
}
}
... ...