作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

... ... @@ -218,9 +218,6 @@ class CopyProject extends Command
ProjectServer::createDatabase($project);
//创建表
$this->initTable($project_id,$new_project_id);
//修改项目状态
$projectModel = new Project();
$projectModel->edit(['delete_status'=>0],['id'=>$new_project_id]);
}
/**
... ...
... ... @@ -299,7 +299,7 @@ class SyncProject extends Command
DB::commit();
}catch (\Exception $e){
DB::rollBack();
throw new \Exception($e->getMessage());
throw new \Exception($e->getMessage() . $e->getFile() . $e->getLine());
}
}
... ...
... ... @@ -73,14 +73,21 @@ class SyncSubmitTaskDistribution extends Command
try {
$table = (new SyncSubmitTaskModel())->getTable();
$new_table = $table . '_backup_' . date('Ymd');
if(Schema::hasTable($new_table)){
$new_table = $table . '_backup_' . date('YmdH');
}
//重命名当前表
Schema::rename($table, $new_table);
//克隆表数据
DB::statement('CREATE TABLE ' . $table . ' LIKE ' . $new_table);
//未入队的写到新表
$list = DB::table($new_table)->where('status', 0)->get();
$page = 1;
while (true){
$list = DB::table($new_table)->where('status', 0)->forPage($page, 5000)->get();
if(!count($list)){
break;
}
$data = [];
foreach ($list as $task) {
$data[] = [
... ... @@ -91,6 +98,8 @@ class SyncSubmitTaskDistribution extends Command
];
}
$data && SyncSubmitTaskModel::insert($data);
$page++;
}
DB::commit();
... ...
... ... @@ -32,36 +32,36 @@ class SyncImage extends Command
protected $description = '同步图片与文件';
// public function handle(){
// $str = $this->getProjectConfig(4240);
// $imageModel = new Image();
// $strImage = '/upload/p/4240/image_other/2025-09/picture-18-copy-3.jpg,/upload/p/4240/image_other/2025-09/picture-17-copy-2.jpg,/upload/p/4240/image_other/2025-09/picture-16-copy-2.jpg,/upload/p/4240/image_other/2025-09/picture-12-copy-3.jpg,/upload/p/4240/image_other/2025-09/picture-5-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-6-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-10-copy-2.jpg,/upload/p/4240/image_other/2025-09/picture-11-copy-2.jpg,/upload/p/4240/image_other/2025-09/4-1.jpg,/upload/p/4240/image_other/2025-09/picture-18-copy-2.jpg,/upload/p/4240/image_other/2025-09/picture-16-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-17-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-15-copy-2.jpg,/upload/p/4240/image_other/2025-09/picture-13-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-14-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-12-copy-2.jpg,/upload/p/4240/image_other/2025-09/picture-10-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-11-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-20-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-18-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-19-copy-1.jpg,/upload/p/4240/image_other/2025-09/image-1-copy.jpg,/upload/p/4240/image_other/2025-09/image-2-copy.jpg,/upload/p/4240/image_other/2025-09/picture-3-copy.jpg,/upload/p/4240/image_other/2025-09/picture-6-copy.jpg,/upload/p/4240/image_other/2025-09/picture-4-copy.jpg,/upload/p/4240/image_other/2025-09/picture-5-copy.jpg,/upload/p/4240/image_other/2025-09/picture-9-copy.jpg,/upload/p/4240/image_other/2025-09/picture-7-copy.jpg,/upload/p/4240/image_other/2025-09/picture-8-copy.jpg,/upload/p/4240/image_other/2025-09/picture-15-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-14-copy.jpg,/upload/p/4240/image_other/2025-09/picture-13-copy.jpg,/upload/p/4240/image_other/2025-09/picture-12-copy-1.jpg,/upload/p/4240/image_other/2025-08/picture-44-copy.jpg,/upload/p/4240/image_other/2025-08/45.jpg,/upload/p/4240/image_other/2025-09/picture-10-copy.jpg,/upload/p/4240/image_other/2025-09/picture-11-copy.jpg,/upload/p/4240/image_other/2025-08/43.jpg,/upload/p/4240/image_other/2025-08/42.jpg,/upload/p/4240/image_other/2025-08/picture-38-copy.jpg,/upload/p/4240/image_other/2025-08/picture-37-copy.jpg,/upload/p/4240/image_other/2025-08/picture-36-copy.jpg,/upload/p/4240/image_other/2025-08/picture-35-copy-1.jpg,/upload/p/4240/image_other/2025-08/picture-30-copy.jpg,/upload/p/4240/image_other/2025-08/29.jpg,/upload/p/4240/image_other/2025-08/28-1.jpg,/upload/p/4240/image_other/2025-08/27-1.jpg,/upload/p/4240/image_other/2025-08/picture-23-copy.jpg,/upload/p/4240/image_other/2025-08/22-1.jpg,/upload/p/4240/image_other/2025-08/21.jpg,/upload/p/4240/image_other/2025-08/17.jpg,/upload/p/4240/image_other/2025-08/16.jpg,/upload/p/4240/image_other/2025-08/picture-15-copy.jpg,/upload/p/4240/image_other/2025-08/11-2.jpg,/upload/p/4240/image_other/2025-08/10-1.jpg,/upload/p/4240/image_other/2025-08/picture-6.jpg,/upload/p/4240/image_other/2025-08/picture-5.jpg,/upload/p/4240/image_other/2025-08/picture-4.jpg,/upload/p/4240/image_other/2025-08/api-standard-welded-pipe.jpg,/upload/p/4240/image_other/2025-08/gb-standard-welded-pipe.jpg,/upload/p/4240/image_other/2025-08/gost-standard-welded-pipe.jpg,/upload/p/4240/image_other/2025-08/jis-standard-welded-pipe.jpg,/upload/p/4240/image_other/2025-08/asmeastm-welded-pipe.jpg,/upload/p/4240/image_other/2025-08/en-standard-welded-pipe.jpg,/upload/p/4240/image_other/2025-08/api-corrosion-resistant-alloy-cra-pipe.jpg,/upload/p/4240/image_other/2025-08/nickel-alloy-seamless-pipe.jpg,/upload/p/4240/image_other/2025-08/duplexsuper-duplex-seamless-pipe.jpg,/upload/p/4240/image_other/2025-08/super-austenitic-seamless-pipe.jpg,/upload/p/4240/image_other/2025-08/austenitic-stainless-steel-seamless-pipe.jpg,/upload/p/4240/image_other/2025-08/thick-zinc-coated-pipe.jpg,/upload/p/4240/image_other/2025-08/galvanized-fbe-pipe.jpg,/upload/p/4240/image_other/2025-08/electro-galvanized-pipe.jpg,/upload/p/4240/image_other/2025-08/hot-dip-galvanized-pipe.jpg,/upload/p/4240/image_other/2025-08/q235-galvanized-pipe.jpg,/upload/p/4240/image_other/2025-08/q195-galvanized-pipe.jpg,/upload/p/4240/image_other/2025-08/bare-ssaw-steel-pipe.jpg,/upload/p/4240/image_other/2025-08/fbe-coated-ssaw-steel-pipe.jpg,/upload/p/4240/image_other/2025-08/x52-ssaw-steel-pipe.jpg,/upload/p/4240/image_other/2025-08/q235b-ssaw-steel-pipe.jpg,/upload/p/4240/image_other/2025-08/low-alloy-steel-erw-pipe.jpg,/upload/p/4240/image_other/2025-08/carbon-steel-erw-pipe.jpg,/upload/p/4240/image_other/2025-08/black-carbon-steel-pipe.jpg,/upload/p/4240/image_other/2025-08/picture-19-copy.jpg,/upload/p/4240/image_other/2025-08/hydrogen-energy-skid.jpg';
//// $lists = $imageModel->selectField(['project_id'=>4240],'path');
// $lists = explode(',',$strImage);
// $domain = 'http://globalso-v6-1309677403.cos.ap-hongkong.myqcloud.com';//cos域名
// foreach ($lists as $v){
// $url = $domain . $v.'?'.$str;
// echo date('Y-m-d H:i:s') . '水印路径:'. $url . PHP_EOL;
// $cdu_url = $this->coverOriginalImage($url,$v);
// echo date('Y-m-d H:i:s') . '返回的url:'. $cdu_url . PHP_EOL;
// }
// return true;
// }
public function handle(){
$data = [];
$domain = 'https://ecdn6.globalso.com/';
$str = $this->getProjectConfig(4636);
$imageModel = new Image();
$lists = $imageModel->list(['project_id'=>4240]);
foreach ($lists as $k => $v){
$url = $domain . $v['path'];
echo date('Y-m-d H:i:s') . '刷新路径:'. $url .',主键id:'. $v['id'] . PHP_EOL;
$data[] = $url;
// $strImage = '/upload/p/4240/image_other/2025-09/picture-18-copy-3.jpg,/upload/p/4240/image_other/2025-09/picture-17-copy-2.jpg,/upload/p/4240/image_other/2025-09/picture-16-copy-2.jpg,/upload/p/4240/image_other/2025-09/picture-12-copy-3.jpg,/upload/p/4240/image_other/2025-09/picture-5-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-6-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-10-copy-2.jpg,/upload/p/4240/image_other/2025-09/picture-11-copy-2.jpg,/upload/p/4240/image_other/2025-09/4-1.jpg,/upload/p/4240/image_other/2025-09/picture-18-copy-2.jpg,/upload/p/4240/image_other/2025-09/picture-16-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-17-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-15-copy-2.jpg,/upload/p/4240/image_other/2025-09/picture-13-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-14-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-12-copy-2.jpg,/upload/p/4240/image_other/2025-09/picture-10-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-11-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-20-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-18-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-19-copy-1.jpg,/upload/p/4240/image_other/2025-09/image-1-copy.jpg,/upload/p/4240/image_other/2025-09/image-2-copy.jpg,/upload/p/4240/image_other/2025-09/picture-3-copy.jpg,/upload/p/4240/image_other/2025-09/picture-6-copy.jpg,/upload/p/4240/image_other/2025-09/picture-4-copy.jpg,/upload/p/4240/image_other/2025-09/picture-5-copy.jpg,/upload/p/4240/image_other/2025-09/picture-9-copy.jpg,/upload/p/4240/image_other/2025-09/picture-7-copy.jpg,/upload/p/4240/image_other/2025-09/picture-8-copy.jpg,/upload/p/4240/image_other/2025-09/picture-15-copy-1.jpg,/upload/p/4240/image_other/2025-09/picture-14-copy.jpg,/upload/p/4240/image_other/2025-09/picture-13-copy.jpg,/upload/p/4240/image_other/2025-09/picture-12-copy-1.jpg,/upload/p/4240/image_other/2025-08/picture-44-copy.jpg,/upload/p/4240/image_other/2025-08/45.jpg,/upload/p/4240/image_other/2025-09/picture-10-copy.jpg,/upload/p/4240/image_other/2025-09/picture-11-copy.jpg,/upload/p/4240/image_other/2025-08/43.jpg,/upload/p/4240/image_other/2025-08/42.jpg,/upload/p/4240/image_other/2025-08/picture-38-copy.jpg,/upload/p/4240/image_other/2025-08/picture-37-copy.jpg,/upload/p/4240/image_other/2025-08/picture-36-copy.jpg,/upload/p/4240/image_other/2025-08/picture-35-copy-1.jpg,/upload/p/4240/image_other/2025-08/picture-30-copy.jpg,/upload/p/4240/image_other/2025-08/29.jpg,/upload/p/4240/image_other/2025-08/28-1.jpg,/upload/p/4240/image_other/2025-08/27-1.jpg,/upload/p/4240/image_other/2025-08/picture-23-copy.jpg,/upload/p/4240/image_other/2025-08/22-1.jpg,/upload/p/4240/image_other/2025-08/21.jpg,/upload/p/4240/image_other/2025-08/17.jpg,/upload/p/4240/image_other/2025-08/16.jpg,/upload/p/4240/image_other/2025-08/picture-15-copy.jpg,/upload/p/4240/image_other/2025-08/11-2.jpg,/upload/p/4240/image_other/2025-08/10-1.jpg,/upload/p/4240/image_other/2025-08/picture-6.jpg,/upload/p/4240/image_other/2025-08/picture-5.jpg,/upload/p/4240/image_other/2025-08/picture-4.jpg,/upload/p/4240/image_other/2025-08/api-standard-welded-pipe.jpg,/upload/p/4240/image_other/2025-08/gb-standard-welded-pipe.jpg,/upload/p/4240/image_other/2025-08/gost-standard-welded-pipe.jpg,/upload/p/4240/image_other/2025-08/jis-standard-welded-pipe.jpg,/upload/p/4240/image_other/2025-08/asmeastm-welded-pipe.jpg,/upload/p/4240/image_other/2025-08/en-standard-welded-pipe.jpg,/upload/p/4240/image_other/2025-08/api-corrosion-resistant-alloy-cra-pipe.jpg,/upload/p/4240/image_other/2025-08/nickel-alloy-seamless-pipe.jpg,/upload/p/4240/image_other/2025-08/duplexsuper-duplex-seamless-pipe.jpg,/upload/p/4240/image_other/2025-08/super-austenitic-seamless-pipe.jpg,/upload/p/4240/image_other/2025-08/austenitic-stainless-steel-seamless-pipe.jpg,/upload/p/4240/image_other/2025-08/thick-zinc-coated-pipe.jpg,/upload/p/4240/image_other/2025-08/galvanized-fbe-pipe.jpg,/upload/p/4240/image_other/2025-08/electro-galvanized-pipe.jpg,/upload/p/4240/image_other/2025-08/hot-dip-galvanized-pipe.jpg,/upload/p/4240/image_other/2025-08/q235-galvanized-pipe.jpg,/upload/p/4240/image_other/2025-08/q195-galvanized-pipe.jpg,/upload/p/4240/image_other/2025-08/bare-ssaw-steel-pipe.jpg,/upload/p/4240/image_other/2025-08/fbe-coated-ssaw-steel-pipe.jpg,/upload/p/4240/image_other/2025-08/x52-ssaw-steel-pipe.jpg,/upload/p/4240/image_other/2025-08/q235b-ssaw-steel-pipe.jpg,/upload/p/4240/image_other/2025-08/low-alloy-steel-erw-pipe.jpg,/upload/p/4240/image_other/2025-08/carbon-steel-erw-pipe.jpg,/upload/p/4240/image_other/2025-08/black-carbon-steel-pipe.jpg,/upload/p/4240/image_other/2025-08/picture-19-copy.jpg,/upload/p/4240/image_other/2025-08/hydrogen-energy-skid.jpg';
$lists = $imageModel->selectField(['project_id'=>4636],'path');
// $lists = explode(',',$strImage);
$domain = 'http://globalso-v6-1309677403.cos.ap-hongkong.myqcloud.com';//cos域名
foreach ($lists as $v){
$url = $domain . $v.'?'.$str;
echo date('Y-m-d H:i:s') . '水印路径:'. $url . PHP_EOL;
$cdu_url = $this->coverOriginalImage($url,$v);
echo date('Y-m-d H:i:s') . '返回的url:'. $cdu_url . PHP_EOL;
}
$yunService = new UpyunService();
return $yunService->preheatPush($data);
return true;
}
// public function handle(){
// $data = [];
// $domain = 'https://ecdn6.globalso.com/';
// $imageModel = new Image();
// $lists = $imageModel->list(['project_id'=>4240]);
// foreach ($lists as $k => $v){
// $url = $domain . $v['path'];
// echo date('Y-m-d H:i:s') . '刷新路径:'. $url .',主键id:'. $v['id'] . PHP_EOL;
// $data[] = $url;
// }
// $yunService = new UpyunService();
// return $yunService->preheatPush($data);
// }
/**
* @remark :添加水印后保存图片(覆盖/非覆盖的文件未存入数据库)
* @name :uploadImages
... ...
... ... @@ -11,12 +11,14 @@ namespace App\Http\Controllers\Api\WorkOrder;
use App\Enums\Common\Code;
use App\Http\Controllers\Api\BaseController;
use App\Models\Ai\AiCommand;
use App\Models\Blog\BlogCategory;
use App\Models\News\NewsCategory;
use App\Models\Product\Category;
use App\Models\Product\Keyword;
use App\Models\RouteMap\RouteMap;
use App\Models\Ticket\TicketUploadData;
use App\Services\AiCommandService;
use App\Services\ProjectServer;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
... ... @@ -431,4 +433,80 @@ class TicketUploadDataController extends BaseController
return ['id'=>$id,'title'=>$title];
}
}
/**
* @remark :根据指令获取内容
* @name :sendLayoutDesign
* @author :lyh
* @method :post
* @time :2025/5/26 17:39
*/
public function sendLayoutDesign(){
$this->request->validate([
'html'=>['required'],
'project_id'=>['required']
],[
'html.required' => 'html不能为空',
'project_id.required' => '项目ID不能为空',
]);
$aiCommonModel = new AiCommand();
$info = $aiCommonModel->read(['key'=>'ai_layout_design','project_id'=>$this->param['project_id']],['ai']);
if($info === false){
$info = $aiCommonModel->read(['key'=>'ai_layout_design','project_id'=>0],['ai']);
}
$aiCommandService = new AiCommandService();
$ai = str_replace('{html}',$this->param['html'],$info['ai']);
$result = $aiCommandService->send_layout_design($ai);
$this->response('success', Code::SUCCESS, $result);
}
/**
* @remark :保存指令
* @name :saveAiCommand
* @author :lyh
* @method :post
* @time :2025/5/26 17:15
*/
public function saveLayoutDesign(){
$this->request->validate([
'ai'=>['required'],
'project_id'=>['required']
],[
'ai.required' => '指令不能为空',
'project_id.required' => '项目ID不能为空',
]);
$aiCommonModel = new AiCommand();
$data = $aiCommonModel->read(['key'=>'ai_layout_design','project_id'=>$this->param['project_id']],['id']);
if($data === false) {
$param = $aiCommonModel->read(['key'=>'ai_layout_design','project_id'=>0],['name','key']);
$param['project_id'] = $this->param['project_id'];
$param['ai'] = $this->param['ai'];
$id = $aiCommonModel->addReturnId($param);
}else{
$id = $data['id'];
$aiCommonModel->edit(['ai'=>$this->param['ai']],['id'=>$data['id']]);
}
$this->response('success', Code::SUCCESS, ['id'=>$id]);
}
/**
* @remark :获取排版指令
* @name :getAiTypesetting
* @author :lyh
* @method :post
* @time :2025/5/26 17:11
*/
public function getLayoutDesignInfo(){
$this->request->validate([
'project_id'=>['required']
],[
'project_id.required' => '项目ID不能为空',
]);
$aiCommonModel = new AiCommand();
$data = $aiCommonModel->read(['key'=>'ai_layout_design','project_id'=>$this->param['project_id']],['key','ai']);
if($data === false){
$data = $aiCommonModel->read(['key'=>'ai_layout_design','project_id'=>0],['key','ai']);
}
$this->response('success', Code::SUCCESS, $data);
}
}
... ...
... ... @@ -237,7 +237,7 @@ class CNoticeController extends BaseController
$this->fail('未查询到项目数据');
}
// --------------------------------------------------- 特殊处理通知生成页面 --------------------------------------------------------------
if ($type == 2 && ($project_id != 4041) && ($project_info['main_lang_id'] == 8)) {
if ($type == 2 && ($project_id != 4041) && ($project_id != 4094) && ($project_info['main_lang_id'] == 8)) {
$this->fail('申请项目主语种为俄语,禁止翻译小语种,如若需要翻译小语种, 请联系售后人员确认!');
}
... ...
... ... @@ -22,6 +22,8 @@ use App\Models\Com\UpdateLog;
use App\Models\Devops\Servers;
use App\Models\Devops\ServersIp;
use App\Models\Domain\DomainInfo;
use App\Models\Domain\DomainInfo as DomainInfoModel;
use App\Models\Geo\GeoQuestionResult;
use App\Models\Industry\ProjectIndustryRelated;
use App\Models\Inquiry\InquiryIP;
use App\Models\Inquiry\InquirySet;
... ... @@ -121,7 +123,10 @@ class ProjectLogic extends BaseLogic
$info['collect_test_domain'] = $info['is_upgrade'] ? CollectLog::getCollectTestDomain($id) : '';
//获取项目所属行业
$info['deploy_optimize']['industry'] = ProjectIndustryRelated::where('project_id', $id)->pluck('industry_id')->toArray();
$questionModel = new GeoQuestionResult();
$info['question_qualify_count'] = $questionModel->where('project_id', $id)
->where('hit','!=',0)->whereIn('platform',['openai', 'gemini','google_ai_overview'])
->count();
return $this->success($info);
}
... ... @@ -794,6 +799,17 @@ class ProjectLogic extends BaseLogic
if(($info['type'] == Project::TYPE_ZERO) && ($info['type'] != Project::TYPE_FIVE)){
$param['type'] = Project::TYPE_ONE;
}
if($param['type'] == Project::TYPE_CLOSE){
$param['site_status'] = 1;//关闭站点
$domainModel = new DomainInfoModel();
$domainInfo = $domainModel->read(['project_id'=>$this->param['id']],['id','domain','amp_status']);
if($domainInfo){
$re = curl_get('https://'.$domainInfo['domain'].'/api/stop_or_start_website');
if(isset($re['status']) && $re['status'] !== 200){
$this->fail($re['message']);
}
}
}
//创建默认数据库
if($param['type'] == Project::TYPE_ONE){
//改为异步
... ...
... ... @@ -17,6 +17,7 @@ use App\Models\News\News;
use App\Models\News\NewsCategory;
use App\Models\Product\Category;
use App\Models\Product\CategoryRelated;
use App\Models\Product\Detail;
use App\Models\Product\Keyword;
use App\Models\Product\KeywordRelated;
use App\Models\Product\Product;
... ... @@ -209,6 +210,11 @@ class TicketUploadDataLogic extends BaseLogic
CategoryRelated::saveRelated($id, $info['text']['category_id'] ?? []);//分类关联
KeywordRelated::saveRelated($id,$info['text']['keyword_id'] ?? []);//关键字关联
$route = RouteMap::setRoute($data['title'],RouteMap::SOURCE_PRODUCT,$id,$info['project_id']);
//保存一条描述
if(!empty($info['text']['remark'])){
$detailModel = new Detail();
$detailModel->addReturnId(['content'=>json_encode(['content'=>$info['text']['remark']],true),'product_id'=>$id,'title'=>$info['text']['title'],'project_id'=>$info['project_id'],'column_id'=>1,'text_type'=>1]);
}
$productModel->edit(['route'=>$route],['id'=>$id]);
}catch (\Exception $e){
$this->fail('保存失败,请联系管理员');
... ...
... ... @@ -207,7 +207,7 @@ class UserLogic extends BaseLogic
$roleInfo = $roleModel->where('project_id',$this->param['project_id'])->orderBy('id','asc')->first();
$info = $this->model->read(['role_id'=>0,'project_id'=>$this->param['project_id']]);
if(empty($info) || empty($roleInfo)){
$this->fail('请先添加角色');
$this->fail('请先添加角色,联系管理员');
}
try {
$this->model->edit(['role_id'=>$roleInfo['id']],['id'=>$info['id']]);
... ...
... ... @@ -180,7 +180,7 @@ class AiBlogLogic extends BaseLogic
//推送到ai的数据结构
$data = [
'title'=>$param['new_title'], 'thumb'=>$param['image'], 'foreword'=>$param['description'] ?? '',
'author_id'=>$this->param['author_id'], 'url'=>$param['route'],
'author_id'=>$param['author_id'], 'url'=>$param['route'],
];
if(!isset($param['description']) || empty($param['description'])){
$param['description'] = truncate_text($param['text']);
... ... @@ -217,10 +217,12 @@ class AiBlogLogic extends BaseLogic
}
$aiBlogService = new AiBlogService($this->user['project_id']);
$result = $aiBlogService->createCustomBlog($data);
$this->model->edit(['task_id'=>$result['data']['task_id'] ?? '','status'=>$this->model::STATUS_FINISH],['id'=>$id]);
if(isset($result['status']) && $result['status'] == 200){
$this->model->edit(['task_id'=>$result['data']['task_id'],'status'=>$this->model::STATUS_FINISH],['id'=>$id]);
//todo::更新列表页
shell_exec("php artisan save_ai_blog_list {$this->user['project_id']} > /dev/null 2>&1 &");
}else{
$this->fail('发布失败,请编辑后重新发布');
}
return $this->success();
}
... ...
... ... @@ -339,11 +339,18 @@ class CustomModuleContentLogic extends BaseLogic
DB::beginTransaction();
try {
foreach ($this->param['id'] as $id) {
$info = $this->model->read(['id' => $id], ['id','status']);
if($info !== false){
if($info['status'] != 2){
$this->model->edit(['status' => 2],['id' => $id]);
}else{
//删除当前扩展字段
$this->delRoute($id);
$this->delContentExtend($id);
$this->model->del(['id' => $id]);
}
}
}
DB::commit();
} catch (Exception $e) {
DB::rollBack();
... ...
... ... @@ -145,8 +145,7 @@ class GeoQuestionResLogic extends BaseLogic
//问题达标数据
$data['question_qualify_count'] = $questionLogModel->where('project_id', $this->user['project_id'])
->where('hit','!=',0)->whereIn('platform',['openai', 'gemini','google_ai_overview'])
->select(DB::raw('COUNT(DISTINCT question) as total'))
->value('total');
->count();
$latestCreatedAt = $questionLogModel
->where('project_id', $this->user['project_id'])
->orderBy('id', 'desc')
... ...
... ... @@ -306,6 +306,8 @@ class UserLoginLogic
$info['is_visualization'] = json_decode($project['is_visualization']);
}
$info['is_visualization_authority'] = $project['deploy_build']['is_visualization_authority'];
$info['is_enable_product_cate'] = $project['deploy_build']['is_enable_product_cate'];
$info['is_enable_wrap'] = $project['deploy_build']['is_enable_wrap'];
$info['is_inquiry_country'] = $project['is_inquiry_country'];
$info['is_subscribe'] = $project['is_subscribe'];
$info['is_news'] = $project['is_news'] ?? 0;
... ...
... ... @@ -32,6 +32,7 @@ class APublicModel extends Base
*/
public static function getNumByProjectId($project_id){
ProjectServer::useProject($project_id);
try {
$data = Cache::get('product_blog_news_'.$project_id);
if(!$data){
$productNumber = DB::connection('custom_mysql')->table('gl_product')
... ... @@ -51,6 +52,9 @@ class APublicModel extends Base
$data = ['product'=>$productNumber,'blog'=>$blogNumber,'news'=>$newsNumber,'key'=>$keyNumber,'inquiry'=>$inquiryNumber];
Cache::add('product_blog_news_'.$project_id,$data,30 * 60);
}
}catch (\Exception $e){
return [];
}
DB::disconnect('custom_mysql');
return $data;
}
... ...
... ... @@ -453,8 +453,8 @@ class SyncSubmitTaskService
//关杰 全局过滤 满足 name、message 8-16 纯字母不含空格 ip 荷兰 mobile 10位纯数字 过滤
if(
strlen($data['data']['name']??'') <= 16 && strlen($data['data']['name']??'') >= 8 &&
strlen($data['data']['message']??'') <= 16 && strlen($data['data']['message']??'') >= 8 &&
strlen($data['data']['name']??'') >= 8 &&
strlen($data['data']['message']??'') >= 8 &&
preg_match('/^[a-zA-Z]+$/', $data['data']['name']??'') &&
preg_match('/^[a-zA-Z]+$/', $data['data']['message']??'') &&
preg_match('/^\d+$/', $data['data']['phone']??'') &&
... ... @@ -464,8 +464,8 @@ class SyncSubmitTaskService
throw new InquiryFilterException( '全局过滤');
}
if(
strlen($data['data']['name']??'') <= 16 && strlen($data['data']['name']??'') >= 8 &&
strlen($data['data']['message']??'') <= 16 && strlen($data['data']['message']??'') >= 8 &&
strlen($data['data']['name']??'') >= 8 &&
strlen($data['data']['message']??'') >= 8 &&
preg_match('/^[a-zA-Z]+$/', $data['data']['name']??'') &&
preg_match('/^[a-zA-Z]+$/', $data['data']['message']??'') &&
in_array($data['country']??'', ['荷兰', '俄罗斯'])
... ... @@ -484,10 +484,17 @@ class SyncSubmitTaskService
){
throw new InquiryFilterException( '全局过滤2');
}
if(
in_array($data['country']??'', ['荷兰', '俄罗斯']) &&
strlen($data['data']['message']??'') >= 8 &&
preg_match('/^[a-zA-Z]+$/', $data['data']['message']??'')
){
throw new InquiryFilterException( '全局过滤3');
}
//1913宁波市鄞州永鑫 ip荷兰 message 8-16 纯字母不含空格
if($project_id == 1913 && in_array($data['country']??'', ['荷兰', '俄罗斯'])
&& strlen($data['data']['message']??'') <= 16 && strlen($data['data']['message']??"") >= 8
&& strlen($data['data']['message']??"") >= 8
&& preg_match('/^[a-zA-Z]+$/', $data['data']['message']??'')
){
throw new InquiryFilterException( '被刷数据');
... ...
... ... @@ -57,7 +57,6 @@ Route::any('get_external_link_by_domain', [\App\Http\Controllers\Api\PrivateCont
Route::any('get_project_detail', [\App\Http\Controllers\Api\PrivateController::class, 'getProjectByDomain'])->name('api.project_detail');
// 获取项目产品信息
Route::any('get_project_product', [\App\Http\Controllers\Api\PrivateController::class, 'getProjectProduct'])->name('api.project_product');
// --------------------- 站群服务 ------------------------------------------
// --------------------- 监控服务 ------------------------------------------
Route::any('get_project_online', [\App\Http\Controllers\Api\PrivateController::class, 'getProjectOnline'])->name('api.get_project_online');
// 将项目标记为广告状态
... ... @@ -104,5 +103,8 @@ Route::prefix('ticket_upload')->group(function () {
Route::any('/getNewsCate', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'getNewsCate'])->name('ticket_upload.getNewsCate');
Route::any('/saveCategory', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'saveCategory'])->name('ticket_upload.saveCategory');
Route::any('/saveKeyword', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'saveKeyword'])->name('ticket_upload.saveKeyword');
Route::any('/sendLayoutDesign', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'sendLayoutDesign'])->name('ticket_upload.sendLayoutDesign');
Route::any('/saveLayoutDesign', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'saveLayoutDesign'])->name('ticket_upload.saveLayoutDesign');
Route::any('/getLayoutDesignInfo', [\App\Http\Controllers\Api\WorkOrder\TicketUploadDataController::class, 'getLayoutDesignInfo'])->name('ticket_upload.getLayoutDesignInfo');
});
... ...