作者 赵彬吉
@@ -113,7 +113,7 @@ class AiBlogAutoPublish extends Command @@ -113,7 +113,7 @@ class AiBlogAutoPublish extends Command
113 } 113 }
114 } 114 }
115 } else { 115 } else {
116 - if($frequency[0] == '1/2'){//一天2篇 116 + if(strpos($frequency[0],'/')){//一天2篇
117 $aiBlogTaskModel = new AiBlogTaskModel(); 117 $aiBlogTaskModel = new AiBlogTaskModel();
118 $frequency = explode('/', $frequency[0]); 118 $frequency = explode('/', $frequency[0]);
119 //查询当前已发布几篇 119 //查询当前已发布几篇
@@ -62,16 +62,16 @@ class GeoCount extends Command @@ -62,16 +62,16 @@ class GeoCount extends Command
62 if(empty($project_id)){ 62 if(empty($project_id)){
63 return true; 63 return true;
64 } 64 }
65 - $projectModel = new Project();  
66 - $geo_qualify_day = $projectModel->getValue(['id'=>$project_id],['geo_qualify_day']);  
67 $geoQuestionResModel = new GeoQuestionResult(); 65 $geoQuestionResModel = new GeoQuestionResult();
68 $platforms = ['gemini','openai','deepseek','poe','perplexity','google_ai_overview','openai-not-network','claude']; 66 $platforms = ['gemini','openai','deepseek','poe','perplexity','google_ai_overview','openai-not-network','claude'];
69 foreach ($project_id as $item){ 67 foreach ($project_id as $item){
  68 + $projectModel = new Project();
  69 + $geo_qualify_num = $projectModel->getValue(['id'=>$item],'geo_qualify_num');
70 $this->output('执行的项目ID----'.$item); 70 $this->output('执行的项目ID----'.$item);
71 //收录总数 71 //收录总数
72 $total = $geoQuestionResModel->counts(['project_id' => $item,'hit'=>['!=',0],'created_at' => ['between',[$start,$end]]]); 72 $total = $geoQuestionResModel->counts(['project_id' => $item,'hit'=>['!=',0],'created_at' => ['between',[$start,$end]]]);
73 $qualify_total = $geoQuestionResModel->counts(['platform'=>['in',['openai', 'gemini','google_ai_overview']],'project_id' => $item,'hit'=>['!=',0],'created_at' => ['between',[$start,$end]]]); 73 $qualify_total = $geoQuestionResModel->counts(['platform'=>['in',['openai', 'gemini','google_ai_overview']],'project_id' => $item,'hit'=>['!=',0],'created_at' => ['between',[$start,$end]]]);
74 - if($qualify_total > $geo_qualify_day){ 74 + if($qualify_total > $geo_qualify_num){
75 $is_qualify = 1; 75 $is_qualify = 1;
76 } 76 }
77 $data = [ 77 $data = [
@@ -66,16 +66,16 @@ class GeoCountAll extends Command @@ -66,16 +66,16 @@ class GeoCountAll extends Command
66 if(empty($project_id)){ 66 if(empty($project_id)){
67 return true; 67 return true;
68 } 68 }
69 - $projectModel = new Project();  
70 - $geo_qualify_day = $projectModel->getValue(['id'=>$project_id],['geo_qualify_day']);  
71 $geoQuestionResModel = new GeoQuestionLog(); 69 $geoQuestionResModel = new GeoQuestionLog();
72 $platforms = ['gemini','openai','deepseek','poe','perplexity','google_ai_overview','openai-not-network','claude']; 70 $platforms = ['gemini','openai','deepseek','poe','perplexity','google_ai_overview','openai-not-network','claude'];
73 foreach ($project_id as $item){ 71 foreach ($project_id as $item){
  72 + $projectModel = new Project();
  73 + $geo_qualify_num = $projectModel->getValue(['id'=>$item],'geo_qualify_num');
74 $this->output('执行的项目ID----'.$item); 74 $this->output('执行的项目ID----'.$item);
75 //收录总数 75 //收录总数
76 $total = $geoQuestionResModel->counts(['project_id' => $item,'hit'=>['!=',0],'created_at' => ['between',[$start,$end]]]); 76 $total = $geoQuestionResModel->counts(['project_id' => $item,'hit'=>['!=',0],'created_at' => ['between',[$start,$end]]]);
77 $qualify_total = $geoQuestionResModel->counts(['platform'=>['in',['openai', 'gemini','google_ai_overview']],'project_id' => $item,'hit'=>['!=',0],'created_at' => ['between',[$start,$end]]]); 77 $qualify_total = $geoQuestionResModel->counts(['platform'=>['in',['openai', 'gemini','google_ai_overview']],'project_id' => $item,'hit'=>['!=',0],'created_at' => ['between',[$start,$end]]]);
78 - if($total > $geo_qualify_day){ 78 + if($total > $geo_qualify_num){
79 $is_qualify = 1; 79 $is_qualify = 1;
80 } 80 }
81 $data = [ 81 $data = [
@@ -25,6 +25,7 @@ use App\Models\Template\Template; @@ -25,6 +25,7 @@ use App\Models\Template\Template;
25 use App\Services\ProjectServer; 25 use App\Services\ProjectServer;
26 use Illuminate\Console\Command; 26 use Illuminate\Console\Command;
27 use Illuminate\Support\Facades\DB; 27 use Illuminate\Support\Facades\DB;
  28 +use PhpOffice\PhpSpreadsheet\IOFactory;
28 29
29 class LyhImportTest extends Command 30 class LyhImportTest extends Command
30 { 31 {
@@ -52,15 +53,41 @@ class LyhImportTest extends Command @@ -52,15 +53,41 @@ class LyhImportTest extends Command
52 */ 53 */
53 public function handle() 54 public function handle()
54 { 55 {
55 - ProjectServer::useProject(3531);  
56 - echo date('Y-m-d H:i:s') . 'start->3531' . PHP_EOL;  
57 -// $this->importProductCategory('https://ecdn6-nc.globalso.com/upload/p/3654/file/2025-06/products-1.csv',3654);  
58 - $this->import3531CustomModule(3531); 56 + ProjectServer::useProject(1517);
  57 + echo date('Y-m-d H:i:s') . 'start->1517' . PHP_EOL;
  58 + $url1 = 'https://ecdn6.globalso.com/upload/p/1517/file/2025-10/horse-racing-tkd-modification-1.xlsx';//改tdk
  59 + $url2 = 'https://v6-file.globalso.com/upload/p/1517/file/2025-10/horse-racing-url-modification.xlsx';//改url路由+tdk
  60 + $this->download_1517_action($url1);
59 DB::disconnect('custom_mysql'); 61 DB::disconnect('custom_mysql');
60 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; 62 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
61 } 63 }
62 64
63 /** 65 /**
  66 + * @remark :导入
  67 + * @name :download_1517_action
  68 + * @author :lyh
  69 + * @method :post
  70 + * @time :2025/10/22 16:47
  71 + */
  72 + public function download_1517_action($url)
  73 + {
  74 + // 下载到 Laravel storage 的临时路径
  75 + $tempPath = storage_path('app/temp_url.xlsx');
  76 + file_put_contents($tempPath, file_get_contents($url));
  77 + // 载入 Excel
  78 + try {
  79 + $spreadsheet = IOFactory::load($tempPath);
  80 + $sheet = $spreadsheet->getActiveSheet();
  81 + $rows = $sheet->toArray();
  82 + unlink($tempPath);
  83 + dd($rows);
  84 + }catch (\Exception $e){
  85 + echo '文件打不开'.PHP_EOL;
  86 + DB::disconnect('custom_mysql');
  87 + }
  88 + }
  89 +
  90 + /**
64 * @remark :3951项目导入产品 91 * @remark :3951项目导入产品
65 * @name :import3951Product 92 * @name :import3951Product
66 * @author :lyh 93 * @author :lyh
@@ -44,6 +44,7 @@ use App\Models\WebSetting\WebLanguage; @@ -44,6 +44,7 @@ use App\Models\WebSetting\WebLanguage;
44 use App\Models\WorkOrder\TicketProject; 44 use App\Models\WorkOrder\TicketProject;
45 use Illuminate\Http\Request; 45 use Illuminate\Http\Request;
46 use Illuminate\Support\Facades\DB; 46 use Illuminate\Support\Facades\DB;
  47 +use Illuminate\Support\Facades\Http;
47 48
48 /** 49 /**
49 * 项目管理 50 * 项目管理
@@ -320,7 +321,7 @@ class ProjectController extends BaseController @@ -320,7 +321,7 @@ class ProjectController extends BaseController
320 } 321 }
321 } 322 }
322 if(isset($this->map['seo_plan'])){ 323 if(isset($this->map['seo_plan'])){
323 - $query = $query->where('gl_project_deploy_build.seo_plan','!=',0); 324 + $query = $query->whereNotIn('gl_project_deploy_build.seo_plan',[0,9])->where('gl_project_deploy_build.plan',0);
324 } 325 }
325 if(isset($this->map['site_status'])){ 326 if(isset($this->map['site_status'])){
326 $query = $query->where('gl_project.site_status',$this->map['site_status']); 327 $query = $query->where('gl_project.site_status',$this->map['site_status']);
@@ -1328,4 +1329,26 @@ class ProjectController extends BaseController @@ -1328,4 +1329,26 @@ class ProjectController extends BaseController
1328 $data['videoFrequency'] =$videoModel->videoFrequency(); 1329 $data['videoFrequency'] =$videoModel->videoFrequency();
1329 $this->response('success',Code::SUCCESS,$data); 1330 $this->response('success',Code::SUCCESS,$data);
1330 } 1331 }
  1332 +
  1333 + /**
  1334 + * @remark :获取广告先投特批
  1335 + * @name :getSpAdsLists
  1336 + * @author :lyh
  1337 + * @method :post
  1338 + * @time :2025/10/22 16:59
  1339 + */
  1340 + public function getSpAdsLists()
  1341 + {
  1342 + $url = 'https://oa.cmer.com/api/sp_ads_lists';
  1343 + // 发送 GET 请求(附带 token)
  1344 + $params['token'] = md5('qqs' . date('Y-m-d'));
  1345 + $response = Http::get($url, $params);
  1346 + // 判断请求是否成功
  1347 + if ($response->successful()) {
  1348 + $data = $response->json(); // 自动解析 JSON
  1349 + $this->response('success', Code::SUCCESS, $data);
  1350 + } else {
  1351 + $this->fail('拉取结果失败,请联系管理员');
  1352 + }
  1353 + }
1331 } 1354 }
@@ -5,6 +5,8 @@ namespace App\Http\Logic\Bside\HomeCount; @@ -5,6 +5,8 @@ namespace App\Http\Logic\Bside\HomeCount;
5 5
6 use App\Helper\FormGlobalsoApi; 6 use App\Helper\FormGlobalsoApi;
7 use App\Http\Logic\Bside\BaseLogic; 7 use App\Http\Logic\Bside\BaseLogic;
  8 +use App\Models\Geo\GeoCount;
  9 +use App\Models\RankData\RankDataBmseo;
8 use App\Models\Template\BCustomTemplate; 10 use App\Models\Template\BCustomTemplate;
9 use App\Models\Visit\Visit; 11 use App\Models\Visit\Visit;
10 use App\Models\Visit\VisitItem; 12 use App\Models\Visit\VisitItem;
@@ -102,11 +104,12 @@ class CountLogic extends BaseLogic @@ -102,11 +104,12 @@ class CountLogic extends BaseLogic
102 */ 104 */
103 public function keyword_data_count(){ 105 public function keyword_data_count(){
104 $version = $this->project['version'] ?? ''; 106 $version = $this->project['version'] ?? '';
105 - if(!empty($version) && $version != '7.5'){  
106 -  
107 - }  
108 $yesterday = date('Y-m-d'); 107 $yesterday = date('Y-m-d');
109 - $rankDataModel = new RankDataModel(); 108 + if($this->user['project_seo_type'] == 1){
  109 + $rankDataModel = new RankDataBmseo();
  110 + }else{
  111 + $rankDataModel = new RankDataModel();
  112 + }
110 $param = [ 113 $param = [
111 'updated_date' => $yesterday, 114 'updated_date' => $yesterday,
112 'project_id' => $this->user['project_id'] 115 'project_id' => $this->user['project_id']
@@ -121,6 +124,13 @@ class CountLogic extends BaseLogic @@ -121,6 +124,13 @@ class CountLogic extends BaseLogic
121 $data = []; 124 $data = [];
122 } 125 }
123 } 126 }
  127 + if(!empty($version) && ($version == '7.5')){
  128 + $geoCountModel = new GeoCount();
  129 + $geoInfo = $geoCountModel->where('project_id',$this->user['project_id'])->where('date', '<=', date('Y-m-d'))->orderBy('date', 'desc')->first();
  130 + $geoInfo = $geoInfo ? $geoInfo->toArray() : [];
  131 + $data['geo_qualify_total'] = $geoInfo['qualify_total'] ?? 0;
  132 + $data['total_count'] = ($this->project['deploy_build']['keyword_num'] ?? 0) + ($this->project['geo_qualify_num'] ?? 0);
  133 + }
124 return $this->success($data); 134 return $this->success($data);
125 } 135 }
126 136
@@ -286,6 +286,7 @@ class UserLoginLogic @@ -286,6 +286,7 @@ class UserLoginLogic
286 $info['is_watermark'] = $project['is_watermark']; 286 $info['is_watermark'] = $project['is_watermark'];
287 $info['configuration'] = $project['deploy_build']['configuration']; 287 $info['configuration'] = $project['deploy_build']['configuration'];
288 $info['project_type'] = $project['type']; 288 $info['project_type'] = $project['type'];
  289 + $info['version'] = $project['version'] ?? 6;
289 $info['project_seo_type'] = $project['project_type']; 290 $info['project_seo_type'] = $project['project_type'];
290 $info['storage_type'] = $project['storage_type']; 291 $info['storage_type'] = $project['storage_type'];
291 $info['open_export_product'] = $project['open_export_product']; 292 $info['open_export_product'] = $project['open_export_product'];
@@ -55,7 +55,7 @@ class LoginAuthMiddleware @@ -55,7 +55,7 @@ class LoginAuthMiddleware
55 //操作权限设置 55 //操作权限设置
56 $projectRoleModel = new ProjectRoleModel(); 56 $projectRoleModel = new ProjectRoleModel();
57 $role_info = $projectRoleModel->read(['id'=>$info['role_id']]); 57 $role_info = $projectRoleModel->read(['id'=>$info['role_id']]);
58 - if($role_info['status'] != 0){ 58 + if($role_info === false || $role_info['status'] != 0){
59 return response(['code'=>Code::USER_LOGIN_ERROE,'message'=>'当前用户角色被禁用']); 59 return response(['code'=>Code::USER_LOGIN_ERROE,'message'=>'当前用户角色被禁用']);
60 } 60 }
61 return $role_info; 61 return $role_info;
@@ -35,7 +35,7 @@ class GeoPlatform extends Base @@ -35,7 +35,7 @@ class GeoPlatform extends Base
35 public function getList(){ 35 public function getList(){
36 // $data = Cache::get('geo_platform'); 36 // $data = Cache::get('geo_platform');
37 // if(empty($data)){ 37 // if(empty($data)){
38 - $data = $this->list(['status'=>$this::STATUS_ON],'id',['name','en_name','icon','sort'],'asc'); 38 + $data = $this->list(['status'=>$this::STATUS_ON],'sort',['name','en_name','icon','sort'],'desc');
39 Cache::put('geo_platform',$data,'12 * 3600'); 39 Cache::put('geo_platform',$data,'12 * 3600');
40 // } 40 // }
41 return $data; 41 return $data;
@@ -79,7 +79,9 @@ class Project extends Base @@ -79,7 +79,9 @@ class Project extends Base
79 3=>'2-4', 79 3=>'2-4',
80 4=>'3-5', 80 4=>'3-5',
81 5=>'5-7', 81 5=>'5-7',
82 - 6=>'1/2' 82 + 6=>'1/2',
  83 + 7=>'1/3',
  84 + 8=>'1/1',
83 ]; 85 ];
84 if($val){ 86 if($val){
85 return $arr[$val] ?? ''; 87 return $arr[$val] ?? '';
@@ -207,6 +207,7 @@ Route::middleware(['aloginauth'])->group(function () { @@ -207,6 +207,7 @@ Route::middleware(['aloginauth'])->group(function () {
207 Route::any('/saveSiteStatus', [Aside\Project\ProjectController::class, 'saveSiteStatus'])->name('admin.project_saveSiteStatus'); 207 Route::any('/saveSiteStatus', [Aside\Project\ProjectController::class, 'saveSiteStatus'])->name('admin.project_saveSiteStatus');
208 Route::any('/updateTdk', [Aside\Project\ProjectController::class, 'updateTdk'])->name('admin.project_updateTdk');//更新项目tdk 208 Route::any('/updateTdk', [Aside\Project\ProjectController::class, 'updateTdk'])->name('admin.project_updateTdk');//更新项目tdk
209 Route::any('/videoSetting', [Aside\Project\ProjectController::class, 'videoSetting'])->name('admin.project_videoSetting');//项目管理AI.video设置 209 Route::any('/videoSetting', [Aside\Project\ProjectController::class, 'videoSetting'])->name('admin.project_videoSetting');//项目管理AI.video设置
  210 + Route::any('/getSpAdsLists', [Aside\Project\ProjectController::class, 'getSpAdsLists'])->name('admin.project_getSpAdsLists');//项目管理广告投放
210 //获取关键词前缀和后缀 211 //获取关键词前缀和后缀
211 Route::prefix('keyword')->group(function () { 212 Route::prefix('keyword')->group(function () {
212 Route::any('/getKeywordPrefix', [Aside\Project\KeywordPrefixController::class, 'getKeywordPrefix'])->name('admin.keyword_getKeywordPrefix'); 213 Route::any('/getKeywordPrefix', [Aside\Project\KeywordPrefixController::class, 'getKeywordPrefix'])->name('admin.keyword_getKeywordPrefix');