正在显示
3 个修改的文件
包含
26 行增加
和
7 行删除
| @@ -58,7 +58,7 @@ class ComController extends BaseController | @@ -58,7 +58,7 @@ 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_AUTO_SOURCE){ | 61 | + if($this->user['login_source'] == User::LOGIN_PASSWORD_SOURCE){ |
| 62 | $this->map['id'] = ['not in',[19]]; | 62 | $this->map['id'] = ['not in',[19]]; |
| 63 | } | 63 | } |
| 64 | $lists = $seoMenuModel->list($this->map,'sort'); | 64 | $lists = $seoMenuModel->list($this->map,'sort'); |
| @@ -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 | } |
| @@ -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 | } |
-
请 注册 或 登录 后发表评论