作者 lyh

gx

@@ -34,4 +34,24 @@ class EnterpriseProductController extends BaseController @@ -34,4 +34,24 @@ class EnterpriseProductController extends BaseController
34 $result = $logic->saveEnterpriseProduct(); 34 $result = $logic->saveEnterpriseProduct();
35 $this->response('success',Code::SUCCESS,$result); 35 $this->response('success',Code::SUCCESS,$result);
36 } 36 }
  37 +
  38 + /**
  39 + * @remark :保存外链数据
  40 + * @name :saveLinkData
  41 + * @author :lyh
  42 + * @method :post
  43 + * @time :2025/4/2 9:07
  44 + */
  45 + public function saveLinkData(EnterpriseProductLogic $logic){
  46 + $this->request->validate([
  47 + 'project_id'=>'required',
  48 + 'data'=>'required',
  49 +
  50 + ],[
  51 + 'project_id.required' => 'project_id不能为空',
  52 + 'data.required' => '数据不能为空',
  53 + ]);
  54 + $result = $logic->saveLinkData();
  55 + $this->response('success',Code::SUCCESS,$result);
  56 + }
37 } 57 }
@@ -11,6 +11,9 @@ namespace App\Http\Logic\Aside\Project; @@ -11,6 +11,9 @@ namespace App\Http\Logic\Aside\Project;
11 11
12 use App\Http\Logic\Aside\BaseLogic; 12 use App\Http\Logic\Aside\BaseLogic;
13 use App\Models\Project\EnterpriseProduct; 13 use App\Models\Project\EnterpriseProduct;
  14 +use App\Models\SeoSetting\LinkData;
  15 +use App\Services\ProjectServer;
  16 +use Illuminate\Support\Facades\DB;
14 17
15 /** 18 /**
16 * @remark :企业产品库 19 * @remark :企业产品库
@@ -43,4 +46,29 @@ class EnterpriseProductLogic extends BaseLogic @@ -43,4 +46,29 @@ class EnterpriseProductLogic extends BaseLogic
43 } 46 }
44 return $this->success(); 47 return $this->success();
45 } 48 }
  49 +
  50 +
  51 + /**
  52 + * @remark :批量保存外链数据
  53 + * @name :saveLinkData
  54 + * @author :lyh
  55 + * @method :post
  56 + * @time :2025/4/2 9:08
  57 + */
  58 + public function saveLinkData(){
  59 + ProjectServer::useProject($this->param['project_id']);
  60 + $linkModel = new LinkData();
  61 + $data = [];
  62 + foreach ($this->param['data'] as $v){
  63 + $data[] = [
  64 + 'url'=>$v['url'],
  65 + 'da_values'=>$v['da_values'],
  66 + ];
  67 + }
  68 + if(!empty($data)){
  69 + $linkModel->insertAll($data);
  70 + }
  71 + DB::disconnect('custom_mysql');
  72 + return $this->success();
  73 + }
46 } 74 }
  1 +<?php
  2 +/**
  3 + * @remark :
  4 + * @name :GptService.php
  5 + * @author :lyh
  6 + * @method :post
  7 + * @time :2025/4/1 17:58
  8 + */
  9 +
  10 +namespace App\Services;
  11 +
  12 +class GptService
  13 +{
  14 +
  15 + protected $header = [
  16 + 'apikey' => 'UkzZljFv83Z2qBi5YR1o3f2otAVWtug6',
  17 + 'X-CmerApi-Host' => 'bizopenai.p.cmer.com',
  18 + ];
  19 +
  20 +
  21 + protected $api = 'https://api.cmer.com';
  22 +
  23 +
  24 + protected $api_test = 'http://test.waimaoq.com';
  25 +}
@@ -211,6 +211,8 @@ Route::middleware(['aloginauth'])->group(function () { @@ -211,6 +211,8 @@ Route::middleware(['aloginauth'])->group(function () {
211 //企业资料库 211 //企业资料库
212 Route::prefix('enterprise_product')->group(function () { 212 Route::prefix('enterprise_product')->group(function () {
213 Route::any('/saveEnterpriseProduct', [Aside\Project\EnterpriseProductController::class, 'saveEnterpriseProduct'])->name('admin.enterprise_product_saveEnterpriseProduct'); 213 Route::any('/saveEnterpriseProduct', [Aside\Project\EnterpriseProductController::class, 'saveEnterpriseProduct'])->name('admin.enterprise_product_saveEnterpriseProduct');
  214 + Route::any('/saveLinkData', [Aside\Project\EnterpriseProductController::class, 'saveLinkData'])->name('admin.enterprise_product_saveLinkData');
  215 +
214 }); 216 });
215 //小语种 217 //小语种
216 Route::prefix('language')->group(function () { 218 Route::prefix('language')->group(function () {