|
...
|
...
|
@@ -24,6 +24,7 @@ use App\Models\Product\Keyword; |
|
|
|
use App\Models\Product\Product;
|
|
|
|
use App\Models\Project\DeployOptimize;
|
|
|
|
use App\Models\Project\MinorLanguages;
|
|
|
|
use App\Models\Project\PageSetting;
|
|
|
|
use App\Models\Project\Project;
|
|
|
|
use App\Models\Purchaser\PurchaserInfo;
|
|
|
|
use App\Models\RouteMap\RouteMap;
|
|
...
|
...
|
@@ -52,26 +53,106 @@ class Demo extends Command |
|
|
|
protected $description = 'demo';
|
|
|
|
|
|
|
|
public function handle(){
|
|
|
|
ProjectServer::useProject(1462);
|
|
|
|
$customContentModel = new CustomModuleContent();
|
|
|
|
$contentLists = $customContentModel->list(['module_id'=>8]);
|
|
|
|
foreach ($contentLists as $v){
|
|
|
|
if(!empty($v['category_id']) && is_array($v['category_id'])){
|
|
|
|
$v['category_id'] = ','.implode(',',$v['category_id']).',';
|
|
|
|
$pageSettingModel = new PageSetting();
|
|
|
|
$pageList = $pageSettingModel->list();
|
|
|
|
foreach ($pageList as $v){
|
|
|
|
ProjectServer::useProject($v['project_id']);
|
|
|
|
if($v['product_list'] == 1){
|
|
|
|
$param = [
|
|
|
|
'name'=>'产品列表',
|
|
|
|
'source'=>2,
|
|
|
|
'is_list'=>1,
|
|
|
|
'is_custom'=>0,
|
|
|
|
'header_status'=>1,
|
|
|
|
'footer_status'=>1,
|
|
|
|
'created_at'=>date('Y-m-d H:i:s'),
|
|
|
|
'updated_at'=>date('Y-m-d H:i:s'),
|
|
|
|
];
|
|
|
|
DB::connection('custom_mysql')->table('gl_project_com_config')->insert($param);
|
|
|
|
}
|
|
|
|
if(!empty($v['video'])){
|
|
|
|
$v['video'] = Arr::a2s($v['video']);
|
|
|
|
if($v['product_details'] == 1){
|
|
|
|
$param = [
|
|
|
|
'name'=>'产品详情',
|
|
|
|
'source'=>2,
|
|
|
|
'is_list'=>0,
|
|
|
|
'is_custom'=>0,
|
|
|
|
'header_status'=>1,
|
|
|
|
'footer_status'=>1,
|
|
|
|
'created_at'=>date('Y-m-d H:i:s'),
|
|
|
|
'updated_at'=>date('Y-m-d H:i:s'),
|
|
|
|
];
|
|
|
|
DB::connection('custom_mysql')->table('gl_project_com_config')->insert($param);
|
|
|
|
}
|
|
|
|
unset($v['id'],$v['created_at'],$v['updated_at']);
|
|
|
|
$v['url'] = $v['route'];
|
|
|
|
$blogModel = new Blog();
|
|
|
|
$id = $blogModel->addReturnId($v);
|
|
|
|
if($id){
|
|
|
|
$route = RouteMap::setRoute($v['route'],RouteMap::SOURCE_BLOG,$id,1462);
|
|
|
|
$blogModel->edit(['url'=>$route],['id'=>$id]);
|
|
|
|
if($v['page_list'] == 1){
|
|
|
|
$param = [
|
|
|
|
'name'=>'单页面',
|
|
|
|
'source'=>9,
|
|
|
|
'is_list'=>0,
|
|
|
|
'is_custom'=>0,
|
|
|
|
'header_status'=>1,
|
|
|
|
'footer_status'=>1,
|
|
|
|
'created_at'=>date('Y-m-d H:i:s'),
|
|
|
|
'updated_at'=>date('Y-m-d H:i:s'),
|
|
|
|
];
|
|
|
|
DB::connection('custom_mysql')->table('gl_project_com_config')->insert($param);
|
|
|
|
}
|
|
|
|
if($v['blog_list'] == 1){
|
|
|
|
$param = [
|
|
|
|
'name'=>'博客列表',
|
|
|
|
'source'=>3,
|
|
|
|
'is_list'=>1,
|
|
|
|
'is_custom'=>0,
|
|
|
|
'header_status'=>1,
|
|
|
|
'footer_status'=>1,
|
|
|
|
'created_at'=>date('Y-m-d H:i:s'),
|
|
|
|
'updated_at'=>date('Y-m-d H:i:s'),
|
|
|
|
];
|
|
|
|
DB::connection('custom_mysql')->table('gl_project_com_config')->insert($param);
|
|
|
|
}
|
|
|
|
if($v['blog_details'] == 1){
|
|
|
|
$param = [
|
|
|
|
'name'=>'博客详情',
|
|
|
|
'source'=>3,
|
|
|
|
'is_list'=>0,
|
|
|
|
'is_custom'=>0,
|
|
|
|
'header_status'=>1,
|
|
|
|
'footer_status'=>1,
|
|
|
|
'created_at'=>date('Y-m-d H:i:s'),
|
|
|
|
'updated_at'=>date('Y-m-d H:i:s'),
|
|
|
|
];
|
|
|
|
DB::connection('custom_mysql')->table('gl_project_com_config')->insert($param);
|
|
|
|
}
|
|
|
|
if($v['news_list'] == 1){
|
|
|
|
$param = [
|
|
|
|
'name'=>'新闻列表',
|
|
|
|
'source'=>4,
|
|
|
|
'is_list'=>1,
|
|
|
|
'is_custom'=>0,
|
|
|
|
'header_status'=>1,
|
|
|
|
'footer_status'=>1,
|
|
|
|
'created_at'=>date('Y-m-d H:i:s'),
|
|
|
|
'updated_at'=>date('Y-m-d H:i:s'),
|
|
|
|
];
|
|
|
|
DB::connection('custom_mysql')->table('gl_project_com_config')->insert($param);
|
|
|
|
}
|
|
|
|
if($v['news_details'] == 1){
|
|
|
|
$param = [
|
|
|
|
'name'=>'新闻详情',
|
|
|
|
'source'=>4,
|
|
|
|
'is_list'=>0,
|
|
|
|
'is_custom'=>0,
|
|
|
|
'header_status'=>1,
|
|
|
|
'footer_status'=>1,
|
|
|
|
'created_at'=>date('Y-m-d H:i:s'),
|
|
|
|
'updated_at'=>date('Y-m-d H:i:s'),
|
|
|
|
];
|
|
|
|
DB::connection('custom_mysql')->table('gl_project_com_config')->insert($param);
|
|
|
|
}
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
}
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public function synchronizationFile($path_name){
|
...
|
...
|
|