作者 lyh

gx

@@ -262,33 +262,47 @@ class Demo extends Command @@ -262,33 +262,47 @@ 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(['project_id'=>['<',187]]);  
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']) && is_array($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 + $projectModel->edit(['uptime'=>$domainInfo['created_at']],['id'=>$v['id']]);
  275 + echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
284 } 276 }
285 } 277 }
286 } 278 }
287 - $languageModel = new MinorLanguages();  
288 - $languageModel->insert($data);  
289 - }  
290 -  
291 } 279 }
  280 +// public function handle(){
  281 +// $projectModel = new DeployOptimize();
  282 +// $list = $projectModel->list(['project_id'=>['<',187]]);
  283 +// foreach ($list as $v){
  284 +// echo date('Y-m-d H:i:s') . 'end'.json_encode($v) . PHP_EOL;
  285 +// $data = [];
  286 +// if(!empty($v['minor_languages']) && is_array($v['minor_languages'])){
  287 +// foreach ($v['minor_languages'] as $k1=> $v1){
  288 +// if(!empty($v1['tl']) && !empty($v1['type'])){
  289 +// $data[] = [
  290 +// 'language'=>$v1['tl'],
  291 +// 'type'=>$v1['type'],
  292 +// 'keywords'=>$v1['keywords'],
  293 +// 'service_day'=>$v1['service_day'],
  294 +// 'project_id'=>$v['project_id'],
  295 +// 'created_at'=>date('Y-m-d H:i:s'),
  296 +// 'updated_at'=>date('Y-m-d H:i:s')
  297 +// ];
  298 +// }
  299 +// }
  300 +// }
  301 +// $languageModel = new MinorLanguages();
  302 +// $languageModel->insert($data);
  303 +// }
  304 +//
  305 +// }
292 306
293 public function printMessage() 307 public function printMessage()
294 { 308 {
@@ -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();