作者 赵彬吉
@@ -93,7 +93,10 @@ class ReplaceHtml extends Command @@ -93,7 +93,10 @@ class ReplaceHtml extends Command
93 public function createReplacePageHtmlLog($info){ 93 public function createReplacePageHtmlLog($info){
94 $saveData = []; 94 $saveData = [];
95 $customTemplateModel = new BCustomTemplate(); 95 $customTemplateModel = new BCustomTemplate();
96 - $list = $customTemplateModel->list(['status'=>BCustomTemplate::STATUS_ACTIVE]); 96 + $list = $customTemplateModel->list(['status'=>BCustomTemplate::STATUS_ACTIVE,'html'=>['like','%'.trim($info['old_html']).'%']]);
  97 + if(empty($list)){
  98 + return 0;
  99 + }
97 foreach ($list as $v){ 100 foreach ($list as $v){
98 $saveData[] = [ 101 $saveData[] = [
99 'replace_id'=>$info['id'], 102 'replace_id'=>$info['id'],
@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 9
10 namespace App\Console\Commands\ReplaceHtml; 10 namespace App\Console\Commands\ReplaceHtml;
11 11
  12 +use App\Models\Template\BCustomTemplate;
12 use App\Models\Template\BTemplate; 13 use App\Models\Template\BTemplate;
13 use App\Models\Template\TemplateReplaceHtml; 14 use App\Models\Template\TemplateReplaceHtml;
14 use App\Models\Template\TemplateReplaceHtmlLog; 15 use App\Models\Template\TemplateReplaceHtmlLog;
@@ -87,12 +88,20 @@ class ReplaceHtmlLog extends Command @@ -87,12 +88,20 @@ class ReplaceHtmlLog extends Command
87 if($info['template_id'] == 0){ 88 if($info['template_id'] == 0){
88 $bTemplateModel->formatQuery($condition)->update(['html' => DB::raw("REPLACE(html, '$old_html', '$html')")]); 89 $bTemplateModel->formatQuery($condition)->update(['html' => DB::raw("REPLACE(html, '$old_html', '$html')")]);
89 }else{ 90 }else{
  91 + if($info['source'] == 9 && $info['is_custom'] == 0){
  92 + (new BCustomTemplate())->formatQuery(['id'=>$source_id])
  93 + ->update([
  94 + 'html' => DB::raw("REPLACE(html, '" . addslashes($old_html) . "', '" . addslashes($html) . "')"),
  95 + 'updated_at' => now(),
  96 + ]);
  97 + }else{
90 $bTemplateModel->where($condition) 98 $bTemplateModel->where($condition)
91 ->update([ 99 ->update([
92 'main_html' => DB::raw("REPLACE(main_html, '" . addslashes($old_html) . "', '" . addslashes($html) . "')"), 100 'main_html' => DB::raw("REPLACE(main_html, '" . addslashes($old_html) . "', '" . addslashes($html) . "')"),
93 'updated_at' => now(), 101 'updated_at' => now(),
94 ]); 102 ]);
95 } 103 }
  104 + }
96 return true; 105 return true;
97 } 106 }
98 107
@@ -43,7 +43,6 @@ class RankDataLogic extends BaseLogic @@ -43,7 +43,6 @@ class RankDataLogic extends BaseLogic
43 public function index() 43 public function index()
44 { 44 {
45 $project_id = $this->user['project_id']; 45 $project_id = $this->user['project_id'];
46 -  
47 //查数据 46 //查数据
48 $project = (new ProjectLogic())->getProjectInfo($project_id); 47 $project = (new ProjectLogic())->getProjectInfo($project_id);
49 $domain_info = (new DomainInfoLogic)->getDomainInfo($project_id); 48 $domain_info = (new DomainInfoLogic)->getDomainInfo($project_id);
@@ -87,6 +86,9 @@ class RankDataLogic extends BaseLogic @@ -87,6 +86,9 @@ class RankDataLogic extends BaseLogic
87 //小语种列表 86 //小语种列表
88 $quanqiusou_api = new QuanqiusouApi(); 87 $quanqiusou_api = new QuanqiusouApi();
89 $lang_data = $quanqiusou_api->getLangRankData($api_no); 88 $lang_data = $quanqiusou_api->getLangRankData($api_no);
  89 + if(empty($lang_data)){
  90 + $data['langs_status'] = 1;
  91 + }
90 $lang_data = Arr::setValueToKey($lang_data, 'language'); 92 $lang_data = Arr::setValueToKey($lang_data, 'language');
91 $data['langs'] = []; 93 $data['langs'] = [];
92 $languageModel = new MinorLanguages(); 94 $languageModel = new MinorLanguages();