|
...
|
...
|
@@ -13,6 +13,7 @@ use App\Models\Blog\Blog; |
|
|
|
use App\Models\Blog\BlogCategory;
|
|
|
|
use App\Models\CustomModule\CustomModule;
|
|
|
|
use App\Models\CustomModule\CustomModuleCategory;
|
|
|
|
use App\Models\CustomModule\CustomModuleContent;
|
|
|
|
use App\Models\News\News;
|
|
|
|
use App\Models\News\NewsCategory;
|
|
|
|
use App\Models\Product\Category;
|
|
...
|
...
|
@@ -62,7 +63,7 @@ class UpdateMainHtml extends Command |
|
|
|
foreach ($list as $v){
|
|
|
|
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
|
|
|
|
ProjectServer::useProject($v['id']);
|
|
|
|
$this->setBlogCustom();
|
|
|
|
$this->setBlogCustomContent();
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
}
|
|
|
|
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
|
|
...
|
...
|
@@ -97,4 +98,38 @@ class UpdateMainHtml extends Command |
|
|
|
$cate = new CustomModuleCategory();
|
|
|
|
$cate->insert($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :所有博客数据添加到自定义模块
|
|
|
|
* @name :setBlogCustom
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/1/5 10:21
|
|
|
|
*/
|
|
|
|
public function setBlogCustomContent(){
|
|
|
|
$data = [];
|
|
|
|
$blogModel = new Blog();
|
|
|
|
$list = $blogModel->list(['status'=>1]);
|
|
|
|
foreach ($list as $v){
|
|
|
|
echo date('Y-m-d H:i:s') . '博客分类id:'.$v['id'] . PHP_EOL;
|
|
|
|
$data[] = [
|
|
|
|
'name'=>$v['name'],
|
|
|
|
'content'=>$v['text'],
|
|
|
|
'remark'=>$v['remark'],
|
|
|
|
'route'=>$v['url'],
|
|
|
|
'image'=>$v['image'],
|
|
|
|
'project_id'=>99,
|
|
|
|
'operator_id'=>366,
|
|
|
|
'seo_title'=>$v['seo_title'],
|
|
|
|
'seo_keywords'=>$v['seo_keywords'],
|
|
|
|
'seo_description'=>$v['seo_des'],
|
|
|
|
'created_at'=>$v['created_at'],
|
|
|
|
'updated_at'=>$v['updated_at'],
|
|
|
|
'module_id'=>7,
|
|
|
|
'category_id'=>$v['category_id']
|
|
|
|
];
|
|
|
|
}
|
|
|
|
$content = new CustomModuleContent();
|
|
|
|
$content->insert($data);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|