作者 刘锟

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

... ... @@ -26,7 +26,7 @@ use function Symfony\Component\String\s;
/***
* @remark :根据项目更新blog列表
* @name :AiBlogListTask
* @name :AiBlogListProjectTask
* @author :lyh
* @method :post
* @time :2025/3/6 9:45
... ...
<?php
/**
* @remark :
* @name :AiBlogTask.php
* @author :lyh
* @method :post
* @time :2025/2/14 11:14
*/
namespace App\Console\Commands\Ai;
use App\Models\Ai\AiBlog;
use App\Models\Ai\AiBlogAuthor;
use App\Models\Ai\AiBlogList;
use App\Models\Domain\DomainInfo;
use App\Models\Project\ProjectAiSetting;
use App\Models\RouteMap\RouteMap;
use App\Services\AiBlogService;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use App\Models\Project\AiBlogTask as AiBlogTaskModel;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use function Symfony\Component\String\s;
/***
* @remark :根据项目更新blog列表
* @name :AiBlogListProjectTask
* @author :lyh
* @method :post
* @time :2025/3/6 9:45
*/
class AiBlogListProjectTask extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'save_ai_blog_list {project_id}';
/**
* The console command description.
*
* @var string
*/
protected $description = '根据项目生成blog列表';
public function handle(){
$project_id = $this->argument('project_id');
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('执行的项目id->'.$project_id, true) . PHP_EOL, FILE_APPEND);
ProjectServer::useProject($project_id);
$projectAiSettingModel = new ProjectAiSetting();
$aiSettingInfo = $projectAiSettingModel->read(['project_id'=>$project_id]);
$this->updateBlogList($aiSettingInfo);
$this->curlDelRoute($project_id);
DB::disconnect('custom_mysql');
return true;
}
/**
* @remark :更新列表页数据
* @name :updateBlogList
* @author :lyh
* @method :post
* @time :2025/3/5 11:07
*/
public function updateBlogList($aiSettingInfo){
$aiBlogService = new AiBlogService();
$aiBlogService->mch_id = $aiSettingInfo['mch_id'];
$aiBlogService->key = $aiSettingInfo['key'];
$page = 1;
$saveData = [];
$result = $aiBlogService->getAiBlogList($page,15);
if(!isset($result['status']) || $result['status'] != 200){
echo '请示失败。'.json_encode($result, JSON_UNESCAPED_UNICODE);
return true;
}
$total_page = $result['data']['total_page'];
//组装数据保存
$saveData[] = [
'route'=>$page,
'text'=>$result['data']['section'],
];
while ($total_page > $page){
$page++;
$result = $aiBlogService->getAiBlogList($page,15);
if(isset($result['status']) && $result['status'] == 200){
$saveData[] = [
'route'=>$page,
'text'=>$result['data']['section'],
];
}
}
$aiBlogListModel = new AiBlogList();
if(!empty($saveData)){
//写一条路由信息
$aiBlogListModel->truncate();
$aiBlogListModel->insertAll($saveData);
}
return true;
}
/**
* @remark :通知C端生成界面
* @name :sendNotice
* @author :lyh
* @method :post
* @time :2025/3/6 11:51
*/
public function curlDelRoute($project_id){
$domainModel = new DomainInfo();
//获取项目域名
$domain = $domainModel->getProjectIdDomain($project_id);
if(!empty($domain)){
$c_url = $domain.'api/update_page/';
$param = [
'project_id' => $project_id,
'type' => 1,
'route' => 3,
'url' => ['top-blog'],
'language'=> [],
'is_sitemap' => 0
];
http_post($c_url, json_encode($param));
}
return true;
}
}
... ...
... ... @@ -21,11 +21,12 @@ use Illuminate\Console\Command;
use App\Models\Project\AiBlogTask as AiBlogTaskModel;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
use function Symfony\Component\String\s;
/***
* @remark :根据项目更新blog列表
* @name :AiBlogListTask
* @name :AiBlogListProjectTask
* @author :lyh
* @method :post
* @time :2025/3/6 9:45
... ... @@ -37,24 +38,45 @@ class AiBlogListTask extends Command
*
* @var string
*/
protected $signature = 'save_ai_blog_list {project_id}';
protected $signature = 'save_ai_blog_list_task';
/**
* The console command description.
*
* @var string
*/
protected $description = '生成blog列表';
protected $description = '生成blog列表';
public function handle(){
$project_id = $this->argument('project_id');
@file_put_contents(storage_path('logs/lyh_error.log'), var_export('执行的项目id->'.$project_id, true) . PHP_EOL, FILE_APPEND);
ProjectServer::useProject($project_id);
$projectAiSettingModel = new ProjectAiSetting();
$aiSettingInfo = $projectAiSettingModel->read(['project_id'=>$project_id]);
$this->updateBlogList($aiSettingInfo);
$this->curlDelRoute($project_id);
DB::disconnect('custom_mysql');
while (true){
$task_id = $this->getTaskId();
if(empty($task_id)){
sleep(200);
continue;
}
$aiBlogTaskModel = new AiBlogTaskModel();
$info = $aiBlogTaskModel->read(['id'=>$task_id,'type'=>$aiBlogTaskModel::TYPE_LIST]);
if($info === false){
echo date('Y-m-d H:i:s').',当前数据不存在或者已被删除。'.PHP_EOL;
}
$project_id = $info['project_id'];
echo '执行的项目ID:'.$info['project_id'].PHP_EOL;
ProjectServer::useProject($project_id);
$projectAiSettingModel = new ProjectAiSetting();
$aiSettingInfo = $projectAiSettingModel->read(['project_id'=>$project_id]);
$res = $this->updateBlogList($aiSettingInfo);
if($res){
$aiBlogTaskModel->edit(['status'=>2],['id'=>$task_id]);
}else{
if($info['sort'] >= 5){
$aiBlogTaskModel->edit(['status'=>9],['id'=>$task_id]);
}else{
$aiBlogTaskModel->edit(['status'=>9,'sort'=>($info['sort'] + 1)],['id'=>$task_id]);
}
}
$this->curlDelRoute($project_id);
DB::disconnect('custom_mysql');
}
return true;
}
... ... @@ -73,8 +95,8 @@ class AiBlogListTask extends Command
$saveData = [];
$result = $aiBlogService->getAiBlogList($page,15);
if(!isset($result['status']) || $result['status'] != 200){
echo '请示失败。'.json_encode($result, JSON_UNESCAPED_UNICODE);
return true;
echo '请求失败。'.json_encode($result, JSON_UNESCAPED_UNICODE);
return false;
}
$total_page = $result['data']['total_page'];
//组装数据保存
... ... @@ -90,6 +112,9 @@ class AiBlogListTask extends Command
'route'=>$page,
'text'=>$result['data']['section'],
];
}else{
echo '请求失败。'.json_encode($result, JSON_UNESCAPED_UNICODE);
return false;
}
}
$aiBlogListModel = new AiBlogList();
... ... @@ -97,6 +122,7 @@ class AiBlogListTask extends Command
//写一条路由信息
$aiBlogListModel->truncate();
$aiBlogListModel->insertAll($saveData);
return true;
}
return true;
}
... ... @@ -126,4 +152,27 @@ class AiBlogListTask extends Command
}
return true;
}
/**
* 获取任务id
* @param int $finish_at
* @return mixed
*/
public function getTaskId($finish_at = 2)
{
$keys = 'ai_blog_list_task';
$task_id = Redis::rpop($keys);
if (empty($task_id)) {
$aiBlogTaskModel = new AiBlogTaskModel();
$finish_at = date('Y-m-d H:i:s', strtotime('-' . $finish_at . ' hour'));
$ids = $aiBlogTaskModel->formatQuery(['status'=>$aiBlogTaskModel::STATUS_RUNNING, 'type'=>$aiBlogTaskModel::TYPE_LIST, 'updated_at'=>['<=',$finish_at]])->pluck('id');
if(!empty($ids)){
foreach ($ids as $id) {
Redis::lpush($keys, $id);
}
}
$task_id = Redis::rpop($keys);
}
return $task_id;
}
}
... ...
... ... @@ -26,10 +26,8 @@ use App\Services\DingService;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use App\Models\Project\AiBlogTask as AiBlogTaskModel;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Redis;
use function Symfony\Component\String\s;
class AiBlogTask extends Command
{
... ... @@ -183,7 +181,7 @@ class AiBlogTask extends Command
ProjectServer::useProject($project_id);
$aiSettingInfo = $this->getSetting($project_id);
$this->output('sync: list start, project_id: ' . $project_id);
$this->updateBlogList($aiSettingInfo);
$this->updateBlogList($aiSettingInfo,$project_id);
$this->output('sync: list end');
//更新作者
$this->output('sync: author start, project_id: ' . $project_id);
... ... @@ -249,7 +247,7 @@ class AiBlogTask extends Command
* @param $aiSettingInfo
* @return bool
*/
public function updateBlogList($aiSettingInfo){
public function updateBlogList($aiSettingInfo,$project_id = 0){
$aiBlogService = new AiBlogService();
$aiBlogService->mch_id = $aiSettingInfo['mch_id'];
$aiBlogService->key = $aiSettingInfo['key'];
... ... @@ -257,6 +255,21 @@ class AiBlogTask extends Command
$saveData = [];
$result = $aiBlogService->getAiBlogList($page,15);
if(!isset($result['status']) || $result['status'] != 200){
try {
// 钉钉通知
$dingService = new DingService();
$body = [
'keyword' => 'AI_BLOG列表页未生成拉取失败',
'msg' => '项目ID:' . $project_id . PHP_EOL . '返回信息:' . json_encode($result,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
'isAtAll' => false, // 是否@所有人
];
$dingService->handle($body);
//写一条更新记录
$aiBlogTaskModel = new AiBlogTaskModel();
$aiBlogTaskModel->addReturnId(['project_id'=>$project_id,'task_id'=>$project_id,'status'=>$aiBlogTaskModel::STATUS_RUNNING,'type'=>$aiBlogTaskModel::TYPE_LIST]);
}catch (\Exception $e){
$this->output('更新列表页失败同时通知失败--error:' . $e->getMessage());
}
return true;
}
$total_page = $result['data']['total_page'];
... ...
... ... @@ -27,7 +27,7 @@ use function Symfony\Component\String\s;
/***
* @remark :根据项目更新blog列表
* @name :AiBlogListTask
* @name :AiBlogListProjectTask
* @author :lyh
* @method :post
* @time :2025/3/6 9:45
... ...
... ... @@ -10,7 +10,9 @@
namespace App\Console\Commands\SyncFilesImage;
use App\Models\File\ErrorFile;
use App\Models\Geo\GeoQuestion;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Redis;
class SyncFile extends Command
{
... ... @@ -30,22 +32,57 @@ class SyncFile extends Command
public function handle(){
$errorFileModel = new ErrorFile();
$lists = $errorFileModel->list(['status'=>0]);//未同步成功的图片及文件
foreach ($lists as $k => $v){
if(strpos($v['path'], '/181/') !== false ){
$code = $this->synchronizationFiles($v['path']);
while (true){
$task_id = $this->getTaskId();
echo "task_id:$task_id\n";
if(empty($task_id)){
sleep(100);
continue;
}
$errorFileModel = new ErrorFile();
$info = $errorFileModel->read(['id'=>$task_id],['id','path']);
if(strpos($info['path'], '/181/') !== false ){
$code = $this->synchronizationFiles($info['path']);
}else{
$code = $this->synchronizationFile($info['path']);
}
if(200 == (int)$code){
echo date('Y-m-d H:i:s') . '编辑的path为:'. $info['path'] .',主键id:'. $info['id'] . PHP_EOL;
$errorFileModel->edit(['status'=>2],['id'=>$info['id']]);
}else{
$code = $this->synchronizationFile($v['path']);
$errorFileModel->edit(['status'=>0],['id'=>$info['id']]);
}
// echo date('Y-m-d H:i:s') . 'code:'. $code . PHP_EOL;
// if((int)$code == 200){
// echo date('Y-m-d H:i:s') . '编辑的path为:'. $v['path'] .',主键id:'. $v['id'] . PHP_EOL;
// $errorFileModel->edit(['status'=>1],['id'=>$v['id']]);
// }
echo date('Y-m-d H:i:s') . '编辑的end为:' .$code . PHP_EOL;
}
echo date('Y-m-d H:i:s') . '编辑的end为:' . PHP_EOL;
return true;
}
public function getTaskId(){
$key = 'sync_file_task';
$task_id = Redis::rpop($key);
if(empty($task_id)){
$lock_key = 'sync_file_lock';
$lock_ttl = 60;
// 尝试获取锁
$lock = Redis::set($lock_key, 1, 'EX', $lock_ttl, 'NX');
if (empty($lock)){
echo '等待加载数据:';
return $task_id;
}
try {
$errorFileModel = new ErrorFile();
$lists = $errorFileModel->list(['status'=>0],'id',['id','path'],'asc',2000);
foreach ($lists as $v){
Redis::lpush($key, $v['id']);
$errorFileModel->edit(['status'=>1],['id'=>$v['id']]);
}
$task_id = Redis::rpop($key);
} finally {
// 释放锁
Redis::del($lock_key);
}
}
return $task_id;
}
/**
... ... @@ -57,8 +94,6 @@ class SyncFile extends Command
*/
public function synchronizationFile($path_name){
//同步到大文件
$file_path = config('filesystems.disks.cos')['cdn1'].$path_name;
$directoryPath = pathinfo($path_name, PATHINFO_DIRNAME);
$cmd = 'curl -k -F "file_path='.$path_name.'" -F "save_path=/www/wwwroot/cos'.$path_name.'" https://v6-file.globalso.com/upload.php';
return shell_exec($cmd);
}
... ... @@ -68,7 +103,7 @@ class SyncFile extends Command
//同步到大文件
$file_path = config('filesystems.disks.s3')['cdn'].$path_name;
$directoryPath = pathinfo($path_name, PATHINFO_DIRNAME);
$cmd = 'curl -k -F "file_path='.$path_name.'" -F "save_path=/www/wwwroot/cos'.$path_name.'" https://v6-file.globalso.com/upload.php';
$cmd = 'curl -k -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$directoryPath.'" https://v6-file.globalso.com/upload.php';
return shell_exec($cmd);
}
}
... ...
... ... @@ -15,7 +15,6 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('sync_file')->everyThirtyMinutes()->withoutOverlapping(1);//每半小时执行同步
// 每日更新最新模块
$schedule->command('template_label')->dailyAt('01:00')->withoutOverlapping(1);//最新模块
$schedule->command('popular_template_label')->dailyAt('01:30')->withoutOverlapping(1);//热门模块
... ...
... ... @@ -685,7 +685,20 @@ if (!function_exists('getImageUrl')) {
if ($image_cdn == 0) {//v6链接
$cosCdn = $cos['cdn2'];
} else {
$cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1'];
switch ($storage_type) {
case 0:
$cosCdn = $cos['cdn'];
break;
case 1:
$cosCdn = $cos['cdn1'];
break;
case 2:
$cosCdn = $cos['cdn3'];
break;
default:
$cosCdn = $cos['cdn2'];
break;
}
}
$url = $cosCdn . $path;
} else {
... ... @@ -731,7 +744,20 @@ if (!function_exists('getFileUrl')) {
}
if ($location == 0) {
$cos = config('filesystems.disks.cos');
$cosCdn = ($storage_type == 0) ? $cos['cdn'] : $cos['cdn1'];
switch ($storage_type) {
case 0:
$cosCdn = $cos['cdn'];
break;
case 1:
$cosCdn = $cos['cdn1'];
break;
case 2:
$cosCdn = $cos['cdn3'];
break;
default:
$cosCdn = $cos['cdn2'];
break;
}
return $cosCdn . $path;
} else {
$s3 = config('filesystems.disks.s3');
... ...
... ... @@ -167,7 +167,7 @@ class Ticket5UploadDataController extends BaseController
}
//验证当前数据是否已提交
$this->param['text'] = json_encode($this->param['text'], true);
$this->pushTicketByBots($this->param['post_id'],$this->param['project_type']);
$this->pushTicketByBots($this->param['post_id'],1);
if(isset($this->param['id']) && !empty($this->param['id'])){
//执行编辑
$info = $this->model->read(['id'=>$this->param['id']]);
... ...
... ... @@ -259,4 +259,25 @@ class TicketController extends BaseController
}
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :获取项目uuid
* @name :getProjectUuid
* @author :lyh
* @method :post
* @time :2025/11/19 11:35
*/
public function getProjectUuid()
{
$this->request->validate([
'table_id'=>'required',
'project_cate'=>'required'
],[
'table_id.required' => '项目ID不能为空',
'project_cate.required' => '项目类型不能为空'
]);
$ticketProjectModel = new TicketProject();
$uuid = $ticketProjectModel->getValue(['table_id'=>$this->param['table_id'],'project_cate'=>$this->param['project_cate']],'uuid');
$this->response('success',Code::SUCCESS,['project_id'=>$uuid]);
}
}
... ...
... ... @@ -200,4 +200,17 @@ class IndexController extends BaseController
$data = Translate::translateSl($this->param['text']);
$this->response('success', Code::SUCCESS, $data);
}
/**
* @remark :pr报告下载
* @name :prInfoDownload
* @author :lyh
* @method :post
* @time :2025/11/18 15:00
*/
public function prInfoDownload()
{
$url = 'http://crawl.scraper.waimaoq.com/export/issuewire?token=MT0CM7y4tdFTFTm';
$this->response('success', Code::SUCCESS, ['url'=>$url]);
}
}
... ...
... ... @@ -271,11 +271,11 @@ class OptimizeController extends BaseController
if($this->map['seo_plan'] == 0){
$query = $query->where('gl_project_deploy_build.plan','!=',0);
}elseif(is_array($this->map['seo_plan'])){
$query = $query->whereIn('gl_project_deploy_build.seo_plan',$this->map['seo_plan'])
->where(function ($subQuery) {
$subQuery->where('gl_project_deploy_build.plan', '=', 0)
->orWhere('gl_project_deploy_build.seo_plan', '!=', 9);
});;
$query = $query->whereIn('gl_project_deploy_build.seo_plan',$this->map['seo_plan']);
// ->where(function ($subQuery) {
// $subQuery->where('gl_project_deploy_build.plan', '=', 0)
// ->orWhere('gl_project_deploy_build.seo_plan', '!=', 9);
// });
}else{
$query = $query->where('gl_project_deploy_build.seo_plan',$this->map['seo_plan']);
}
... ...
... ... @@ -332,11 +332,11 @@ class ProjectController extends BaseController
}
}
if (isset($this->map['seo_plan'])) {
$query = $query->where('gl_project_deploy_build.seo_plan', '!=', 0)
->where(function ($subQuery) {
$subQuery->where('gl_project_deploy_build.plan', '=', 0)
->orWhere('gl_project_deploy_build.seo_plan', '!=', 9);
});
$query = $query->where('gl_project_deploy_build.seo_plan', '!=', 0);
// ->where(function ($subQuery) {
// $subQuery->where('gl_project_deploy_build.plan', '=', 0)
// ->orWhere('gl_project_deploy_build.seo_plan', '!=', 9);
// });
}
if (isset($this->map['site_status'])) {
$query = $query->where('gl_project.site_status', $this->map['site_status']);
... ...
... ... @@ -85,4 +85,22 @@ class TicketUploadDataController extends BaseController
$data = $this->logic->saveData();
$this->response('success',Code::SUCCESS,$data);
}
/**
* @remark :删除数据
* @name :del
* @author :lyh
* @method :post
* @time :2025/11/14 11:05
*/
public function del()
{
$this->request->validate([
'id'=>'required',
],[
'id.required' => '主键ID不能为空',
]);
$data = $this->logic->delData();
$this->response('success',Code::SUCCESS,$data);
}
}
... ...
... ... @@ -118,7 +118,7 @@ class AsideTicketController extends BaseController
$manageIdArr = $manageHrModel->selectField(['entry_position' => ['in', [42, 43, 45, 48, 51]], 'status' => 1], 'manage_id');
}
$query->whereHas('logs', function ($q) use ($manageIdArr) {
$q->whereIn('engineer_id', $manageIdArr);
$q->whereIn('engineer_id', $manageIdArr)->where('is_engineer',1);
});
}else{
$manageIdArr = $manageHrModel->selectField(['dept_id'=>$this->param['dept_id'],'status'=>1],'manage_id');
... ...
... ... @@ -17,12 +17,15 @@ use App\Models\CustomModule\CustomModule;
use App\Models\CustomModule\CustomModuleCategory;
use App\Models\CustomModule\CustomModuleContent;
use App\Models\News\News;
use App\Models\Product\Category;
use App\Models\Product\CategoryRelated;
use App\Models\Product\Product;
use App\Models\Project\Project;
use App\Models\RouteMap\RouteMap;
use App\Models\WebSetting\SettingNum;
use App\Models\WebSetting\Translate;
use App\Models\WebSetting\TranslateKey;
use Illuminate\Support\Facades\Cache;
class TranslateController extends BaseController
{
... ... @@ -351,7 +354,20 @@ class TranslateController extends BaseController
if($v['route'] == 'products'){
$count = $productModel->formatQuery(['status'=>1])->count();
}else{
$count = $productModel->formatQuery(['category_id'=>['like','%,'.$v['source_id'].',%'],'status'=>1])->count();
$catelists = Cache::get('product_category_trans');
if(!$catelists){
$cateModel = new Category();
$catelists = $cateModel->list(['status'=>1],'id',['id','pid']);
Cache::put('product_category_trans',$catelists,3600 * 24);
}
$ids = $this->getCategoryWithChildrenIds($catelists,$v['source_id']);
if (empty($ids) || !is_array($ids)) {
// 处理空值情况,返回0或者默认值
$count = 0;
} else {
$cateRelateModel = new CategoryRelated();
$count = $cateRelateModel->whereIn('cate_id', $ids)->distinct('product_id')->count();
}
}
$this->pageSixList($data,$count,$v,1,15);
break;
... ... @@ -474,4 +490,27 @@ class TranslateController extends BaseController
}
return true;
}
/**
* 迭代方式获取分类及所有子分类的总数
* @param array $categories 所有分类数据
* @param int $categoryId 分类ID
* @return int 分类总数
*/
public function getCategoryWithChildrenIds($categories, $categoryId) {
$ids = []; // 存储所有ID的数组
$queue = [$categoryId]; // 待处理的ID队列
while (!empty($queue)) {
$currentId = array_shift($queue);
// 将当前ID添加到结果数组
$ids[] = $currentId;
// 查找所有子分类
foreach ($categories as $category) {
if (isset($category['pid']) && $category['pid'] == $currentId) {
$queue[] = $category['id']; // 将子分类ID加入队列
}
}
}
return $ids;
}
}
... ...
... ... @@ -76,12 +76,16 @@ class GeoLinkLogic extends BaseLogic
if(!empty($this->param['data'])){
$data = [];
foreach ($this->param['data'] as $item){
$data[] = [
'project_id'=>$this->param['project_id'],
'da'=>$item['da'] ?? 0,
'url'=>$item['url'],
'send_time'=>$item['send_time']
];
//查看当前Url是否存在
$info = $this->model->read(['url'=>$item['url'],'type'=>$this->model::TYPE_NEWS,'project_id'=>$this->param['project_id']]);
if($info === false){
$data[] = [
'project_id'=>$this->param['project_id'],
'da'=>$item['da'] ?? 0,
'url'=>$item['url'],
'send_time'=>$item['send_time']
];
}
}
$this->model->insertAll($data);
}
... ...
... ... @@ -84,18 +84,41 @@ class GeoQuestionLogic extends BaseLogic
*/
public function saveGeoQuestion(){
//处理数据
$this->param['question'] = json_encode($this->param['question'] ?? [],true);
$count = count($this->param['question']);
$question = $this->param['question'];
$this->param['url'] = json_encode($this->param['url'] ?? [],true);
$this->param['keywords'] = json_encode($this->param['keywords'] ?? [],true);
//执行时间设置为今天
if(isset($this->param['id']) && !empty($this->param['id'])){
$id = $this->param['id'];
$this->model->edit($this->param,['id'=>$id]);
if($count <= 20){
if(isset($this->param['id']) && !empty($this->param['id'])){
$id = $this->param['id'];
$this->model->edit($this->param,['id'=>$id]);
}else{
$this->param['next_time'] = date('Y-m-d');
$id = $this->model->addReturnId($this->param);
}
return $this->success(['id'=>$id]);
}else{
$this->param['next_time'] = date('Y-m-d');
$id = $this->model->addReturnId($this->param);
$chunks = array_chunk($question, 20);
if(isset($this->param['id']) && !empty($this->param['id'])){
foreach ($chunks as $index => $chunk) {
$this->param['question'] = json_encode($chunk ?? [],true);
if($index == 0){
$id = $this->param['id'];
$this->model->edit($this->param,['id'=>$id]);
}else{
unset($this->param['id']);
$id = $this->model->addReturnId($this->param);
}
}
}else{
$this->param['next_time'] = date('Y-m-d');
foreach ($chunks as $chunk) {
$this->param['question'] = json_encode($chunk ?? [],true);
$id = $this->model->addReturnId($this->param);
}
}
return $this->success(['id'=>$id]);
}
return $this->success(['id'=>$id]);
}
/**
... ...
... ... @@ -142,10 +142,12 @@ class TicketUploadDataLogic extends BaseLogic
if($info === false){
$this->fail('当前数据不存在或已被删除');
}
ProjectServer::useProject($info['project_id']);
$info['text']['cate_name'] = $this->cateText($info['type'],$info['text']['category_id'] ?? [],$info['text']['keyword_id'] ?? [],true);
$info = $this->getHandleFileImage($info);
DB::disconnect('custom_mysql');
if($info['project_type'] == $this->model::TYPE_SIX){
ProjectServer::useProject($info['project_id']);
$info['text']['cate_name'] = $this->cateText($info['type'],$info['text']['category_id'] ?? [],$info['text']['keyword_id'] ?? [],true);
$info = $this->getHandleFileImage($info);
DB::disconnect('custom_mysql');
}
return $this->success($info);
}
... ... @@ -395,4 +397,17 @@ class TicketUploadDataLogic extends BaseLogic
}
return $this->success();
}
/**
* @remark :删除
* @name :delData
* @author :lyh
* @method :post
* @time :2025/11/14 11:04
*/
public function delData()
{
$this->model->del(['id'=>['in',$this->param['id']]]);
return $this->success();
}
}
... ...
... ... @@ -44,13 +44,16 @@ class LinkDataLogic extends BaseLogic
public function batchSave(){
$data = [];
foreach ($this->param['data'] as $v){
$data[] = [
'url'=>$v['url'],
'da'=>$v['da_values'],
'type'=>GeoLink::TYPE_LINK,
'project_id'=>$this->user['project_id'],
'send_time'=>$v['send_time'] ?? date('Y-m-d H:i:s')
];
$info = $this->model->read(['da'=>$v['da_values'],'project_id'=>$this->user['project_id'],'type'=>GeoLink::TYPE_LINK]);
if($info === false){
$data[] = [
'url'=>$v['url'],
'da'=>$v['da_values'],
'type'=>GeoLink::TYPE_LINK,
'project_id'=>$this->user['project_id'],
'send_time'=>$v['send_time'] ?? date('Y-m-d H:i:s')
];
}
}
if(!empty($data)){
$this->model->insertAll($data);
... ...
... ... @@ -44,8 +44,8 @@ class GeoConfirm extends Base
public static function typeMapping()
{
return [
self::TYPE_TITLE => '核心关键词问题已整理,请查看并确认',
self::TYPE_KEYWORD => '文章标题已整理,请查看并确认'
self::TYPE_TITLE => '文章标题已整理,请查看并确认',
self::TYPE_KEYWORD => '核心关键词问题已整理,请查看并确认'
];
}
... ...
... ... @@ -27,4 +27,5 @@ class AiBlogTask extends Base
const TYPE_AUTHOR = 1;
const TYPE_BLOG = 2;
const TYPE_AUTHOR_ID = 3;//根据对应id页面
const TYPE_LIST = 4;//更新列表页
}
... ...
... ... @@ -65,7 +65,7 @@ class MessagePush extends Base
}
//特殊处理, 要求任何时候收到询盘都要及时推送到群里面
$special_project_ids = [650, 2045, 916];
$special_project_ids = [650, 2045, 916, 3587, 568];
//9-21 点,每条消息及时通知
//21-第二天 9 点,整合一起通知
$hour = date('H', strtotime($submit_at));
... ...
... ... @@ -549,8 +549,8 @@ class SyncSubmitTaskService
//数据都是空的
$is_all_empty = true;
foreach ($data['data'] as $item){
if(is_string($item) && Str::startsWith(strtolower($item),'globalso-')){
foreach ($data['data'] as $index=>$item){
if(is_string($item) && Str::startsWith(strtolower($index),'globalso-')){
continue;
}
if(!empty($item)){
... ...
... ... @@ -84,6 +84,8 @@ Route::get('/get_manage_by_domain', [\App\Http\Controllers\Api\PrivateController
// 获取信息通过商户号
Route::any('/get_project_by_mch_id', [\App\Http\Controllers\Api\PrivateController::class, 'getProjectByMchId']);
//获取项目uuid
Route::any('/getProjectUuid',[\App\Http\Controllers\Api\WorkOrder\TicketController::class,'getProjectUuid']);
// B端,渠道在企微群操作-售后工单
Route::prefix('tickets')->group(function () {
... ...
... ... @@ -18,6 +18,7 @@ Route::middleware(['aloginauth'])->group(function () {
Route::any('/getCountry', [Aside\Com\CNoticeController::class, 'getCountry'])->name('admin.getCountry');
Route::any('/getDynamicPassword', [Aside\Com\IndexController::class, 'getDynamicPassword'])->name('admin.getDynamicPassword');
Route::any('/notAiHumanizer', [Aside\Com\IndexController::class, 'notAiHumanizer'])->name('admin.notAiHumanizer');
Route::any('/prInfoDownload', [Aside\Com\IndexController::class, 'prInfoDownload'])->name('admin.prInfoDownload');//pr报告下载
//会员相关
Route::prefix('user')->group(function () {
//会员管理
... ... @@ -680,6 +681,7 @@ Route::middleware(['aloginauth'])->group(function () {
Route::any('/', [Aside\Ticket\TicketUploadDataController::class,'lists'])->name('ticket_upload_lists');
Route::any('/save', [Aside\Ticket\TicketUploadDataController::class,'save'])->name('ticket_upload_save');
Route::any('/detail', [Aside\Ticket\TicketUploadDataController::class,'detail'])->name('ticket_upload_detail');
Route::any('/del', [Aside\Ticket\TicketUploadDataController::class,'del'])->name('ticket_upload_del');
});
//岗位管理
Route::prefix('entry_position')->group(function () {
... ...