作者 刘锟

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

... ... @@ -34,4 +34,24 @@ class EnterpriseProductController extends BaseController
$result = $logic->saveEnterpriseProduct();
$this->response('success',Code::SUCCESS,$result);
}
/**
* @remark :保存外链数据
* @name :saveLinkData
* @author :lyh
* @method :post
* @time :2025/4/2 9:07
*/
public function saveLinkData(EnterpriseProductLogic $logic){
$this->request->validate([
'project_id'=>'required',
'data'=>'required',
],[
'project_id.required' => 'project_id不能为空',
'data.required' => '数据不能为空',
]);
$result = $logic->saveLinkData();
$this->response('success',Code::SUCCESS,$result);
}
}
... ...
... ... @@ -58,6 +58,9 @@ class ComController extends BaseController
public function seo_get_menu(){
$seoMenuModel = new ProjectMenuSeo();
$this->map['status'] = 0;
if($this->user['login_source'] == User::LOGIN_PASSWORD_SOURCE){
$this->map['id'] = ['not in',[19]];
}
$lists = $seoMenuModel->list($this->map,'sort');
$menu = array();
foreach ($lists as $v){
... ...
... ... @@ -21,10 +21,7 @@ class ChatController extends BaseController
* @time :2025/4/1 14:35
*/
public function sendMessage(){
$this->request->validate([
'id' => 'required'
],[
'id.required' => '消息id不能为空',
]);
if(isset($this->param['task_id'])){
}
}
}
... ...
... ... @@ -11,6 +11,9 @@ namespace App\Http\Logic\Aside\Project;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Project\EnterpriseProduct;
use App\Models\SeoSetting\LinkData;
use App\Services\ProjectServer;
use Illuminate\Support\Facades\DB;
/**
* @remark :企业产品库
... ... @@ -43,4 +46,29 @@ class EnterpriseProductLogic extends BaseLogic
}
return $this->success();
}
/**
* @remark :批量保存外链数据
* @name :saveLinkData
* @author :lyh
* @method :post
* @time :2025/4/2 9:08
*/
public function saveLinkData(){
ProjectServer::useProject($this->param['project_id']);
$linkModel = new LinkData();
$data = [];
foreach ($this->param['data'] as $v){
$data[] = [
'url'=>$v['url'],
'da_values'=>$v['da_values'],
];
}
if(!empty($data)){
$linkModel->insertAll($data);
}
DB::disconnect('custom_mysql');
return $this->success();
}
}
... ...
... ... @@ -10,12 +10,34 @@
namespace App\Http\Logic\Bside\Gpt;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\Gpt\Chat;
class ChatLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->model = new Count();
$this->model = new Chat();
}
public function sendMessage(){
if(isset($this->param['task_id'])){
$chatInfo = $this->model->read(['id'=>$this->param['task_id']]);
if($chatInfo === false){
$this->fail('会话不存在');
}
}else{
//创建一个会话
$saveData = [
'user_id'=>$this->user['id'],
'input_content'=>$this->param['input_content'],
];
$id = $this->model->addReturnId();
$saveData = [
'user_id'=>$this->user['id'],
'is_reply'=>1,
'input_content'=>$this->param['input_content'],
];
}
}
}
... ...
... ... @@ -25,7 +25,7 @@ class MonthCountLogic extends BaseLogic
*/
public function getCountLists($map,$order = 'created_at',$filed = ['*']){
$map['project_id'] = $this->user['project_id'];
$lists = $this->model->list($map,$order,$filed,'desc',10);
$lists = $this->model->list($map,$order,$filed,'desc',20);
if(isset($this->project['is_record_china_visit']) && ($this->project['is_record_china_visit'] == 0)){
foreach ($lists as $k => $v){
if(empty($v['source_country'])){
... ...
<?php
/**
* @remark :
* @name :GptService.php
* @author :lyh
* @method :post
* @time :2025/4/1 17:58
*/
namespace App\Services;
class GptService
{
protected $header = [
'apikey' => 'UkzZljFv83Z2qBi5YR1o3f2otAVWtug6',
'X-CmerApi-Host' => 'bizopenai.p.cmer.com',
];
protected $api = 'https://api.cmer.com';
protected $api_test = 'http://test.waimaoq.com';
}
... ...
... ... @@ -211,6 +211,8 @@ Route::middleware(['aloginauth'])->group(function () {
//企业资料库
Route::prefix('enterprise_product')->group(function () {
Route::any('/saveEnterpriseProduct', [Aside\Project\EnterpriseProductController::class, 'saveEnterpriseProduct'])->name('admin.enterprise_product_saveEnterpriseProduct');
Route::any('/saveLinkData', [Aside\Project\EnterpriseProductController::class, 'saveLinkData'])->name('admin.enterprise_product_saveLinkData');
});
//小语种
Route::prefix('language')->group(function () {
... ...