作者 刘锟

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

正在显示 33 个修改的文件 包含 266 行增加61 行删除
@@ -31,7 +31,7 @@ class ImportCustomModule extends Command @@ -31,7 +31,7 @@ class ImportCustomModule extends Command
31 * 31 *
32 * @var string 32 * @var string
33 */ 33 */
34 - protected $description = 'import_custom_module'; 34 + protected $description = '特殊项目导入扩展模块及扩展数据';
35 35
36 /** 36 /**
37 * @remark :导入 37 * @remark :导入
@@ -33,7 +33,7 @@ class CountAll extends Command @@ -33,7 +33,7 @@ class CountAll extends Command
33 * 33 *
34 * @var string 34 * @var string
35 */ 35 */
36 - protected $description = '升级项目统计'; 36 + protected $description = '所有项目统计';
37 37
38 public function handle(){ 38 public function handle(){
39 $projectModel = new Project(); 39 $projectModel = new Project();
@@ -27,7 +27,7 @@ class CountDate extends Command @@ -27,7 +27,7 @@ class CountDate extends Command
27 * 27 *
28 * @var string 28 * @var string
29 */ 29 */
30 - protected $description = '时间统计记录'; 30 + protected $description = '按时间统计所有项目记录';
31 31
32 /** 32 /**
33 * @name :(定时执行生成昨日数据统计)handle 33 * @name :(定时执行生成昨日数据统计)handle
@@ -35,7 +35,7 @@ class CountProject extends Command @@ -35,7 +35,7 @@ class CountProject extends Command
35 * 35 *
36 * @var string 36 * @var string
37 */ 37 */
38 - protected $description = '升级项目统计'; 38 + protected $description = '按项目统计日记录';
39 39
40 public function handle(){ 40 public function handle(){
41 $project_id = $this->argument('project_id'); 41 $project_id = $this->argument('project_id');
@@ -25,7 +25,7 @@ class InquiryDelay extends Command @@ -25,7 +25,7 @@ class InquiryDelay extends Command
25 * 25 *
26 * @var string 26 * @var string
27 */ 27 */
28 - protected $description = '延时询盘转发'; 28 + protected $description = '延时询盘转发(暂时弃用)';
29 29
30 /** 30 /**
31 * @remark :延时询盘转发 31 * @remark :延时询盘转发
@@ -272,9 +272,10 @@ class postInquiry extends Command @@ -272,9 +272,10 @@ class postInquiry extends Command
272 'email' => $detail['email'], 272 'email' => $detail['email'],
273 'phone' => $detail['phone'], 273 'phone' => $detail['phone'],
274 'post_id' => $log['url'], 274 'post_id' => $log['url'],
  275 + 'message' => $detail['message'],
275 ]; 276 ];
276 $res = Http::withoutVerifying()->post('https://fob.ai.cc/api/ad_to_scrm', $data)->json(); 277 $res = Http::withoutVerifying()->post('https://fob.ai.cc/api/ad_to_scrm', $data)->json();
277 - if (empty($res['code']) || $res['code'] != 200) { 278 + if (empty($res['status']) || $res['status'] != 200) {
278 $log->status = ReInquiryDetailLog::STATUS_FAIL; 279 $log->status = ReInquiryDetailLog::STATUS_FAIL;
279 $log->remark = mb_substr($res['message'] ?? '', 0, 200); 280 $log->remark = mb_substr($res['message'] ?? '', 0, 200);
280 $log->save(); 281 $log->save();
@@ -36,7 +36,7 @@ class MonthAllCount extends Command @@ -36,7 +36,7 @@ class MonthAllCount extends Command
36 * 36 *
37 * @var string 37 * @var string
38 */ 38 */
39 - protected $description = '升级项目统计-月统计'; 39 + protected $description = '项目统计-月统计';
40 40
41 public function handle(){ 41 public function handle(){
42 $projectModel = new Project(); 42 $projectModel = new Project();
@@ -32,7 +32,7 @@ class SendProduct extends Command @@ -32,7 +32,7 @@ class SendProduct extends Command
32 * 32 *
33 * @var string 33 * @var string
34 */ 34 */
35 - protected $description = '根据发布时间发布产品'; 35 + protected $description = '自动发布--根据发布时间发布产品';
36 36
37 /** 37 /**
38 * @remark :发布 38 * @remark :发布
@@ -30,7 +30,7 @@ class CountAllProject extends Command @@ -30,7 +30,7 @@ class CountAllProject extends Command
30 * 30 *
31 * @var string 31 * @var string
32 */ 32 */
33 - protected $description = '统计所有项目设置'; 33 + protected $description = '统计所有项目设置(4.0-5.0-6.0)';
34 34
35 35
36 public function handle(){ 36 public function handle(){
@@ -28,7 +28,7 @@ class countProject extends Command @@ -28,7 +28,7 @@ class countProject extends Command
28 * 28 *
29 * @var string 29 * @var string
30 */ 30 */
31 - protected $description = '项目数据统计生成文件'; 31 + protected $description = '项目数据统计生成文件(测试脚本)';
32 32
33 public function handle(){ 33 public function handle(){
34 $start = '2023-10'; 34 $start = '2023-10';
@@ -37,6 +37,8 @@ class ExternalLinks extends BaseCommands @@ -37,6 +37,8 @@ class ExternalLinks extends BaseCommands
37 //有排名api编号的项目 37 //有排名api编号的项目
38 $list = DeployOptimize::where('api_no', '>', 0)->select('domain', 'api_no', 'project_id')->get()->toArray(); 38 $list = DeployOptimize::where('api_no', '>', 0)->select('domain', 'api_no', 'project_id')->get()->toArray();
39 Log::channel('rank_data')->info('开始-外链数据-'.count($list)); 39 Log::channel('rank_data')->info('开始-外链数据-'.count($list));
  40 + //特殊项目
  41 + $list[] = ['api_no' => 11201, 'project_id' => 2104];
40 foreach ($list as $item) { 42 foreach ($list as $item) {
41 $rankDataLogic = new RankDataLogic(); 43 $rankDataLogic = new RankDataLogic();
42 $rankDataLogic->syncExternalLinks($item['api_no']); 44 $rankDataLogic->syncExternalLinks($item['api_no']);
@@ -43,6 +43,10 @@ class IndexedPages extends BaseCommands @@ -43,6 +43,10 @@ class IndexedPages extends BaseCommands
43 }else{ 43 }else{
44 foreach ($site_res as $api_no => $num){ 44 foreach ($site_res as $api_no => $num){
45 $project_ids = DeployOptimize::where('api_no', $api_no)->pluck('project_id'); 45 $project_ids = DeployOptimize::where('api_no', $api_no)->pluck('project_id');
  46 + //特殊项目
  47 + if($api_no == 11201){
  48 + $project_ids[] = 2104;
  49 + }
46 foreach ($project_ids as $project_id){ 50 foreach ($project_ids as $project_id){
47 $rank_data = RankData::where('project_id', $project_id)->where('lang', '')->first(); 51 $rank_data = RankData::where('project_id', $project_id)->where('lang', '')->first();
48 if($rank_data){ 52 if($rank_data){
@@ -56,7 +60,7 @@ class IndexedPages extends BaseCommands @@ -56,7 +60,7 @@ class IndexedPages extends BaseCommands
56 //有排名api编号的项目 60 //有排名api编号的项目
57 $list = DeployOptimize::where('api_no', '>', 0)->pluck('api_no', 'project_id')->toArray(); 61 $list = DeployOptimize::where('api_no', '>', 0)->pluck('api_no', 'project_id')->toArray();
58 Log::channel('rank_data')->info('开始-页面收录数据-'.count($list)); 62 Log::channel('rank_data')->info('开始-页面收录数据-'.count($list));
59 - 63 + $list[2104] = 11201;
60 foreach ($list as $project_id => $api_no) { 64 foreach ($list as $project_id => $api_no) {
61 Log::channel('rank_data')->info('开始-页面收录数据-' . $project_id . '->' .$api_no); 65 Log::channel('rank_data')->info('开始-页面收录数据-' . $project_id . '->' .$api_no);
62 $rankDataLogic = new RankDataLogic(); 66 $rankDataLogic = new RankDataLogic();
@@ -48,7 +48,11 @@ class RankData extends BaseCommands @@ -48,7 +48,11 @@ class RankData extends BaseCommands
48 Cache::set('clear_remain_today_' . date('Y-m-d'), 1, 24 * 3600); 48 Cache::set('clear_remain_today_' . date('Y-m-d'), 1, 24 * 3600);
49 } 49 }
50 //有排名api编号的项目 50 //有排名api编号的项目
51 - $list = DeployOptimize::where('api_no', '>', 0)->select('api_no', 'project_id')->orderBy('project_id', 'asc')->get(); 51 + $list = DeployOptimize::where('api_no', '>', 0)->select('api_no', 'project_id')->orderBy('project_id', 'asc')->get()->toArray();
  52 + //特殊项目 一个项目多个apino
  53 + $list[] = ['api_no' => 11201, 'project_id' => 2104];
  54 + $list[] = ['api_no' => 10690, 'project_id' => 2104];
  55 +
52 Log::channel('rank_data')->info('开始-排名数据-' . count($list)); 56 Log::channel('rank_data')->info('开始-排名数据-' . count($list));
53 foreach ($list as $item){ 57 foreach ($list as $item){
54 RankDataLogModel::addTask($item['project_id'], $item['api_no']); 58 RankDataLogModel::addTask($item['project_id'], $item['api_no']);
@@ -56,6 +60,7 @@ class RankData extends BaseCommands @@ -56,6 +60,7 @@ class RankData extends BaseCommands
56 //小语种 60 //小语种
57 $api = new QuanqiusouApi(); 61 $api = new QuanqiusouApi();
58 $lang_list = $api->getLangList(); 62 $lang_list = $api->getLangList();
  63 +
59 foreach ($list as $item){ 64 foreach ($list as $item){
60 $langs = $lang_list[$item['api_no']] ?? []; 65 $langs = $lang_list[$item['api_no']] ?? [];
61 foreach ($langs as $lang){ 66 foreach ($langs as $lang){
@@ -76,7 +76,7 @@ class RankDataLog extends BaseCommands @@ -76,7 +76,7 @@ class RankDataLog extends BaseCommands
76 $log->data = Arr::s2a($res); 76 $log->data = Arr::s2a($res);
77 //保存数据 77 //保存数据
78 $this->output('保存排名数据:ID'.$log->project_id . ',APINO' . $log->api_no); 78 $this->output('保存排名数据:ID'.$log->project_id . ',APINO' . $log->api_no);
79 - $is_compliance = (new RankDataLogic())->save_rank($log->project_id, $res, null, $log->lang); 79 + $is_compliance = (new RankDataLogic())->save_rank($log->project_id, $log->api_no, $res, null, $log->lang);
80 $log->is_compliance = $is_compliance; 80 $log->is_compliance = $is_compliance;
81 $log->status = 1; 81 $log->status = 1;
82 $log->save(); 82 $log->save();
@@ -73,6 +73,8 @@ class RankDataTask extends Command @@ -73,6 +73,8 @@ class RankDataTask extends Command
73 $rankDataLogic->syncSpeed($item['data']['api_no'], true); 73 $rankDataLogic->syncSpeed($item['data']['api_no'], true);
74 //每周排名数据 74 //每周排名数据
75 $rankDataLogic->syncRankWeek($item['data']['api_no'], true); 75 $rankDataLogic->syncRankWeek($item['data']['api_no'], true);
  76 + //收录数
  77 + $rankDataLogic->syncIndexedPages($item['data']['api_no'], true);
76 78
77 $item->status = NoticeLog::STATUS_SUCCESS; 79 $item->status = NoticeLog::STATUS_SUCCESS;
78 $item->save(); 80 $item->save();
@@ -36,6 +36,8 @@ class RankWeek extends BaseCommands @@ -36,6 +36,8 @@ class RankWeek extends BaseCommands
36 { 36 {
37 //有排名api编号的项目 37 //有排名api编号的项目
38 $list = DeployOptimize::where('api_no', '>', 0)->pluck('api_no', 'project_id')->toArray(); 38 $list = DeployOptimize::where('api_no', '>', 0)->pluck('api_no', 'project_id')->toArray();
  39 + //特殊处理
  40 + $list[2104] = 11201;
39 LogUtils::info('start rank_data_week:' . count($list)); 41 LogUtils::info('start rank_data_week:' . count($list));
40 foreach ($list as $project_id => $api_no) { 42 foreach ($list as $project_id => $api_no) {
41 $rankDataLogic = new RankDataLogic(); 43 $rankDataLogic = new RankDataLogic();
@@ -36,6 +36,8 @@ class RecommDomain extends BaseCommands @@ -36,6 +36,8 @@ class RecommDomain extends BaseCommands
36 { 36 {
37 //有排名api编号的项目 37 //有排名api编号的项目
38 $list = DeployOptimize::where('api_no', '>', 0)->select('domain', 'api_no', 'project_id')->get()->toArray(); 38 $list = DeployOptimize::where('api_no', '>', 0)->select('domain', 'api_no', 'project_id')->get()->toArray();
  39 + //特殊处理
  40 + $list[] = ['api_no' => 11201, 'project_id' => 2104];
39 Log::channel('rank_data')->info('开始-外链引荐域名数据-'.count($list)); 41 Log::channel('rank_data')->info('开始-外链引荐域名数据-'.count($list));
40 42
41 foreach ($list as $item) { 43 foreach ($list as $item) {
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 * @time :2024/4/17 10:05 7 * @time :2024/4/17 10:05
8 */ 8 */
9 9
10 -namespace App\Console\Commands\Sync; 10 +namespace App\Console\Commands\SyncFilesImage;
11 11
12 use App\Models\File\ErrorFile; 12 use App\Models\File\ErrorFile;
13 use Illuminate\Console\Command; 13 use Illuminate\Console\Command;
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 * @time :2024/9/11 10:39 7 * @time :2024/9/11 10:39
8 */ 8 */
9 9
10 -namespace App\Console\Commands\Sync; 10 +namespace App\Console\Commands\SyncFilesImage;
11 11
12 use App\Models\File\Image; 12 use App\Models\File\Image;
13 use App\Models\File\ImageSetting; 13 use App\Models\File\ImageSetting;
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 * @time :2024/8/14 14:23 7 * @time :2024/8/14 14:23
8 */ 8 */
9 9
10 -namespace App\Console\Commands\Sync; 10 +namespace App\Console\Commands\SyncFilesImage;
11 11
12 use App\Models\File\ErrorFile; 12 use App\Models\File\ErrorFile;
13 use App\Models\File\File; 13 use App\Models\File\File;
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :UpdateBuildConfiguration.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2024/12/11 11:30
  8 + */
  9 +
  10 +namespace App\Console\Commands\Test;
  11 +
  12 +use App\Models\Product\Detail;
  13 +use App\Models\Product\Product;
  14 +use App\Models\Project\DeployBuild;
  15 +use App\Models\Project\Project;
  16 +use App\Services\ProjectServer;
  17 +use Illuminate\Console\Command;
  18 +use Illuminate\Support\Facades\DB;
  19 +
  20 +class UpdateBuildConfiguration extends Command
  21 +{
  22 + /**
  23 + * The name and signature of the console command.
  24 + *
  25 + * @var string
  26 + */
  27 + protected $signature = 'update_build_configuration';
  28 +
  29 + /**
  30 + * The console command description.
  31 + *
  32 + * @var string
  33 + */
  34 + protected $description = '更新部署表中-产品-博客-新闻-是否开启可视化';
  35 +
  36 + /**
  37 + * @remark :执行脚本
  38 + * @name :handle
  39 + * @author :lyh
  40 + * @method :post
  41 + * @time :2024/12/11 11:49
  42 + */
  43 + public function handle(){
  44 + //查询当前的所有项目都开启可视化
  45 + $buildModel = new DeployBuild();
  46 + $lists = $buildModel->list();
  47 + foreach ($lists as $k => $v){
  48 + $v['configuration']['is_product'] = $v['configuration']['is_news'] = $v['configuration']['is_blogs'] = $v['configuration']['is_module'] = 1;
  49 + $buildModel->edit(['configuration'=>json_encode($v['configuration'],true)],['id'=>$v['id']]);
  50 + echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
  51 + }
  52 + echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
  53 + }
  54 +
  55 + /**
  56 + * @remark :清洗产品新描述数据
  57 + * @name :handles
  58 + * @author :lyh
  59 + * @method :post
  60 + * @time :2024/12/11 14:33
  61 + */
  62 + public function handles(){
  63 + $projectModel = new Project();
  64 + $list = $projectModel->list(['delete_status'=>0]);
  65 + foreach ($list as $k => $v){
  66 + echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
  67 + ProjectServer::useProject($v['id']);
  68 + $this->getProduct();
  69 + DB::disconnect('custom_mysql');
  70 + }
  71 + echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
  72 + }
  73 +
  74 + /**
  75 + * @remark :清洗产品新描述
  76 + * @name :getProduct
  77 + * @author :lyh
  78 + * @method :post
  79 + * @time :2024/12/11 14:40
  80 + */
  81 + public function getProduct(){
  82 + $productModel = new Product();
  83 + $lists = $productModel->list();
  84 + $detailModel = new Detail();
  85 + foreach ($lists as $k => $v){
  86 + echo date('Y-m-d H:i:s') . '产品id:'.$v['id'] . PHP_EOL;
  87 + $data = [
  88 + 'product_id'=>$v['id'],
  89 + 'column_id'=>1,
  90 + 'text_type'=>1,
  91 + 'title'=>'',
  92 + 'sort'=>1,
  93 + 'content'=>$v['describe']
  94 + ];
  95 + $detailModel->add($data);
  96 + }
  97 + }
  98 +
  99 +}
@@ -1008,8 +1008,8 @@ if (!function_exists('check_domain_record')) { @@ -1008,8 +1008,8 @@ if (!function_exists('check_domain_record')) {
1008 */ 1008 */
1009 function email_desensitize($email){ 1009 function email_desensitize($email){
1010 $parts = explode('@', $email); 1010 $parts = explode('@', $email);
1011 - $username = $parts[0];  
1012 - $domain = $parts[1]; 1011 + $username = $parts[0] ?? '';
  1012 + $domain = $parts[1] ?? '';
1013 $maskedUsername = substr($username, 0, -4) . '****'; 1013 $maskedUsername = substr($username, 0, -4) . '****';
1014 $maskedDomain = '****.' . substr($domain, -5); 1014 $maskedDomain = '****.' . substr($domain, -5);
1015 return $maskedUsername . '@' . $maskedDomain; 1015 return $maskedUsername . '@' . $maskedDomain;
@@ -38,6 +38,12 @@ class NoticeController extends BaseController @@ -38,6 +38,12 @@ class NoticeController extends BaseController
38 { 38 {
39 LogUtils::info('notice rank_data', $this->param); 39 LogUtils::info('notice rank_data', $this->param);
40 NoticeLog::createLog(NoticeLog::TYPE_RANK_DATA, $this->param); 40 NoticeLog::createLog(NoticeLog::TYPE_RANK_DATA, $this->param);
  41 +
  42 + //特殊项目 一个项目多个apino
  43 + if($this->param['api_no'] == 10690){
  44 + NoticeLog::createLog(NoticeLog::TYPE_RANK_DATA, ['api_no' => 11201]);
  45 + }
  46 +
41 $this->response('success'); 47 $this->response('success');
42 } 48 }
43 49
@@ -49,11 +49,29 @@ class OptimizeController extends BaseController @@ -49,11 +49,29 @@ class OptimizeController extends BaseController
49 if(!empty($lists) && !empty($lists['list'])){ 49 if(!empty($lists) && !empty($lists['list'])){
50 $rankDataModel = new RankData(); 50 $rankDataModel = new RankData();
51 foreach ($lists['list'] as $k => $v){ 51 foreach ($lists['list'] as $k => $v){
52 - $data = $rankDataModel->read(['project_id'=>$v['id'],'lang'=>'','updated_date'=>date('Y-m-d')],['first_page_num','indexed_pages_num']); 52 + $data = $rankDataModel->read(['project_id'=>$v['id'],'lang'=>''],['first_page_num','indexed_pages_num']);
53 $v['first_page_num'] = $data['first_page_num'] ?? 0; 53 $v['first_page_num'] = $data['first_page_num'] ?? 0;
54 $v['indexed_pages_num'] = $data['indexed_pages_num'] ?? 0; 54 $v['indexed_pages_num'] = $data['indexed_pages_num'] ?? 0;
55 $v['g'] = $this->getGNum($v['id']); 55 $v['g'] = $this->getGNum($v['id']);
56 $v = $this->handleParam($v); 56 $v = $this->handleParam($v);
  57 +
  58 + //特殊项目 两个api_no
  59 + if($v['id'] == 2104){
  60 + $keyword_num_map = [10690=>100, 11201 => 50];
  61 + $v['first_page_num'] = $v['indexed_pages_num'] = $v['g'] = $v['keyword_num'] = [];
  62 + foreach ($keyword_num_map as $api_no => $keyword_num){
  63 + $data = $rankDataModel->read(['project_id'=>$v['id'],'api_no' => $api_no, 'lang'=>''],['first_page_num','indexed_pages_num']);
  64 + $v['first_page_num'][] = $data['first_page_num'] ?? 0;
  65 + $v['indexed_pages_num'][] = $data['indexed_pages_num'] ?? 0;
  66 + $v['g'][] = $this->getGNum($v['id'], $api_no);
  67 + $v['keyword_num'][] = $keyword_num;
  68 + }
  69 + $v['first_page_num'] = implode(',', $v['first_page_num']);
  70 + $v['indexed_pages_num'] = implode(',', $v['indexed_pages_num']);
  71 + $v['g'] = implode(',', $v['g']);
  72 + $v['keyword_num'] = implode(',', $v['keyword_num']);
  73 + }
  74 +
57 $lists['list'][$k] = $v; 75 $lists['list'][$k] = $v;
58 } 76 }
59 } 77 }
@@ -99,9 +117,12 @@ class OptimizeController extends BaseController @@ -99,9 +117,12 @@ class OptimizeController extends BaseController
99 * @method :post 117 * @method :post
100 * @time :2024/1/6 11:12 118 * @time :2024/1/6 11:12
101 */ 119 */
102 - public function getGNum($project_id){ 120 + public function getGNum($project_id, $api_no = ''){
103 $num = 0; 121 $num = 0;
104 - $list = RankData::where('project_id', $project_id)->where('lang', '')->value('data') ?: []; 122 + $list = RankData::where('project_id', $project_id)->where('lang', '')
  123 + ->when($api_no, function ($query, $api_no) {
  124 + return $query->where('api_no', $api_no);
  125 + })->value('data') ?: [];
105 if(!empty($list)){ 126 if(!empty($list)){
106 foreach ($list as $v) { 127 foreach ($list as $v) {
107 $last = Arr::last($v); 128 $last = Arr::last($v);
@@ -157,7 +157,7 @@ class AdsController extends BaseController @@ -157,7 +157,7 @@ class AdsController extends BaseController
157 } 157 }
158 $is_require_num = 0; 158 $is_require_num = 0;
159 foreach ($target as $k=>$v){ 159 foreach ($target as $k=>$v){
160 - if(empty($item['url'])){ 160 + if(empty($v['url'])){
161 unset($target[$k]); 161 unset($target[$k]);
162 } 162 }
163 } 163 }
@@ -170,8 +170,10 @@ class InquiryController extends BaseController @@ -170,8 +170,10 @@ class InquiryController extends BaseController
170 //非正常登录的 170 //非正常登录的
171 171
172 if(($this->user['login_source']??0) != 2 && ($this->user['login_source']??0) != 3){ 172 if(($this->user['login_source']??0) != 2 && ($this->user['login_source']??0) != 3){
  173 + if(!empty($item['email']) && (strpos($item['email'], '@') !== false)){
  174 + $item['email'] = email_desensitize($item['email']);
  175 + }
173 //脱敏 176 //脱敏
174 - !empty($item['email']) && $item['email'] = email_desensitize($item['email']);  
175 !empty($item['phone']) && $item['phone'] = substr($item['phone'], 0, -4) . '****'; 177 !empty($item['phone']) && $item['phone'] = substr($item['phone'], 0, -4) . '****';
176 } 178 }
177 179
@@ -327,14 +327,4 @@ class LoginController extends BaseController @@ -327,14 +327,4 @@ class LoginController extends BaseController
327 return $data; 327 return $data;
328 } 328 }
329 329
330 - public function ceshi()  
331 - {  
332 - $cos = new CosService();  
333 - $cdnUrl = '/upload/p/1/image_other/2023-11/655d9c70b692e10129.png';  
334 - $data = [  
335 - 'image' => '/upload/m/image_other/2024-06/logo-162-2-1.png',  
336 - 'gravity' => 'center',  
337 - ];  
338 - return $cos->addFieldImage($cdnUrl, $data,true);  
339 - }  
340 } 330 }
@@ -531,7 +531,7 @@ class CustomTemplateLogic extends BaseLogic @@ -531,7 +531,7 @@ class CustomTemplateLogic extends BaseLogic
531 $info = $this->model->read(['id'=>$this->param['id']]); 531 $info = $this->model->read(['id'=>$this->param['id']]);
532 $param = $this->setCustomTemplateParams($info); 532 $param = $this->setCustomTemplateParams($info);
533 $save_id = $this->model->insertGetId($param); 533 $save_id = $this->model->insertGetId($param);
534 - $route = RouteMap::setRoute($param['url'], RouteMap::SOURCE_PRODUCT, $save_id, $this->user['project_id']); 534 + $route = RouteMap::setRoute($param['url'], RouteMap::SOURCE_PAGE, $save_id, $this->user['project_id']);
535 $this->model->edit(['route'=>$route],['id'=>$save_id]); 535 $this->model->edit(['route'=>$route],['id'=>$save_id]);
536 return $this->success(['id'=>$save_id]); 536 return $this->success(['id'=>$save_id]);
537 } 537 }
@@ -208,6 +208,7 @@ class ProductLogic extends BaseLogic @@ -208,6 +208,7 @@ class ProductLogic extends BaseLogic
208 public function editList(){ 208 public function editList(){
209 $category_ids = $this->param['category_id']; 209 $category_ids = $this->param['category_id'];
210 $this->param['category_id'] = $this->handleListCategory($this->param['category_id']); 210 $this->param['category_id'] = $this->handleListCategory($this->param['category_id']);
  211 + $keyword_arr = $this->param['keyword_id'];
211 $this->param['keyword_id'] = $this->saveKeyword($this->param['keyword_id']); 212 $this->param['keyword_id'] = $this->saveKeyword($this->param['keyword_id']);
212 if(isset($this->param['gallery']) && !empty($this->param['gallery'])){ 213 if(isset($this->param['gallery']) && !empty($this->param['gallery'])){
213 foreach ($this->param['gallery'] as $k => $v){ 214 foreach ($this->param['gallery'] as $k => $v){
@@ -226,6 +227,7 @@ class ProductLogic extends BaseLogic @@ -226,6 +227,7 @@ class ProductLogic extends BaseLogic
226 $this->model->edit($this->param,['id'=>$this->param['id']]); 227 $this->model->edit($this->param,['id'=>$this->param['id']]);
227 //产品分类关联 228 //产品分类关联
228 CategoryRelated::saveRelated($this->param['id'], $category_ids); 229 CategoryRelated::saveRelated($this->param['id'], $category_ids);
  230 + KeywordRelated::saveRelated($this->param['id'],$keyword_arr);
229 }catch (\Exception $e){ 231 }catch (\Exception $e){
230 $this->fail('系统错误,请连续管理员'); 232 $this->fail('系统错误,请连续管理员');
231 } 233 }
@@ -696,9 +698,7 @@ class ProductLogic extends BaseLogic @@ -696,9 +698,7 @@ class ProductLogic extends BaseLogic
696 }else{ 698 }else{
697 $product = $this->model->read(['title' => $data[0]]); 699 $product = $this->model->read(['title' => $data[0]]);
698 } 700 }
699 -  
700 if (!$product) { 701 if (!$product) {
701 -  
702 $category_id = ''; 702 $category_id = '';
703 $category_arr = []; 703 $category_arr = [];
704 if ($data[2]??'') { 704 if ($data[2]??'') {
@@ -817,9 +817,9 @@ class ProductLogic extends BaseLogic @@ -817,9 +817,9 @@ class ProductLogic extends BaseLogic
817 $seo_description = substr(strip_tags($data[10]),0,200); 817 $seo_description = substr(strip_tags($data[10]),0,200);
818 } 818 }
819 $seo_mate = [ 819 $seo_mate = [
820 - 'title' => $seo_title,  
821 - 'keyword' => $seo_keywords,  
822 - 'description' => $seo_description 820 + 'title' => $seo_title ?? '',
  821 + 'keyword' => $seo_keywords ?? '',
  822 + 'description' => $seo_description ?? ''
823 ]; 823 ];
824 //处理参数 824 //处理参数
825 $attrs = []; 825 $attrs = [];
@@ -877,7 +877,7 @@ class ProductLogic extends BaseLogic @@ -877,7 +877,7 @@ class ProductLogic extends BaseLogic
877 'intro' => $intro, 877 'intro' => $intro,
878 'content' => $content, 878 'content' => $content,
879 'describe' => Arr::a2s($describe), 879 'describe' => Arr::a2s($describe),
880 - 'seo_mate' => Arr::a2s($seo_mate), 880 + 'seo_mate' => Arr::a2s($seo_mate ?? []),
881 'created_uid' => $user_id, 881 'created_uid' => $user_id,
882 'status' => Product::STATUS_ON 882 'status' => Product::STATUS_ON
883 ] 883 ]
@@ -45,17 +45,23 @@ class RankDataLogic extends BaseLogic @@ -45,17 +45,23 @@ class RankDataLogic extends BaseLogic
45 $project_id = $this->user['project_id']; 45 $project_id = $this->user['project_id'];
46 //查数据 46 //查数据
47 $project = (new ProjectLogic())->getProjectInfo($project_id); 47 $project = (new ProjectLogic())->getProjectInfo($project_id);
  48 + if(request('api_no')){
  49 + $api_no = request('api_no');
  50 + }else{
  51 + $api_no = $project['deploy_optimize']['api_no'] ?? 0;
  52 + }
  53 +
48 $domain_info = (new DomainInfoLogic)->getDomainInfo($project_id); 54 $domain_info = (new DomainInfoLogic)->getDomainInfo($project_id);
49 - $rank = RankData::where('project_id', $project_id)->first(); 55 + $rank = RankData::where('project_id', $project_id)->where('api_no', $api_no)->first();
50 if(empty($rank) && ($project['deploy_optimize']['api_no'] != 0)){ 56 if(empty($rank) && ($project['deploy_optimize']['api_no'] != 0)){
51 $data['langs_status'] = 1; 57 $data['langs_status'] = 1;
52 } 58 }
53 - $rank_week = RankWeek::where('project_id', $project_id)->first();  
54 - $recomm_domain = RecommDomain::where('project_id', $project_id)->first();  
55 - $external_links = ExternalLinks::where('project_id', $project_id)->first();  
56 - $indexed_pages = IndexedPages::where('project_id', $project_id)->first(); 59 + $rank_week = RankWeek::where('project_id', $project_id)->where('api_no', $api_no)->first();
  60 + $recomm_domain = RecommDomain::where('project_id', $project_id)->where('api_no', $api_no)->first();
  61 + $external_links = ExternalLinks::where('project_id', $project_id)->where('api_no', $api_no)->first();
  62 + $indexed_pages = IndexedPages::where('project_id', $project_id)->where('api_no', $api_no)->first();
57 $speed = Speed::where('project_id', $project_id)->first(); 63 $speed = Speed::where('project_id', $project_id)->first();
58 - $api_no = $project['deploy_optimize']['api_no'] ?? ''; 64 +
59 //排名数据 65 //排名数据
60 $data = [ 66 $data = [
61 'first_num' => $rank['first_num'] ?? 0, 67 'first_num' => $rank['first_num'] ?? 0,
@@ -171,6 +177,13 @@ class RankDataLogic extends BaseLogic @@ -171,6 +177,13 @@ class RankDataLogic extends BaseLogic
171 'data' => $rank_week['data'] ?? [], 177 'data' => $rank_week['data'] ?? [],
172 'labels' => $rank_week['date'] ?? [], 178 'labels' => $rank_week['date'] ?? [],
173 ]; 179 ];
  180 +
  181 + //多个api_no项目 切换api_no查看数据
  182 + if($project_id == 2104){
  183 + $data['other_api_no'] = $api_no == 10690 ? 11201 : 10690;
  184 + $data['other_api_no_source'] = $api_no == 10690 ? 'Yandex' : 'Google';
  185 + }
  186 +
174 return $data; 187 return $data;
175 } 188 }
176 189
@@ -185,7 +198,12 @@ class RankDataLogic extends BaseLogic @@ -185,7 +198,12 @@ class RankDataLogic extends BaseLogic
185 $lang = $this->request['lang'] ?: ''; 198 $lang = $this->request['lang'] ?: '';
186 $project_id = $this->user['project_id']; 199 $project_id = $this->user['project_id'];
187 $project = (new ProjectLogic())->getProjectInfo($project_id); 200 $project = (new ProjectLogic())->getProjectInfo($project_id);
188 - $api_no = $project['deploy_optimize']['api_no'] ?? ''; 201 + if(request('api_no')){
  202 + $api_no = request('api_no');
  203 + }else{
  204 + $api_no = $project['deploy_optimize']['api_no'] ?? 0;
  205 + }
  206 +
189 $domain = (!empty($project['deploy_optimize']['domain']) ? ((new DomainInfo())->getDomain($project['deploy_optimize']['domain'])) : ''); 207 $domain = (!empty($project['deploy_optimize']['domain']) ? ((new DomainInfo())->getDomain($project['deploy_optimize']['domain'])) : '');
190 $domain_arr = parse_url($domain); 208 $domain_arr = parse_url($domain);
191 $domain = $domain_arr['host'] ?? $domain_arr['path']; 209 $domain = $domain_arr['host'] ?? $domain_arr['path'];
@@ -197,7 +215,7 @@ class RankDataLogic extends BaseLogic @@ -197,7 +215,7 @@ class RankDataLogic extends BaseLogic
197 $ai_projects = $this->getAiProjects()['data'] ?? []; 215 $ai_projects = $this->getAiProjects()['data'] ?? [];
198 $flg_ai = $this->getAiFlag($ai_projects, $domain); 216 $flg_ai = $this->getAiFlag($ai_projects, $domain);
199 $ai_domain = str_replace('www.', '', $this->getAiProjects($domain)['domain'] ?? ''); 217 $ai_domain = str_replace('www.', '', $this->getAiProjects($domain)['domain'] ?? '');
200 - $list = RankData::where('project_id', $project_id)->where('lang', $lang)->value('data') ?: []; 218 + $list = RankData::where('project_id', $project_id)->where('api_no', $api_no)->where('lang', $lang)->value('data') ?: [];
201 $list30 = []; //排名前三十的 219 $list30 = []; //排名前三十的
202 $list30_0 = []; //排名前三十且近三天没有排名的 220 $list30_0 = []; //排名前三十且近三天没有排名的
203 $list100 = []; //排名前100的 221 $list100 = []; //排名前100的
@@ -389,6 +407,10 @@ class RankDataLogic extends BaseLogic @@ -389,6 +407,10 @@ class RankDataLogic extends BaseLogic
389 */ 407 */
390 public function syncRankData($api_no, $site_res, $force=false){ 408 public function syncRankData($api_no, $site_res, $force=false){
391 $project_ids = DeployOptimize::where('api_no', $api_no)->pluck('project_id'); 409 $project_ids = DeployOptimize::where('api_no', $api_no)->pluck('project_id');
  410 + //特殊处理
  411 + if($api_no == 11201){
  412 + $project_ids[] = 2104;
  413 + }
392 foreach ($project_ids as $project_id) { 414 foreach ($project_ids as $project_id) {
393 Log::channel('rank_data')->info('开始查项目:' . $project_id); 415 Log::channel('rank_data')->info('开始查项目:' . $project_id);
394 $project = Project::find($project_id); 416 $project = Project::find($project_id);
@@ -406,7 +428,7 @@ class RankDataLogic extends BaseLogic @@ -406,7 +428,7 @@ class RankDataLogic extends BaseLogic
406 //收录数 428 //收录数
407 $indexed_pages_num = $site_res[$api_no] ?? 0; 429 $indexed_pages_num = $site_res[$api_no] ?? 0;
408 Log::channel('rank_data')->info('开始保存:' . $project_id); 430 Log::channel('rank_data')->info('开始保存:' . $project_id);
409 - $this->save_rank($project_id, $res, $indexed_pages_num); 431 + $this->save_rank($project_id, $api_no, $res, $indexed_pages_num);
410 } 432 }
411 //有小语种的 433 //有小语种的
412 $lang_list = $api->getLangList(); 434 $lang_list = $api->getLangList();
@@ -436,7 +458,7 @@ class RankDataLogic extends BaseLogic @@ -436,7 +458,7 @@ class RankDataLogic extends BaseLogic
436 $data[Arr::last($v)['lang']][$keyword] = $v; 458 $data[Arr::last($v)['lang']][$keyword] = $v;
437 } 459 }
438 foreach ($data as $lang => $rank) { 460 foreach ($data as $lang => $rank) {
439 - $this->save_rank($project_id, $rank, 0, $lang); 461 + $this->save_rank($project_id, $api_no, $rank, 0, $lang);
440 } 462 }
441 } 463 }
442 } 464 }
@@ -453,7 +475,7 @@ class RankDataLogic extends BaseLogic @@ -453,7 +475,7 @@ class RankDataLogic extends BaseLogic
453 * @author zbj 475 * @author zbj
454 * @date 2023/5/8 476 * @date 2023/5/8
455 */ 477 */
456 - public function save_rank($project_id, $data, $indexed_pages_num = null, string $lang = ''){ 478 + public function save_rank($project_id, $api_no, $data, $indexed_pages_num = null, string $lang = ''){
457 $without_project_ids = []; //不用处理排名的项目 479 $without_project_ids = []; //不用处理排名的项目
458 $without_extension_project_ids = [658]; //是否达标只统计主词的 480 $without_extension_project_ids = [658]; //是否达标只统计主词的
459 $extension_project_ids = [354]; //扩展词也到达标的 481 $extension_project_ids = [354]; //扩展词也到达标的
@@ -461,6 +483,14 @@ class RankDataLogic extends BaseLogic @@ -461,6 +483,14 @@ class RankDataLogic extends BaseLogic
461 354, 483 354,
462 1283 484 1283
463 ];//暂停项目id 485 ];//暂停项目id
  486 +
  487 + //一个项目多个api_no
  488 + $multiple_api_no_project_ids = [
  489 + 2104 => [
  490 + 11201 => 50, //api_no => 关键词达标数
  491 + 10690 => 100,
  492 + ]
  493 + ];
464 $first_num = $first_page_num = $first_three_pages_num = $first_five_pages_num = $first_ten_pages_num = 0; 494 $first_num = $first_page_num = $first_three_pages_num = $first_five_pages_num = $first_ten_pages_num = 0;
465 $first_page_without_extension_num = 0; //不算扩展词在首页的数量 495 $first_page_without_extension_num = 0; //不算扩展词在首页的数量
466 $first_page_extension_num = 0; //扩展词在首页的数量 496 $first_page_extension_num = 0; //扩展词在首页的数量
@@ -503,6 +533,7 @@ class RankDataLogic extends BaseLogic @@ -503,6 +533,7 @@ class RankDataLogic extends BaseLogic
503 } 533 }
504 $where = [ 534 $where = [
505 'project_id' => $project_id, 535 'project_id' => $project_id,
  536 + 'api_no' => $api_no,
506 'lang' => $lang 537 'lang' => $lang
507 ]; 538 ];
508 $model = RankData::where($where)->first(); 539 $model = RankData::where($where)->first();
@@ -513,6 +544,10 @@ class RankDataLogic extends BaseLogic @@ -513,6 +544,10 @@ class RankDataLogic extends BaseLogic
513 $this->g_top_plan($project_id,$g_top_first_page_extension_num); 544 $this->g_top_plan($project_id,$g_top_first_page_extension_num);
514 //保证关键词数 545 //保证关键词数
515 $keyword_num = DeployBuild::where('project_id', $project_id)->value('keyword_num'); 546 $keyword_num = DeployBuild::where('project_id', $project_id)->value('keyword_num');
  547 + //多api_no项目的保证关键词数
  548 + if(in_array($project_id, array_keys($multiple_api_no_project_ids))){
  549 + $keyword_num = $multiple_api_no_project_ids[$project_id][$api_no]??0;
  550 + }
516 $type = Project::where('id', $project_id)->value('type'); 551 $type = Project::where('id', $project_id)->value('type');
517 $model_is_compliance = $model->is_compliance; 552 $model_is_compliance = $model->is_compliance;
518 $model->is_compliance = 0; 553 $model->is_compliance = 0;
@@ -530,8 +565,19 @@ class RankDataLogic extends BaseLogic @@ -530,8 +565,19 @@ class RankDataLogic extends BaseLogic
530 if (($model->updated_date != date('Y-m-d') || empty($model_is_compliance)) && !$lang) { 565 if (($model->updated_date != date('Y-m-d') || empty($model_is_compliance)) && !$lang) {
531 $compliance_day = Project::where(['id' => $project_id])->value('finish_remain_day') ?: 0; 566 $compliance_day = Project::where(['id' => $project_id])->value('finish_remain_day') ?: 0;
532 if(!in_array($project_id,$ceaseProjectId)){ 567 if(!in_array($project_id,$ceaseProjectId)){
533 - Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $compliance_day + 1]);  
534 - Log::channel('rank_data')->info('项目' . $project_id . '达标天数+1:'. ($compliance_day + 1)); 568 + //多api_no项目 要api_no都分别达标才算
  569 + if(in_array($project_id, array_keys($multiple_api_no_project_ids))){
  570 + $api_nos = array_keys($multiple_api_no_project_ids[$project_id]);
  571 + //今天其他api_no是否都达标了
  572 + $count = RankData::where('project_id', $project_id)->whereIn('api_no', $api_nos)->where('api_no', '<>', $api_no)->where('date', date('Y-m-d'))
  573 + ->where('is_compliance', 1)->count();
  574 + if($count == count($api_nos) - 1){
  575 + Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $compliance_day + 1]);
  576 + }
  577 + }else{
  578 + Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $compliance_day + 1]);
  579 + }
  580 + Log::channel('rank_data')->info('项目' . $project_id . '达标天数+1:' . ($compliance_day + 1));
535 }else{ 581 }else{
536 Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $compliance_day]); 582 Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $compliance_day]);
537 Log::channel('rank_data')->info('项目' . $project_id . '暂停项目达标天数不加:'. ($compliance_day)); 583 Log::channel('rank_data')->info('项目' . $project_id . '暂停项目达标天数不加:'. ($compliance_day));
@@ -543,6 +589,7 @@ class RankDataLogic extends BaseLogic @@ -543,6 +589,7 @@ class RankDataLogic extends BaseLogic
543 } 589 }
544 $model->compliance_day = Project::where(['id' => $project_id])->value('finish_remain_day') ?: 0; 590 $model->compliance_day = Project::where(['id' => $project_id])->value('finish_remain_day') ?: 0;
545 $model->project_id = $project_id; 591 $model->project_id = $project_id;
  592 + $model->api_no = $api_no;
546 $model->first_num = $first_num; 593 $model->first_num = $first_num;
547 $model->first_page_num = $first_page_num; 594 $model->first_page_num = $first_page_num;
548 $model->first_three_pages_num = $first_three_pages_num; 595 $model->first_three_pages_num = $first_three_pages_num;
@@ -592,13 +639,17 @@ class RankDataLogic extends BaseLogic @@ -592,13 +639,17 @@ class RankDataLogic extends BaseLogic
592 */ 639 */
593 public function syncExternalLinks($api_no, $force=false){ 640 public function syncExternalLinks($api_no, $force=false){
594 $project_ids = DeployOptimize::where('api_no', $api_no)->pluck('domain', 'project_id'); 641 $project_ids = DeployOptimize::where('api_no', $api_no)->pluck('domain', 'project_id');
  642 + //特殊处理
  643 + if($api_no == 11201){
  644 + $project_ids[2104] = 'www.xabcbiology.ru';
  645 + }
595 foreach ($project_ids as $project_id => $domain) { 646 foreach ($project_ids as $project_id => $domain) {
596 if (!$domain) { 647 if (!$domain) {
597 Log::channel('rank_data')->error('syncExternalLinks:未配置正式域名', ['project_id' => $project_id, 'api_no' => $api_no]); 648 Log::channel('rank_data')->error('syncExternalLinks:未配置正式域名', ['project_id' => $project_id, 'api_no' => $api_no]);
598 continue; 649 continue;
599 } 650 }
600 651
601 - $model = ExternalLinksModel::where('project_id', $project_id)->first(); 652 + $model = ExternalLinksModel::where('project_id', $project_id)->where('api_no', $api_no)->first();
602 if ($model && $model->updated_date >= getThisWeekStarDate() && !$force) { 653 if ($model && $model->updated_date >= getThisWeekStarDate() && !$force) {
603 //continue; 654 //continue;
604 } 655 }
@@ -630,6 +681,7 @@ class RankDataLogic extends BaseLogic @@ -630,6 +681,7 @@ class RankDataLogic extends BaseLogic
630 $data = $this->_data($project_id, $res['total']); 681 $data = $this->_data($project_id, $res['total']);
631 } 682 }
632 $model->project_id = $project_id; 683 $model->project_id = $project_id;
  684 + $model->api_no = $api_no;
633 $model->total = $data['total']; 685 $model->total = $data['total'];
634 $model->data = $data['data']; 686 $model->data = $data['data'];
635 $model->updated_date = date('Y-m-d'); 687 $model->updated_date = date('Y-m-d');
@@ -679,12 +731,16 @@ class RankDataLogic extends BaseLogic @@ -679,12 +731,16 @@ class RankDataLogic extends BaseLogic
679 */ 731 */
680 public function syncRecommDomain($api_no, $force=false){ 732 public function syncRecommDomain($api_no, $force=false){
681 $project_ids = DeployOptimize::where('api_no', $api_no)->pluck('domain', 'project_id'); 733 $project_ids = DeployOptimize::where('api_no', $api_no)->pluck('domain', 'project_id');
  734 + //特殊处理
  735 + if($api_no == 11201){
  736 + $project_ids[2104] = 'www.xabcbiology.ru';
  737 + }
682 foreach ($project_ids as $project_id => $domain) { 738 foreach ($project_ids as $project_id => $domain) {
683 if (!$domain) { 739 if (!$domain) {
684 Log::channel('rank_data')->error('syncRecommDomain:未配置正式域名', ['project_id' => $project_id, 'api_no' => $api_no]); 740 Log::channel('rank_data')->error('syncRecommDomain:未配置正式域名', ['project_id' => $project_id, 'api_no' => $api_no]);
685 continue; 741 continue;
686 } 742 }
687 - $model = RecommDomainModel::where('project_id', $project_id)->first(); 743 + $model = RecommDomainModel::where('project_id', $project_id)->where('api_no', $api_no)->first();
688 if ($model && $model->updated_date >= getThisWeekStarDate() && !$force) { 744 if ($model && $model->updated_date >= getThisWeekStarDate() && !$force) {
689 continue; 745 continue;
690 } 746 }
@@ -716,6 +772,7 @@ class RankDataLogic extends BaseLogic @@ -716,6 +772,7 @@ class RankDataLogic extends BaseLogic
716 continue; 772 continue;
717 } 773 }
718 $model->project_id = $project_id; 774 $model->project_id = $project_id;
  775 + $model->api_no = $api_no;
719 $model->data = $data; 776 $model->data = $data;
720 $model->updated_date = date('Y-m-d'); 777 $model->updated_date = date('Y-m-d');
721 $model->save(); 778 $model->save();
@@ -729,8 +786,12 @@ class RankDataLogic extends BaseLogic @@ -729,8 +786,12 @@ class RankDataLogic extends BaseLogic
729 */ 786 */
730 public function syncIndexedPages($api_no, $force=false){ 787 public function syncIndexedPages($api_no, $force=false){
731 $project_ids = DeployOptimize::where('api_no', $api_no)->pluck('domain', 'project_id'); 788 $project_ids = DeployOptimize::where('api_no', $api_no)->pluck('domain', 'project_id');
  789 + //特殊处理
  790 + if($api_no == 11201){
  791 + $project_ids[2104] = 'www.xabcbiology.ru';
  792 + }
732 foreach ($project_ids as $project_id => $domain) { 793 foreach ($project_ids as $project_id => $domain) {
733 - $model = IndexedPagesModel::where('project_id', $project_id)->first(); 794 + $model = IndexedPagesModel::where('project_id', $project_id)->where('api_no', $api_no)->first();
734 if($model && $model->updated_date >= getThisWeekStarDate() && !$force){ 795 if($model && $model->updated_date >= getThisWeekStarDate() && !$force){
735 continue; 796 continue;
736 } 797 }
@@ -745,6 +806,7 @@ class RankDataLogic extends BaseLogic @@ -745,6 +806,7 @@ class RankDataLogic extends BaseLogic
745 continue; 806 continue;
746 } 807 }
747 $model->project_id = $project_id; 808 $model->project_id = $project_id;
  809 + $model->api_no = $api_no;
748 $model->data = $res['data']; 810 $model->data = $res['data'];
749 $model->updated_date = date('Y-m-d'); 811 $model->updated_date = date('Y-m-d');
750 $model->save(); 812 $model->save();
@@ -792,8 +854,12 @@ class RankDataLogic extends BaseLogic @@ -792,8 +854,12 @@ class RankDataLogic extends BaseLogic
792 */ 854 */
793 public function syncRankWeek($api_no, $force=false){ 855 public function syncRankWeek($api_no, $force=false){
794 $project_ids = DeployOptimize::where('api_no', $api_no)->pluck('domain', 'project_id'); 856 $project_ids = DeployOptimize::where('api_no', $api_no)->pluck('domain', 'project_id');
  857 + //特殊处理
  858 + if($api_no == 11201){
  859 + $project_ids[2104] = 'www.xabcbiology.ru';
  860 + }
795 foreach ($project_ids as $project_id => $domain) { 861 foreach ($project_ids as $project_id => $domain) {
796 - $rank_week = RankWeekModel::where('project_id', $project_id)->first(); 862 + $rank_week = RankWeekModel::where('project_id', $project_id)->where('api_no', $api_no)->first();
797 if ($rank_week && $rank_week->updated_date >= getThisWeekStarDate() && !$force) { 863 if ($rank_week && $rank_week->updated_date >= getThisWeekStarDate() && !$force) {
798 //本周数据已更新 864 //本周数据已更新
799 continue; 865 continue;
@@ -809,6 +875,7 @@ class RankDataLogic extends BaseLogic @@ -809,6 +875,7 @@ class RankDataLogic extends BaseLogic
809 $rank_week = new RankWeekModel(); 875 $rank_week = new RankWeekModel();
810 } 876 }
811 $rank_week->project_id = $project_id; 877 $rank_week->project_id = $project_id;
  878 + $rank_week->api_no = $api_no;
812 $rank_week->data = $res['data'][$api_no] ?? []; 879 $rank_week->data = $res['data'][$api_no] ?? [];
813 $rank_week->date = $res['date']; 880 $rank_week->date = $res['date'];
814 $rank_week->updated_date = date('Y-m-d'); 881 $rank_week->updated_date = date('Y-m-d');
@@ -33,7 +33,7 @@ class RatingLogic extends BaseLogic @@ -33,7 +33,7 @@ class RatingLogic extends BaseLogic
33 $data = [ 33 $data = [
34 'company'=>$this->project['company'] ?? '', 34 'company'=>$this->project['company'] ?? '',
35 'mobile'=>$this->user['mobile'], 35 'mobile'=>$this->user['mobile'],
36 - 'uptime'=>$this->project['uptime'], 36 + 'uptime'=>$this->project['uptime'] ?? '',
37 'domain'=>$this->user['domain'], 37 'domain'=>$this->user['domain'],
38 'question'=>$this->model->list(['type'=>$this->param['type']]), 38 'question'=>$this->model->list(['type'=>$this->param['type']]),
39 'project_id'=>$this->user['project_id'] 39 'project_id'=>$this->user['project_id']
@@ -56,6 +56,7 @@ class TranslateLogic extends BaseLogic @@ -56,6 +56,7 @@ class TranslateLogic extends BaseLogic
56 $param = $this->getRouteSource($this->param['url']); 56 $param = $this->getRouteSource($this->param['url']);
57 $param['language_id'] = $this->param['language_id']; 57 $param['language_id'] = $this->param['language_id'];
58 $param['type'] = $this->param['type']; 58 $param['type'] = $this->param['type'];
  59 + $param['url'] = $this->param['url'];
59 $info = $this->model->with('translate_data')->where($param)->first(); 60 $info = $this->model->with('translate_data')->where($param)->first();
60 //获取当前URl的所有文本内容 61 //获取当前URl的所有文本内容
61 $text_array = $this->getUrlRead($url); 62 $text_array = $this->getUrlRead($url);
@@ -279,7 +280,7 @@ class TranslateLogic extends BaseLogic @@ -279,7 +280,7 @@ class TranslateLogic extends BaseLogic
279 try { 280 try {
280 $info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'project_id'=>$this->user['project_id'],'type'=>$this->param['type']]); 281 $info = $this->model->read(['language_id'=>$this->param['language_id'],'url'=>$this->param['url'],'project_id'=>$this->user['project_id'],'type'=>$this->param['type']]);
281 if($info === false){ 282 if($info === false){
282 - $sourceInfo = $this->getRouteSource($sendData['new_route']); 283 + $sourceInfo = $this->getRouteSource($this->param['url']);
283 $param = [ 284 $param = [
284 'type'=>$this->param['type'] ?? 1, 285 'type'=>$this->param['type'] ?? 1,
285 'project_id'=>$this->user['project_id'], 286 'project_id'=>$this->user['project_id'],
@@ -289,7 +290,8 @@ class TranslateLogic extends BaseLogic @@ -289,7 +290,8 @@ class TranslateLogic extends BaseLogic
289 'source'=>$sourceInfo['source'], 290 'source'=>$sourceInfo['source'],
290 'source_id'=>$sourceInfo['source_id'], 291 'source_id'=>$sourceInfo['source_id'],
291 'is_list'=>$sourceInfo['is_list'], 292 'is_list'=>$sourceInfo['is_list'],
292 - 'is_custom'=>$sourceInfo['is_custom'] 293 + 'is_custom'=>$sourceInfo['is_custom'],
  294 + 'page'=>$sourceInfo['page'] ?? 0
293 ]; 295 ];
294 $id = $this->model->addReturnId($param); 296 $id = $this->model->addReturnId($param);
295 TranslateData::insert(['trans_id'=>$id,'data'=>json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)]); 297 TranslateData::insert(['trans_id'=>$id,'data'=>json_encode($data,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)]);
@@ -30,7 +30,7 @@ class RankDataLog extends Base @@ -30,7 +30,7 @@ class RankDataLog extends Base
30 30
31 public static function addTask($project_id, $api_no, $lang =''){ 31 public static function addTask($project_id, $api_no, $lang =''){
32 $date = date('Y-m-d'); 32 $date = date('Y-m-d');
33 - $model = self::where('project_id', $project_id)->where('date', $date)->where('lang', $lang)->first(); 33 + $model = self::where('project_id', $project_id)->where('api_no', $api_no)->where('date', $date)->where('lang', $lang)->first();
34 if($model){ 34 if($model){
35 //已达标的 35 //已达标的
36 if($model->is_compliance){ 36 if($model->is_compliance){