作者 张关杰

Merge branch 'develop' of http://47.244.231.31:8099/zhl/globalso-v6 into bate

@@ -262,33 +262,48 @@ class Demo extends Command @@ -262,33 +262,48 @@ class Demo extends Command
262 // 262 //
263 // print_r($include); 263 // print_r($include);
264 // } 264 // }
265 -  
266 public function handle(){ 265 public function handle(){
267 - $projectModel = new DeployOptimize();  
268 - $list = $projectModel->list();  
269 - foreach ($list as $v){  
270 - echo date('Y-m-d H:i:s') . 'end'.json_encode($v) . PHP_EOL;  
271 - $data = [];  
272 - if(!empty($v['minor_languages'])){  
273 - foreach ($v['minor_languages'] as $k1=> $v1){  
274 - if(!empty($v1['tl']) && !empty($v1['type'])){  
275 - $data[] = [  
276 - 'language'=>$v1['tl'],  
277 - 'type'=>$v1['type'],  
278 - 'keywords'=>$v1['keywords'],  
279 - 'service_day'=>$v1['service_day'],  
280 - 'project_id'=>$v['project_id'],  
281 - 'created_at'=>date('Y-m-d H:i:s'),  
282 - 'updated_at'=>date('Y-m-d H:i:s')  
283 - ]; 266 + $projectModel = new Project();
  267 + $list = $projectModel->list(['type'=>['in',[2,3]]]);
  268 + foreach ($list as $k => $v){
  269 + $domainModel = new DomainInfo();
  270 + if(!empty($v['uptime'])){
  271 + //获取项目域名的时间
  272 + $domainInfo = $domainModel->read(['project_id'=>$v['id']]);
  273 + if($domainInfo !== false){
  274 +// dd($domainInfo);
  275 + $projectModel->edit(['uptime'=>$domainInfo['created_at']],['id'=>$v['id']]);
  276 + echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
284 } 277 }
285 } 278 }
286 } 279 }
287 - $languageModel = new MinorLanguages();  
288 - $languageModel->insert($data);  
289 - }  
290 -  
291 } 280 }
  281 +// public function handle(){
  282 +// $projectModel = new DeployOptimize();
  283 +// $list = $projectModel->list(['project_id'=>['<',187]]);
  284 +// foreach ($list as $v){
  285 +// echo date('Y-m-d H:i:s') . 'end'.json_encode($v) . PHP_EOL;
  286 +// $data = [];
  287 +// if(!empty($v['minor_languages']) && is_array($v['minor_languages'])){
  288 +// foreach ($v['minor_languages'] as $k1=> $v1){
  289 +// if(!empty($v1['tl']) && !empty($v1['type'])){
  290 +// $data[] = [
  291 +// 'language'=>$v1['tl'],
  292 +// 'type'=>$v1['type'],
  293 +// 'keywords'=>$v1['keywords'],
  294 +// 'service_day'=>$v1['service_day'],
  295 +// 'project_id'=>$v['project_id'],
  296 +// 'created_at'=>date('Y-m-d H:i:s'),
  297 +// 'updated_at'=>date('Y-m-d H:i:s')
  298 +// ];
  299 +// }
  300 +// }
  301 +// }
  302 +// $languageModel = new MinorLanguages();
  303 +// $languageModel->insert($data);
  304 +// }
  305 +//
  306 +// }
