作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

@@ -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 }
@@ -58,6 +58,9 @@ class ComController extends BaseController @@ -58,6 +58,9 @@ class ComController extends BaseController
58 public function seo_get_menu(){ 58 public function seo_get_menu(){
59 $seoMenuModel = new ProjectMenuSeo(); 59 $seoMenuModel = new ProjectMenuSeo();
60 $this->map['status'] = 0; 60 $this->map['status'] = 0;
  61 + if($this->user['login_source'] == User::LOGIN_PASSWORD_SOURCE){
  62 + $this->map['id'] = ['not in',[19]];
  63 + }
61 $lists = $seoMenuModel->list($this->map,'sort'); 64 $lists = $seoMenuModel->list($this->map,'sort');
62 $menu = array(); 65 $menu = array();
63 foreach ($lists as $v){ 66 foreach ($lists as $v){
@@ -21,10 +21,7 @@ class ChatController extends BaseController @@ -21,10 +21,7 @@ class ChatController extends BaseController
21 * @time :2025/4/1 14:35 21 * @time :2025/4/1 14:35
22 */ 22 */
23 public function sendMessage(){ 23 public function sendMessage(){
24 - $this->request->validate([  
25 - 'id' => 'required'  
26 - ],[  
27 - 'id.required' => '消息id不能为空',  
28 - ]); 24 + if(isset($this->param['task_id'])){
  25 + }
29 } 26 }
30 } 27 }
@@ -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 }
@@ -10,12 +10,34 @@ @@ -10,12 +10,34 @@
10 namespace App\Http\Logic\Bside\Gpt; 10 namespace App\Http\Logic\Bside\Gpt;
11 11
12 use App\Http\Logic\Bside\BaseLogic; 12 use App\Http\Logic\Bside\BaseLogic;
  13 +use App\Models\Gpt\Chat;
13 14
14 class ChatLogic extends BaseLogic 15 class ChatLogic extends BaseLogic
15 { 16 {
16 public function __construct() 17 public function __construct()
17 { 18 {
18 parent::__construct(); 19 parent::__construct();
19 - $this->model = new Count(); 20 + $this->model = new Chat();
  21 + }
  22 +
  23 + public function sendMessage(){
  24 + if(isset($this->param['task_id'])){
  25 + $chatInfo = $this->model->read(['id'=>$this->param['task_id']]);
  26 + if($chatInfo === false){
  27 + $this->fail('会话不存在');
  28 + }
  29 + }else{
  30 + //创建一个会话
  31 + $saveData = [
  32 + 'user_id'=>$this->user['id'],
  33 + 'input_content'=>$this->param['input_content'],
  34 + ];
  35 + $id = $this->model->addReturnId();
  36 + $saveData = [
  37 + 'user_id'=>$this->user['id'],
  38 + 'is_reply'=>1,
  39 + 'input_content'=>$this->param['input_content'],
  40 + ];
  41 + }
20 } 42 }
21 } 43 }
@@ -25,7 +25,7 @@ class MonthCountLogic extends BaseLogic @@ -25,7 +25,7 @@ class MonthCountLogic extends BaseLogic
25 */ 25 */
26 public function getCountLists($map,$order = 'created_at',$filed = ['*']){ 26 public function getCountLists($map,$order = 'created_at',$filed = ['*']){
27 $map['project_id'] = $this->user['project_id']; 27 $map['project_id'] = $this->user['project_id'];
28 - $lists = $this->model->list($map,$order,$filed,'desc',10); 28 + $lists = $this->model->list($map,$order,$filed,'desc',20);
29 if(isset($this->project['is_record_china_visit']) && ($this->project['is_record_china_visit'] == 0)){ 29 if(isset($this->project['is_record_china_visit']) && ($this->project['is_record_china_visit'] == 0)){
30 foreach ($lists as $k => $v){ 30 foreach ($lists as $k => $v){
31 if(empty($v['source_country'])){ 31 if(empty($v['source_country'])){
  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 () {