正在显示
1 个修改的文件
包含
15 行增加
和
10 行删除
| @@ -356,17 +356,22 @@ class KeywordLogic extends BaseLogic | @@ -356,17 +356,22 @@ class KeywordLogic extends BaseLogic | ||
| 356 | * @time :2025/6/9 14:29 | 356 | * @time :2025/6/9 14:29 |
| 357 | */ | 357 | */ |
| 358 | public function saveComment(){ | 358 | public function saveComment(){ |
| 359 | - $param = [ | ||
| 360 | - 'nickname' => $this->param['nickname'], | ||
| 361 | - 'text' => $this->param['text'], | ||
| 362 | - 'project_id' => $this->user['project_id'], | ||
| 363 | - 'type' => 1, | ||
| 364 | - 'uid' => 0, | ||
| 365 | - 'created_at' => date('Y-m-d H:i:s'), | ||
| 366 | - 'updated_at' => date('Y-m-d H:i:s') | ||
| 367 | - ]; | ||
| 368 | $keywordCommonModel = new AggregateKeywordComment(); | 359 | $keywordCommonModel = new AggregateKeywordComment(); |
| 369 | - $id = $keywordCommonModel->addReturnId($param); | 360 | + if(isset($this->param['id']) && !empty($this->param['id'])){ |
| 361 | + $id = $this->param['id']; | ||
| 362 | + $keywordCommonModel->edit($this->param,['id'=>$this->param['id']]); | ||
| 363 | + }else{ | ||
| 364 | + $param = [ | ||
| 365 | + 'nickname' => $this->param['nickname'], | ||
| 366 | + 'text' => $this->param['text'], | ||
| 367 | + 'project_id' => $this->user['project_id'], | ||
| 368 | + 'type' => 1, | ||
| 369 | + 'uid' => 0, | ||
| 370 | + 'created_at' => date('Y-m-d H:i:s'), | ||
| 371 | + 'updated_at' => date('Y-m-d H:i:s') | ||
| 372 | + ]; | ||
| 373 | + $id = $keywordCommonModel->addReturnId($param); | ||
| 374 | + } | ||
| 370 | return $this->success(['id'=>$id]); | 375 | return $this->success(['id'=>$id]); |
| 371 | } | 376 | } |
| 372 | 377 |
-
请 注册 或 登录 后发表评论