Jelajahi Sumber

0727-0159-h01

Zory 1 Minggu lalu
induk
melakukan
70365d9faf
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      app/controller/api/Service.php

+ 2 - 2
app/controller/api/Service.php

@@ -76,7 +76,7 @@ class Service extends Base
             $chatStore = (new SaasChatStore)->where(['poi_id'=> $store['poi_id'],"openid" => $request->user['openid']])->findOrEmpty();
             $userAvatar = $request->user['avatar'];
             // 获取最新的10条聊天记录
-            $msg = (new SaasChatMsg)->where(['openid' => $request->user['openid'],'poi_id' => $store['poi_id']])->append(['avatar','time'])->withAttr(['avatar' => function($data,$resp) use($userAvatar){
+            $msg = (new SaasChatMsg)->where(['openid' => $request->user['openid'],'poi_id' => $store['poi_id'],'is_user' => 0])->append(['avatar','time'])->withAttr(['avatar' => function($data,$resp) use($userAvatar){
                 if ($resp['source'] == 1) { // 用户
                     return $userAvatar??'';
                 } else {
@@ -128,7 +128,7 @@ class Service extends Base
             ],$request->method());
             if (!is_array($param)) return error($param);
             $userAvatar = $request->user['avatar'];
-            $msg = (new SaasChatMsg)->where(['openid' => $request->user['openid'],'poi_id' => $param['poi']])->append(['avatar','time'])->withAttr(['avatar' => function($data,$resp) use($userAvatar){
+            $msg = (new SaasChatMsg)->where(['openid' => $request->user['openid'],'poi_id' => $param['poi'],'is_user' => 0])->append(['avatar','time'])->withAttr(['avatar' => function($data,$resp) use($userAvatar){
                 if ($resp['source'] == 1) {
                     return $userAvatar??'';
                 } else {