292 307
293 public function printMessage() 308 public function printMessage()
294 { 309 {
@@ -55,7 +55,7 @@ class UpdateRoute extends Command @@ -55,7 +55,7 @@ class UpdateRoute extends Command
55 */ 55 */
56 public function handle(){ 56 public function handle(){
57 $projectModel = new Project(); 57 $projectModel = new Project();
58 - $list = $projectModel->list(['id'=>672]); 58 + $list = $projectModel->list(['id'=>917]);
59 $data = []; 59 $data = [];
60 foreach ($list as $v){ 60 foreach ($list as $v){
61 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; 61 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
@@ -540,6 +540,7 @@ class ProductController extends BaseController @@ -540,6 +540,7 @@ class ProductController extends BaseController
540 'keyword.required' => 'keyword不能为空', 540 'keyword.required' => 'keyword不能为空',
541 ]); 541 ]);
542 $data = http_get('http://title.globalso.com/ajax_data_for_web.php?keyword='.$this->param['keyword'],['charset=utf-8']); 542 $data = http_get('http://title.globalso.com/ajax_data_for_web.php?keyword='.$this->param['keyword'],['charset=utf-8']);
  543 + @file_put_contents(storage_path('logs/lyh_error.log'), var_export($data, true) . PHP_EOL, FILE_APPEND);
543 $this->response('success',Code::SUCCESS,$data); 544 $this->response('success',Code::SUCCESS,$data);
544 } 545 }
545 } 546 }
@@ -132,8 +132,8 @@ class ProjectLogic extends BaseLogic @@ -132,8 +132,8 @@ class ProjectLogic extends BaseLogic
132 * @time :2023/8/30 11:57 132 * @time :2023/8/30 11:57
133 */ 133 */
134 public function projectSave(){ 134 public function projectSave(){
135 -// DB::beginTransaction();  
136 -// try { 135 + DB::beginTransaction();
  136 + try {
137 $this->param['project_location'] = 0;//TODO::图片文件存储不同地方,上线后删除 137 $this->param['project_location'] = 0;//TODO::图片文件存储不同地方,上线后删除
138 if($this->param['type'] == Project::TYPE_SEVEN){ 138 if($this->param['type'] == Project::TYPE_SEVEN){
139 //错误单直接返回,单独处理 139 //错误单直接返回,单独处理
@@ -151,20 +151,15 @@ class ProjectLogic extends BaseLogic @@ -151,20 +151,15 @@ class ProjectLogic extends BaseLogic
151 $this->saveProjectDeployOptimize($this->param['deploy_optimize']); 151 $this->saveProjectDeployOptimize($this->param['deploy_optimize']);
152 //保存售后信息 152 //保存售后信息
153 $this->saveProjectAfter($this->param['project_after']); 153 $this->saveProjectAfter($this->param['project_after']);
154 -  
155 $this->saveMinorLanguages($this->param['minor_language'] ?? []); 154 $this->saveMinorLanguages($this->param['minor_language'] ?? []);
156 - //保存询盘过滤配置  
157 -// $this->param['inquiry_filter_config']['project_id'] = $this->param['id'];  
158 -// $this->saveInquiryFilterConfig($this->param['inquiry_filter_config']);  
159 $this->syncImageFile($this->param['project_location'],$this->param['id']); 155 $this->syncImageFile($this->param['project_location'],$this->param['id']);
160 //创建站点 156 //创建站点
161 -// $this->createSite($this->param);  
162 (new SyncService())->projectAcceptAddress($this->param['id']); 157 (new SyncService())->projectAcceptAddress($this->param['id']);
163 -// }  
164 -// DB::commit();  
165 -// }catch (\Exception $e){  
166 -// DB::rollBack();  
167 -// $this->fail('保存失败,请联系管理员'); 158 + }
  159 + DB::commit();
  160 + }catch (\Exception $e){
  161 + DB::rollBack();
  162 + $this->fail('保存失败,请联系管理员');
168 } 163 }
169 164
170 return $this->success(); 165 return $this->success();
@@ -189,6 +184,9 @@ class ProjectLogic extends BaseLogic @@ -189,6 +184,9 @@ class ProjectLogic extends BaseLogic
189 $param['extend_type'] = Project::TYPE_FIVE; 184 $param['extend_type'] = Project::TYPE_FIVE;
190 unset($param['type']); 185 unset($param['type']);
191 } 186 }
  187 + if((($param['type'] == Project::TYPE_TWO) || ($param['type'] == Project::TYPE_THREE)) && empty($param['uptime'])){
  188 + $param['uptime'] = date('Y-m-d H:i:s');
  189 + }
192 if(isset($param['level']) && !empty($param['level'])){ 190 if(isset($param['level']) && !empty($param['level'])){
193 $param['level'] = Arr::arrToSet($param['level']); 191 $param['level'] = Arr::arrToSet($param['level']);
194 } 192 }
@@ -228,6 +226,7 @@ class ProjectLogic extends BaseLogic @@ -228,6 +226,7 @@ class ProjectLogic extends BaseLogic
228 $param['is_visualization'] = json_encode($param['is_visualization']); 226 $param['is_visualization'] = json_encode($param['is_visualization']);
229 } 227 }
230 } 228 }
  229 +
