作者 lyh

gx

@@ -52,26 +52,137 @@ class Demo extends Command @@ -52,26 +52,137 @@ class Demo extends Command
52 protected $description = 'demo'; 52 protected $description = 'demo';
53 53
54 public function handle(){ 54 public function handle(){
55 - ProjectServer::useProject(1462);  
56 - $customContentModel = new CustomModuleContent();  
57 - $contentLists = $customContentModel->list(['module_id'=>8]);  
58 - foreach ($contentLists as $v){  
59 - if(!empty($v['category_id']) && is_array($v['category_id'])){  
60 - $v['category_id'] = ','.implode(',',$v['category_id']).',';  
61 - }  
62 - if(!empty($v['video'])){  
63 - $v['video'] = Arr::a2s($v['video']);  
64 - }  
65 - unset($v['id'],$v['created_at'],$v['updated_at']);  
66 - $v['url'] = $v['route'];  
67 - $blogModel = new Blog();  
68 - $id = $blogModel->addReturnId($v);  
69 - if($id){  
70 - $route = RouteMap::setRoute($v['route'],RouteMap::SOURCE_BLOG,$id,1462);  
71 - $blogModel->edit(['url'=>$route],['id'=>$id]);  
72 - } 55 + $str = '[
  56 + {
  57 + "name": "产品列表",
  58 + "source": 2,
  59 + "is_list": 1,
  60 + "is_custom": 0,
  61 + "header_status": 0,
  62 + "footer_status": 0
  63 + },
  64 + {
  65 + "name": "产品详情",
  66 + "source": 2,
  67 + "is_list": 0,
  68 + "is_custom": 0,
  69 + "header_status": 0,
  70 + "footer_status": 0
  71 + },
  72 + {
  73 + "name": "博客列表",
  74 + "source": 3,
  75 + "is_list": 1,
  76 + "is_custom": 0,
  77 + "header_status": 0,
  78 + "footer_status": 0
  79 + },
  80 + {
  81 + "name": "博客详情",
  82 + "source": 3,
  83 + "is_list": 0,
  84 + "is_custom": 0,
  85 + "header_status": 0,
  86 + "footer_status": 0
  87 + },
  88 + {
  89 + "name": "新闻列表",
  90 + "source": 4,
  91 + "is_list": 1,
  92 + "is_custom": 0,
  93 + "header_status": 0,
  94 + "footer_status": 0
  95 + },
  96 + {
  97 + "name": "新闻详情",
  98 + "source": 4,
  99 + "is_list": 0,
  100 + "is_custom": 0,
  101 + "header_status": 0,
  102 + "footer_status": 0
  103 + },
  104 + {
  105 + "name": "首页",
  106 + "source": 1,
  107 + "is_list": 0,
  108 + "is_custom": 0,
  109 + "header_status": 0,
  110 + "footer_status": 0
  111 + },
  112 + {
  113 + "name": "单页面",
  114 + "source": 6,
  115 + "is_list": 0,
  116 + "is_custom": 0,
  117 + "header_status": 0,
  118 + "footer_status": 0
  119 + },
  120 + {
  121 + "name": "测试定制2列表",
  122 + "source": 12,
  123 + "is_list": 1,
  124 + "is_custom": 1,
  125 + "header_status": 0,
  126 + "footer_status": 0
  127 + },
  128 + {
  129 + "name": "测试定制2详情",
  130 + "source": 12,
  131 + "is_list": 0,
  132 + "is_custom": 1,
  133 + "header_status": 0,
  134 + "footer_status": 0
  135 + },
  136 + {
  137 + "name": "测试定制1列表",
  138 + "source": 11,
  139 + "is_list": 1,
  140 + "is_custom": 1,
  141 + "header_status": 0,
  142 + "footer_status": 0
  143 + },
  144 + {
  145 + "name": "测试定制1详情",
  146 + "source": 11,
  147 + "is_list": 0,
  148 + "is_custom": 1,
  149 + "header_status": 0,
  150 + "footer_status": 0
  151 + },
  152 + {
  153 + "name": "test列表",
  154 + "source": 10,
  155 + "is_list": 1,
  156 + "is_custom": 1,
  157 + "header_status": 0,
  158 + "footer_status": 0
  159 + },
  160 + {
  161 + "name": "test详情",
  162 + "source": 10,
  163 + "is_list": 0,
  164 + "is_custom": 1,
  165 + "header_status": 0,
  166 + "footer_status": 0
  167 + },
  168 + {
  169 + "name": "测试模块列表",
  170 + "source": 9,
  171 + "is_list": 1,
  172 + "is_custom": 1,
  173 + "header_status": 0,
  174 + "footer_status": 0
  175 + },
  176 + {
  177 + "name": "测试模块详情",
  178 + "source": 9,
  179 + "is_list": 0,
  180 + "is_custom": 1,
  181 + "header_status": 0,
  182 + "footer_status": 0
73 } 183 }
74 - DB::disconnect('custom_mysql'); 184 + ]';
  185 + return json_encode($str);
75 } 186 }
76 187
77 public function synchronizationFile($path_name){ 188 public function synchronizationFile($path_name){