|
|
@@ -27,6 +27,10 @@ class Im extends BaseController
|
|
|
public function Score()
|
|
|
{
|
|
|
$score = $this->request->param('score');
|
|
|
+ $msg_id = $this->request->param('msg_id');
|
|
|
+ if (empty($msg_id)) {
|
|
|
+ return $this->error('参数有误');
|
|
|
+ }
|
|
|
if (empty($score)) {
|
|
|
return $this->error('请打分');
|
|
|
}
|
|
|
@@ -35,15 +39,14 @@ class Im extends BaseController
|
|
|
if (!$user) {
|
|
|
return $this->error('用户不存在');
|
|
|
}
|
|
|
- $exist = Score::where('user_id', $user_id)->where('cs_uid', $user->cs_uid)->find();
|
|
|
- if (!$exist) {
|
|
|
+ $exist = Message::where('msg_id', $msg_id)->where('to_user', $user_id)->find();
|
|
|
+ if ($exist && $exist['is_click'] == 0) {
|
|
|
Score::create([
|
|
|
'user_id' => $user_id,
|
|
|
'cs_uid' => $user->cs_uid,
|
|
|
'score' => (int)$score,
|
|
|
]);
|
|
|
}
|
|
|
-
|
|
|
return $this->success('提交成功');
|
|
|
}
|
|
|
|
|
|
@@ -704,6 +707,7 @@ class Im extends BaseController
|
|
|
'file_cate' => $v['file_cate'],
|
|
|
'fileName' => $v['file_name'],
|
|
|
'fileSize' => $v['file_size'],
|
|
|
+ 'is_click' => $v['is_click'],
|
|
|
'fromUser' => $fromUser,
|
|
|
'extUrl'=>$ext,
|
|
|
'role'=>$role,
|