lip 3 månader sedan
förälder
incheckning
b1b3db9617
1 ändrade filer med 9 tillägg och 10 borttagningar
  1. 9 10
      app/enterprise/controller/Im.php

+ 9 - 10
app/enterprise/controller/Im.php

@@ -15,7 +15,6 @@ use app\admin\model\QuestionLanguages;
 use app\admin\model\Complaint;
 use app\admin\model\ComplaintItem;
 use app\admin\model\Score;
-use think\facade\Lang;
 
 class Im extends BaseController
 {
@@ -29,15 +28,15 @@ class Im extends BaseController
         $score = $this->request->param('score');
         $msg_id = $this->request->param('msg_id');
         if (empty($msg_id)) {
-            return $this->error('参数有误');
+            return $this->error('参数有误',[], 10009);
         }
         if (empty($score)) {
-            return $this->error('请打分');
+            return $this->error('请打分',[], 10009);
         }
         $user_id = $this->userInfo['user_id'];
         $user = User::where('user_id', $user_id)->find();
         if (!$user) {
-            return $this->error('用户不存在');
+            return $this->error('用户不存在',[], 10009);
         }
         $exist = Message::where('msg_id', $msg_id)->where('to_user', $user_id)->find();
         if ($exist) {
@@ -93,16 +92,16 @@ class Im extends BaseController
     {
         $params = $this->request->param();
         if (empty($params['complaint_item_id'])) {
-            return $this->error('请选择投诉项');
+            return $this->error('请选择投诉项',[], 10009);
         }
         $user_id = $this->userInfo['user_id'];
         $user = User::where('user_id', $user_id)->find();
         if (!$user) {
-            return $this->error('用户不存在');
+            return $this->error('用户不存在',[], 10009);
         }
         $exist = Complaint::where('user_id', $user_id)->where('cs_uid', $user->cs_uid)->find();
         if ($exist) {
-            return $this->error('您已投诉过该客服,无需重复投诉');
+            return $this->error('您已投诉过该客服,无需重复投诉',[], 10009);
         }
 
         Complaint::create([
@@ -200,7 +199,7 @@ class Im extends BaseController
             $is_like = $this->request->param('is_like');
             $msg_id = $this->request->param('msg_id');
             if (empty($msg_id) || !in_array($is_like, [1, 0])) {
-                return $this->error('参数有误');
+                return $this->error('参数有误',[], 10009);
             }
             $user_id = $this->userInfo['user_id'];
             $exist = Message::where('msg_id', $msg_id)->where('to_user', $user_id)->find();
@@ -233,10 +232,10 @@ class Im extends BaseController
             $user_id = $this->userInfo['user_id'];
             $user = User::where('user_id', $user_id)->find();
             if (!$user) {
-                return $this->error('用户不存在');
+                return $this->error('用户不存在',[], 10009);
             }
             if ($user->role > 0) {
-                return $this->error('系统管理员无法转人工');
+                return $this->error('系统管理员无法转人工',[], 10009);
             }
             if($user->service_status == -1) {