|
...
|
...
|
@@ -10,12 +10,15 @@ |
|
|
|
namespace App\Console\Commands\LyhTest;
|
|
|
|
|
|
|
|
use App\Helper\Common;
|
|
|
|
use App\Models\Blog\Blog;
|
|
|
|
use App\Models\Com\V6WeeklyReport;
|
|
|
|
use App\Models\News\News;
|
|
|
|
use App\Models\Product\Category;
|
|
|
|
use App\Models\Product\CategoryRelated;
|
|
|
|
use App\Models\Product\Product;
|
|
|
|
use App\Models\ProjectAssociation\ProjectAssociation;
|
|
|
|
use App\Models\RouteMap\RouteMap;
|
|
|
|
use App\Models\Template\BTemplate;
|
|
|
|
use App\Models\Visit\Visit;
|
|
|
|
use App\Models\Visit\VisitItem;
|
|
|
|
use App\Models\Workchat\MessagePush;
|
|
...
|
...
|
@@ -43,16 +46,51 @@ class DownloadProject extends Command |
|
|
|
|
|
|
|
public function handle(){
|
|
|
|
echo date('Y-m-d H:i:s') . 'start' . PHP_EOL;
|
|
|
|
ProjectServer::useProject(535);
|
|
|
|
$this->model = new Visit();
|
|
|
|
$data = $this->importVisit();
|
|
|
|
dd($data);
|
|
|
|
ProjectServer::useProject(671);
|
|
|
|
$this->newsImportBlog();
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :新闻导入到博客
|
|
|
|
* @name :newsImportBlog
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/6/7 11:12
|
|
|
|
*/
|
|
|
|
public function newsImportBlog(){
|
|
|
|
$newsModel = new News();
|
|
|
|
$newsLists = $newsModel->list(['status'=>1]);
|
|
|
|
$blogModel = new Blog();
|
|
|
|
foreach ($newsLists as $item){
|
|
|
|
$data = [
|
|
|
|
'name'=>$item['name'],
|
|
|
|
'status'=>1,
|
|
|
|
'remark'=>$item['remark'],
|
|
|
|
'text'=>$item['text'],
|
|
|
|
'image'=>$item['image'],
|
|
|
|
'url'=>$item['url'],
|
|
|
|
'seo_title'=>$item['seo_title'],
|
|
|
|
'seo_description'=>$item['seo_title'],
|
|
|
|
'seo_keywords'=>$item['seo_title'],
|
|
|
|
'project_id'=>671,
|
|
|
|
'release_at'=>$item['release_at'],
|
|
|
|
'og_image'=>$item['og_image']
|
|
|
|
];
|
|
|
|
$id = $blogModel->addReturnId($data);
|
|
|
|
RouteMap::delRoute(RouteMap::SOURCE_NEWS,$item['id'],671);
|
|
|
|
$route = RouteMap::setRoute($item['url'],RouteMap::SOURCE_BLOG,$id,671);
|
|
|
|
$blogModel->edit(['url'=>$route],['id'=>$id]);
|
|
|
|
//更新当前的可视化归宿
|
|
|
|
$templateModel = new BTemplate();
|
|
|
|
$templateModel->edit(['source'=>3,'source_id'=>$id],['source'=>4,'source_id'=>$item['id'],'is_custom'=>0,'is_list'=>0]);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :导出明细
|
|
|
|
* @name :importVisit
|
|
|
|
* @author :lyh
|
...
|
...
|
|