231 $this->model->edit($param,['id'=>$param['id']]); 230 $this->model->edit($param,['id'=>$param['id']]);
232 Common::del_user_cache($this->model->getTable(),$param['id']); 231 Common::del_user_cache($this->model->getTable(),$param['id']);
233 return $this->success(); 232 return $this->success();
@@ -58,7 +58,7 @@ class RatingLogic extends BaseLogic @@ -58,7 +58,7 @@ class RatingLogic extends BaseLogic
58 'type'=>$this->param['type'] 58 'type'=>$this->param['type']
59 ]; 59 ];
60 $this->scoringModel->add($param); 60 $this->scoringModel->add($param);
61 - return $this->httpSore($this->param['data'],$this->project['post_id'],$this->param['type']); 61 + return $this->httpSore($this->param['data'],$this->project['id'],$this->param['type']);
62 } 62 }
63 63
64 /** 64 /**
@@ -30,7 +30,7 @@ class DomainInfo extends Base @@ -30,7 +30,7 @@ class DomainInfo extends Base
30 const DELETED_DELETE = 1; 30 const DELETED_DELETE = 1;
31 31
32 protected $hidden = [ 32 protected $hidden = [
33 - 'created_at', 33 +// 'created_at',
34 'updated_at' 34 'updated_at'
35 ]; 35 ];
36 36
@@ -48,7 +48,7 @@ class ProjectUpdateTdk extends Base @@ -48,7 +48,7 @@ class ProjectUpdateTdk extends Base
48 $project_id = Redis::rpop('updateSeoTdk'); 48 $project_id = Redis::rpop('updateSeoTdk');
49 $data = []; 49 $data = [];
50 if($project_id){ 50 if($project_id){
51 - $data = self::find($project_id); 51 + $data = self::where('status', self::STATUS_PENDING)->where('project_id', $project_id)->orderBy('id', 'asc')->first();
52 } 52 }
53 if($data){ 53 if($data){
54 return $data; 54 return $data;
@@ -55,10 +55,11 @@ class RouteMap extends Base @@ -55,10 +55,11 @@ class RouteMap extends Base
55 public static function generateRoute($title, $source, $source_id, $project_id){ 55 public static function generateRoute($title, $source, $source_id, $project_id){
56 if(preg_match('/[\x{4e00}-\x{9fa5}]/u', $title)){ 56 if(preg_match('/[\x{4e00}-\x{9fa5}]/u', $title)){
57 $title = Translate::tran($title, 'en'); 57 $title = Translate::tran($title, 'en');
58 - }  
59 - if (preg_match('/[а-яА-Я]/u', $title) || mb_ereg('[а-яА-Я]', $title)) { 58 + }else{
  59 + if(!preg_match('/^[a-zA-Z\s]+$/', $title)){
60 $title = Translate::tran($title, 'en'); 60 $title = Translate::tran($title, 'en');
61 } 61 }
  62 + }
62 $i=1; 63 $i=1;
63 $sign = generateRoute($title); 64 $sign = generateRoute($title);
64 $info = self::where(['project_id' => $project_id, 'source' => $source, 'source_id'=>$source_id])->first(); 65 $info = self::where(['project_id' => $project_id, 'source' => $source, 'source_id'=>$source_id])->first();