lip 3 tháng trước cách đây
mục cha
commit
939d6a54de
3 tập tin đã thay đổi với 21 bổ sung4 xóa
  1. 14 0
      app/admin/controller/User.php
  2. 4 1
      app/common.php
  3. 3 3
      app/enterprise/controller/Im.php

+ 14 - 0
app/admin/controller/User.php

@@ -68,4 +68,18 @@ class User extends BaseController
         return $this->success($user);
     }
 
+    //设置用户备注
+    public function setRemark()
+    {
+        $user_id = (int)$this->request->param('user_id');
+        $user = UserModel::where('user_id', $user_id)->find();
+        if (!$user) {
+            return $this->error('用户不存在');
+        }
+        $remark = $this->request->param('remark');
+        $user->remark = $remark;
+        $user->save();
+        return $this->success($user, '保存成功');
+    }
+
 }

+ 4 - 1
app/common.php

@@ -878,7 +878,10 @@ function sortArray($arrays, $sort_key, $sort_order = SORT_ASC, $sort_type = SORT
 //gateway向web页面推送消息
 function wsSendMsg($user, $type,  $data, $isGroup=0)
 {
-    $data['date'] = date('H:i');
+    if (in_array($type, ['sign', 'timeout', 'handleChat','closeChat','offline', 'is_online'])) {
+        $data['date'] = date('H:i');
+    }
+    
     $message = json_encode([
         'type' => $type,
         'time' => time(),

+ 3 - 3
app/enterprise/controller/Im.php

@@ -340,9 +340,9 @@ class Im extends BaseController
         $message=new Message();
         $data = $message->sendMessage($param,$this->globalConfig);
         //已发送的消息,设置成已读
-        if (isset($data['is_read'])) {
-            $data['is_read'] = 1;
-        }
+        // if (isset($data['is_read'])) {
+        //     $data['is_read'] = 1;
+        // }
         if ($data) {
             return success('', $data);
         } else {