作者 lyh

gx脚本导出产品

@@ -64,8 +64,6 @@ class UpdateRoute extends Command @@ -64,8 +64,6 @@ class UpdateRoute extends Command
64 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL; 64 echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
65 ProjectServer::useProject($v['id']); 65 ProjectServer::useProject($v['id']);
66 $this->ceshi(); 66 $this->ceshi();
67 - sleep(5);  
68 - $this->getBlog();  
69 DB::disconnect('custom_mysql'); 67 DB::disconnect('custom_mysql');
70 } 68 }
71 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; 69 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
@@ -74,10 +72,15 @@ class UpdateRoute extends Command @@ -74,10 +72,15 @@ class UpdateRoute extends Command
74 public function ceshi() 72 public function ceshi()
75 { 73 {
76 $customModel = new CustomModuleContent(); 74 $customModel = new CustomModuleContent();
77 - $lists = $customModel->list(['module_id' => 8], 'id', ['id']); 75 + $lists = $customModel->list(['module_id' => 8], 'id', ['id','name']);
78 foreach ($lists as $v) { 76 foreach ($lists as $v) {
79 - $routeMapModel = new RouteMap();  
80 - $routeMapModel->del(['source' => 'module', 'source_id' => $v['id']]); 77 + $blogModel = new Blog();
  78 + $info = $blogModel->read(['name'=>$v['name']],['id']);
  79 + if($info !== false){
  80 + $templateModel = new BTemplate();
  81 + $condition = ['source'=>8,'source_id'=>$v['id'],'is_custom'=>1,'is_list'=>0];
  82 + $templateModel->edit(['source'=>$templateModel::SOURCE_BLOG,'source_id'=>$info['id'],'is_custom'=>0],$condition);
  83 + }
81 } 84 }
82 return true; 85 return true;
83 } 86 }