作者 李宇航

合并分支 'lyh-server' 到 'master'

gx添加随机模块



查看合并请求 !2070
@@ -57,36 +57,14 @@ class lyhDemo extends Command @@ -57,36 +57,14 @@ class lyhDemo extends Command
57 57
58 public function handle(){ 58 public function handle(){
59 $projectModel = new Project(); 59 $projectModel = new Project();
60 - $lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'extend_type'=>0,'type'=>['in',[2,3,4,6]]], 'id', ['id']); 60 + $lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'extend_type'=>0,'type'=>['in',[1,2,3,4,6]]], 'id', ['id']);
61 foreach ($lists as $item){ 61 foreach ($lists as $item){
62 - echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL; 62 +// echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL;
63 ProjectServer::useProject($item['id']); 63 ProjectServer::useProject($item['id']);
64 - $authorModel = new AiBlogAuthor();  
65 - $author_list = $authorModel->list(['id'=>['>',0]]);  
66 - if(empty($author_list)){  
67 - echo '跳过的项目id:'.$item['id'].PHP_EOL;  
68 - DB::disconnect('custom_mysql');  
69 - continue;  
70 - }  
71 - $projectAiSettingModel = new ProjectAiSetting();  
72 - $aiSettingInfo = $projectAiSettingModel->read(['project_id'=>$item['id']]);  
73 - if($aiSettingInfo === false){  
74 - echo '跳过的项目id:'.$item['id'].PHP_EOL;  
75 - DB::disconnect('custom_mysql');  
76 - continue;  
77 - }  
78 - $aiBlogService = new AiBlogService($item['id']);  
79 - foreach ($author_list as $val){  
80 - $aiBlogService->author_id = $val['author_id'];  
81 - $result = $aiBlogService->getAuthorDetail();  
82 - if(isset($result['status']) && $result['status'] == 200){  
83 - //当前作者的页面  
84 - $aiBlogAuthorModel = new AiBlogAuthor();  
85 - $authorInfo = $aiBlogAuthorModel->read(['author_id'=>$val['author_id']],['id','route']);  
86 - if($authorInfo !== false && !empty($result['data']['section'])){  
87 - $aiBlogAuthorModel->edit(['text'=>$result['data']['section']],['author_id'=>$val['author_id']]);  
88 - }  
89 - } 64 + $webSettingModel = new WebSetting();
  65 + $info = $webSettingModel->read(['project_id'=>$item['id']]);
  66 + if($info === false){
  67 + echo '当前数据为空:'.$item['id'];
90 } 68 }
91 DB::disconnect('custom_mysql'); 69 DB::disconnect('custom_mysql');
92 } 70 }
@@ -24,7 +24,8 @@ class WebSettingLogic extends BaseLogic @@ -24,7 +24,8 @@ class WebSettingLogic extends BaseLogic
24 public function setting_read(){ 24 public function setting_read(){
25 $info = $this->model->read(['project_id'=>$this->user['project_id']]); 25 $info = $this->model->read(['project_id'=>$this->user['project_id']]);
26 if($info === false){ 26 if($info === false){
27 - $info = []; 27 + $this->model->addReturnId(['project_id'=>$this->user['project_id']]);
  28 + $info =$this->model->read(['project_id'=>$this->user['project_id']]);
28 } 29 }
29 return $this->success($info); 30 return $this->success($info);
30 } 31 }