作者 赵彬吉
@@ -10,12 +10,15 @@ @@ -10,12 +10,15 @@
10 namespace App\Console\Commands\LyhTest; 10 namespace App\Console\Commands\LyhTest;
11 11
12 use App\Helper\Common; 12 use App\Helper\Common;
  13 +use App\Models\Blog\Blog;
13 use App\Models\Com\V6WeeklyReport; 14 use App\Models\Com\V6WeeklyReport;
  15 +use App\Models\News\News;
14 use App\Models\Product\Category; 16 use App\Models\Product\Category;
15 use App\Models\Product\CategoryRelated; 17 use App\Models\Product\CategoryRelated;
16 use App\Models\Product\Product; 18 use App\Models\Product\Product;
17 use App\Models\ProjectAssociation\ProjectAssociation; 19 use App\Models\ProjectAssociation\ProjectAssociation;
18 use App\Models\RouteMap\RouteMap; 20 use App\Models\RouteMap\RouteMap;
  21 +use App\Models\Template\BTemplate;
19 use App\Models\Visit\Visit; 22 use App\Models\Visit\Visit;
20 use App\Models\Visit\VisitItem; 23 use App\Models\Visit\VisitItem;
21 use App\Models\Workchat\MessagePush; 24 use App\Models\Workchat\MessagePush;
@@ -43,16 +46,51 @@ class DownloadProject extends Command @@ -43,16 +46,51 @@ class DownloadProject extends Command
43 46
44 public function handle(){ 47 public function handle(){
45 echo date('Y-m-d H:i:s') . 'start' . PHP_EOL; 48 echo date('Y-m-d H:i:s') . 'start' . PHP_EOL;
46 - ProjectServer::useProject(535);  
47 - $this->model = new Visit();  
48 - $data = $this->importVisit();  
49 - dd($data); 49 + ProjectServer::useProject(671);
  50 + $this->newsImportBlog();
50 DB::disconnect('custom_mysql'); 51 DB::disconnect('custom_mysql');
51 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; 52 echo date('Y-m-d H:i:s') . 'end' . PHP_EOL;
52 return true; 53 return true;
53 } 54 }
54 55
55 /** 56 /**
  57 + * @remark :新闻导入到博客
  58 + * @name :newsImportBlog
  59 + * @author :lyh
  60 + * @method :post
  61 + * @time :2025/6/7 11:12
  62 + */
  63 + public function newsImportBlog(){
  64 + $newsModel = new News();
  65 + $newsLists = $newsModel->list(['status'=>1]);
  66 + $blogModel = new Blog();
  67 + foreach ($newsLists as $item){
  68 + $data = [
  69 + 'name'=>$item['name'],
  70 + 'status'=>1,
  71 + 'remark'=>$item['remark'],
  72 + 'text'=>$item['text'],
  73 + 'image'=>$item['image'],
  74 + 'url'=>$item['url'],
  75 + 'seo_title'=>$item['seo_title'],
  76 + 'seo_description'=>$item['seo_title'],
  77 + 'seo_keywords'=>$item['seo_title'],
  78 + 'project_id'=>671,
  79 + 'release_at'=>$item['release_at'],
  80 + 'og_image'=>$item['og_image']
  81 + ];
  82 + $id = $blogModel->addReturnId($data);
  83 + RouteMap::delRoute(RouteMap::SOURCE_NEWS,$item['id'],671);
  84 + $route = RouteMap::setRoute($item['url'],RouteMap::SOURCE_BLOG,$id,671);
  85 + $blogModel->edit(['url'=>$route],['id'=>$id]);
  86 + //更新当前的可视化归宿
  87 + $templateModel = new BTemplate();
  88 + $templateModel->edit(['source'=>3,'source_id'=>$id],['source'=>4,'source_id'=>$item['id'],'is_custom'=>0,'is_list'=>0]);
  89 + }
  90 + return true;
  91 + }
  92 +
  93 + /**
56 * @remark :导出明细 94 * @remark :导出明细
57 * @name :importVisit 95 * @name :importVisit
58 * @author :lyh 96 * @author :lyh
@@ -31,6 +31,19 @@ class HrController extends BaseController @@ -31,6 +31,19 @@ class HrController extends BaseController
31 } 31 }
32 32
33 /** 33 /**
  34 + * @remark :获取列表数据
  35 + * @name :getManagerList
  36 + * @author :lyh
  37 + * @method :post
  38 + * @time :2025/6/7 9:22
  39 + */
  40 + public function getManagerList(){
  41 + $manageHrModel = new ManageHr();
  42 + $lists = $manageHrModel->lists($this->map,$this->page,$this->row);
  43 + $this->response('success', Code::SUCCESS, $lists);
  44 + }
  45 +
  46 + /**
34 * @remark :获取详情 47 * @remark :获取详情
35 * @name :info 48 * @name :info
36 * @author :lyh 49 * @author :lyh
@@ -149,6 +149,7 @@ Route::middleware(['aloginauth'])->group(function () { @@ -149,6 +149,7 @@ Route::middleware(['aloginauth'])->group(function () {
149 //人事管理 149 //人事管理
150 Route::prefix('hr')->group(function () { 150 Route::prefix('hr')->group(function () {
151 Route::any('/', [Aside\Manage\HrController::class, 'list'])->name('admin.hr'); 151 Route::any('/', [Aside\Manage\HrController::class, 'list'])->name('admin.hr');
  152 + Route::any('/getManagerList', [Aside\Manage\HrController::class, 'getManagerList'])->name('admin.hr_getManagerList');
152 Route::any('/info', [Aside\Manage\HrController::class, 'info'])->name('admin.hr_info'); 153 Route::any('/info', [Aside\Manage\HrController::class, 'info'])->name('admin.hr_info');
153 Route::post('/save', [Aside\Manage\HrController::class, 'save'])->name('admin.hr_save'); 154 Route::post('/save', [Aside\Manage\HrController::class, 'save'])->name('admin.hr_save');
154 Route::post('/sort', [Aside\Manage\HrController::class, 'sort'])->name('admin.hr_sort'); 155 Route::post('/sort', [Aside\Manage\HrController::class, 'sort'])->name('admin.hr_sort');