Browse Source

完善查询是否可聊天

15954078560 3 years ago
parent
commit
69304220d8
1 changed files with 5 additions and 0 deletions
  1. 5 0
      application/api/controller/User.php

+ 5 - 0
application/api/controller/User.php

@@ -1734,6 +1734,11 @@ class User extends Api
         if (!$other_user_id) {
             $this->error('参数缺失');
         }
+        //查询是否是客服
+        $count = Db::name('kefu')->where(['user_id' => $other_user_id])->count('id');
+        if ($count) {
+            $this->success('可以聊天', '1');
+        }
         if ($this->auth->id == $other_user_id) {
             $this->error('这是您自己');
         }