|
|
@@ -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 {
|