作者 lyh

gx数据

@@ -141,21 +141,24 @@ class LyhImportTest extends Command @@ -141,21 +141,24 @@ class LyhImportTest extends Command
141 $detailModel = new Detail(); 141 $detailModel = new Detail();
142 $columnModel = new Column(); 142 $columnModel = new Column();
143 foreach ($line_of_text as $k => $val){ 143 foreach ($line_of_text as $k => $val){
144 - if($k < 2){ 144 + if($k < 1){
145 continue; 145 continue;
146 } 146 }
147 $saveData = []; 147 $saveData = [];
148 - if($val[1] ?? ''){  
149 - $saveData['title'] = $val[1]; 148 + if(!empty($val[0])){
  149 + $saveData['title'] = $val[0];
150 }else{ 150 }else{
151 continue; 151 continue;
152 } 152 }
153 - if($val[0] ?? ''){  
154 - $cateInfo = $cateModel->read(['seo_title'=>trim($val[0])]); 153 + if(!empty($val[1])){
  154 + $cateInfo = $cateModel->read(['seo_title'=>trim($val[1])]);
155 if($cateInfo !== false){ 155 if($cateInfo !== false){
156 $saveData['category_id'] = ','.$cateInfo['id'].','; 156 $saveData['category_id'] = ','.$cateInfo['id'].',';
157 } 157 }
158 } 158 }
  159 + if(!empty($val[2])){
  160 +
  161 + }
159 $saveData['intro'] = $val[2]; 162 $saveData['intro'] = $val[2];
160 $saveData['content'] = $val[3]; 163 $saveData['content'] = $val[3];
161 $seo = ['seo_title'=>$val[5]]; 164 $seo = ['seo_title'=>$val[5]];
@@ -163,7 +163,7 @@ class ProjectLogic extends BaseLogic @@ -163,7 +163,7 @@ class ProjectLogic extends BaseLogic
163 $this->setTypeSevenEdit($this->param); 163 $this->setTypeSevenEdit($this->param);
164 }else{ 164 }else{
165 //初始化项目 165 //初始化项目
166 - $this->createProjectData($this->param); 166 + $this->param = $this->createProjectData($this->param);
167 //双向绑定服务器,需放到保存项目的上方 167 //双向绑定服务器,需放到保存项目的上方
168 $this->setServers($this->param['serve_id'],$this->param['id']); 168 $this->setServers($this->param['serve_id'],$this->param['id']);
169 //ai_blog 169 //ai_blog
@@ -196,32 +196,6 @@ class ProjectLogic extends BaseLogic @@ -196,32 +196,6 @@ class ProjectLogic extends BaseLogic
196 } 196 }
197 197
198 /** 198 /**
199 - * @remark :开启推荐供应商设置  
200 - * @name :isPurchaser  
201 - * @author :lyh  
202 - * @method :post  
203 - * @time :2025/3/10 15:33  
204 - */  
205 - public function isPurchaser($project_id){  
206 - if($this->param['type'] == Project::TYPE_TWO){  
207 - if(empty($this->param['uptime'])){  
208 - $this->param['deploy_build']['is_supplier'] = 1;  
209 - }else{  
210 - //获取项目的上线时间  
211 - $projectInfo = $this->model->read(['id'=>$project_id],['uptime']);  
212 - //查看上线时间是否大于3天  
213 - $threeDaysAgo = date('Y-m-d H:i:s', strtotime('-3 days'));  
214 - if($projectInfo['uptime'] > $threeDaysAgo){  
215 - //上线时间大于当前时间的3天钱,默认不允许关闭推荐供应商  
216 - $this->param['deploy_build']['is_supplier'] = 1;  
217 - }  
218 - }  
219 - return true;  
220 - }  
221 -  
222 - }  
223 -  
224 - /**  
225 * @remark :开启AI博客后 199 * @remark :开启AI博客后
226 * @name :setAiBlog 200 * @name :setAiBlog
227 * @author :lyh 201 * @author :lyh
@@ -350,8 +324,19 @@ class ProjectLogic extends BaseLogic @@ -350,8 +324,19 @@ class ProjectLogic extends BaseLogic
350 * @time :2023/8/30 12:14 324 * @time :2023/8/30 12:14
351 */ 325 */
352 public function saveProject($param){ 326 public function saveProject($param){
353 - if((($param['type'] == Project::TYPE_TWO) || ($param['type'] == Project::TYPE_THREE)) && empty($param['uptime'])){ 327 + if((($param['type'] == Project::TYPE_TWO) || ($param['type'] == Project::TYPE_THREE))){
  328 + //自动开启推荐供应商
  329 + if(empty($param['uptime'])){
  330 + $this->param['deploy_build']['is_supplier'] = 1;
354 $param['uptime'] = date('Y-m-d H:i:s'); 331 $param['uptime'] = date('Y-m-d H:i:s');
  332 + }else{
  333 + //查看上线时间是否大于3天
  334 + $threeDaysAgo = date('Y-m-d H:i:s', strtotime('-3 days'));
  335 + if($param['uptime'] > $threeDaysAgo){
  336 + //上线时间大于当前时间的3天钱,默认不允许关闭推荐供应商
  337 + $this->param['deploy_build']['is_supplier'] = 1;
  338 + }
  339 + }
355 } 340 }
356 if($param['type'] == Project::TYPE_FIVE){ 341 if($param['type'] == Project::TYPE_FIVE){
357 $param['extend_type'] = Project::TYPE_FIVE; 342 $param['extend_type'] = Project::TYPE_FIVE;
@@ -603,7 +588,7 @@ class ProjectLogic extends BaseLogic @@ -603,7 +588,7 @@ class ProjectLogic extends BaseLogic
603 //改为异步 588 //改为异步
604 NoticeLog::createLog(NoticeLog::TYPE_INIT_PROJECT, ['project_id' => $param['id']]); 589 NoticeLog::createLog(NoticeLog::TYPE_INIT_PROJECT, ['project_id' => $param['id']]);
605 } 590 }
606 - return $this->success(); 591 + return $this->success($param);
607 } 592 }
608 593
609 /** 594 /**