作者 lyh

gx异步执行更新列表页

@@ -65,8 +65,24 @@ class UpdateRoute extends Command @@ -65,8 +65,24 @@ class UpdateRoute extends Command
65 ProjectServer::useProject($v['id']); 65 ProjectServer::useProject($v['id']);
66 $webSettingModel = new WebSetting(); 66 $webSettingModel = new WebSetting();
67 $settingInfo = $webSettingModel->read(['project_id'=>$v['id']]); 67 $settingInfo = $webSettingModel->read(['project_id'=>$v['id']]);
68 - if($settingInfo !== false && ($settingInfo['anchor_num'] > 3)){  
69 - $webSettingModel->edit(['anchor_num'=>3],['project_id'=>$v['id']]); 68 + if($settingInfo === false){
  69 + echo date('Y-m-d H:i:s') . '当前项目的设置数据不存在:'.$v['id'] . PHP_EOL;
  70 + continue;
  71 + }
  72 + if($settingInfo !== false){
  73 + if($settingInfo['anchor_page_num'] == 0){
  74 + $settingInfo['anchor_page_num'] = 1;
  75 + }
  76 + if(empty($settingInfo['anchor_setting'])){
  77 + $settingInfo['anchor_setting'] = ["3","4","5"];
  78 + }
  79 + $data = [
  80 + 'anchor_setting'=>$settingInfo['anchor_setting'],
  81 + 'anchor_is_enable'=>1,
  82 + 'anchor_page_num'=>$settingInfo['anchor_page_num'],
  83 + 'anchor_keyword_is_enable'=>1
  84 + ];
  85 + $webSettingModel->edit($data,['project_id'=>$v['id']]);
70 } 86 }
71 DB::disconnect('custom_mysql'); 87 DB::disconnect('custom_mysql');
72 } 88 }
@@ -64,7 +64,7 @@ class WebSettingTextLogic extends BaseLogic @@ -64,7 +64,7 @@ class WebSettingTextLogic extends BaseLogic
64 $this->param['anchor_keyword_is_enable'] = 0; 64 $this->param['anchor_keyword_is_enable'] = 0;
65 } 65 }
66 $data = [ 66 $data = [
67 - 'anchor_setting'=>$this->param['anchor_setting'], 67 + 'anchor_setting'=>$this->param['anchor_setting'] ?? [],
68 'anchor_is_enable'=>$this->param['anchor_is_enable'], 68 'anchor_is_enable'=>$this->param['anchor_is_enable'],
69 'anchor_num'=>$this->param['anchor_num'] ?? 0, 69 'anchor_num'=>$this->param['anchor_num'] ?? 0,
70 'anchor_page_num'=>$this->param['anchor_page_num'] ?? 0, 70 'anchor_page_num'=>$this->param['anchor_page_num'] ?? 0,