判断是不是商家发的
This commit is contained in:
@@ -10,6 +10,7 @@ use app\exception\MyBusinessException;
|
|||||||
use app\utils\Session;
|
use app\utils\Session;
|
||||||
use ba\Random;
|
use ba\Random;
|
||||||
use support\Log;
|
use support\Log;
|
||||||
|
use support\Redis;
|
||||||
use support\Request;
|
use support\Request;
|
||||||
use support\Response;
|
use support\Response;
|
||||||
use support\think\Db;
|
use support\think\Db;
|
||||||
@@ -43,7 +44,6 @@ class GroupController extends ApiController
|
|||||||
])->find();
|
])->find();
|
||||||
if (!$owner) {
|
if (!$owner) {
|
||||||
return $this->error('无权修改');
|
return $this->error('无权修改');
|
||||||
|
|
||||||
}
|
}
|
||||||
$res = Db::name('chat_group')->where([
|
$res = Db::name('chat_group')->where([
|
||||||
'id' => $group_id,
|
'id' => $group_id,
|
||||||
@@ -52,6 +52,12 @@ class GroupController extends ApiController
|
|||||||
'name' => $title
|
'name' => $title
|
||||||
]);
|
]);
|
||||||
if($res) {
|
if($res) {
|
||||||
|
// 删除群聊中的所有人的会话列表
|
||||||
|
$group_member = Db::name('chat_group_member')->where(['group_id' => $group_id])->select()->toArray();
|
||||||
|
foreach ($group_member as $k => $v) {
|
||||||
|
$role = $v['role']==1?2:1;
|
||||||
|
Redis::del('usermsg:list:' . $role . ':' . $v['user_id']);
|
||||||
|
}
|
||||||
return $this->success();
|
return $this->success();
|
||||||
}else {
|
}else {
|
||||||
return $this->error('修改失败');
|
return $this->error('修改失败');
|
||||||
|
|||||||
@@ -280,6 +280,7 @@ namespace extend\chat\model;
|
|||||||
if($grep['is_dist'] == 0) {
|
if($grep['is_dist'] == 0) {
|
||||||
if(Gateway::isUidOnline($str_uid)) {
|
if(Gateway::isUidOnline($str_uid)) {
|
||||||
$notice_data['nick'] = $user['nick_name'];
|
$notice_data['nick'] = $user['nick_name'];
|
||||||
|
$notice_data['send_time_origin'] = $notice_data['send_time'];
|
||||||
$notice_data['send_time'] = formatWeChatTime($notice_data['send_time']);
|
$notice_data['send_time'] = formatWeChatTime($notice_data['send_time']);
|
||||||
Log::info('要发消息了---》' . $str_uid);
|
Log::info('要发消息了---》' . $str_uid);
|
||||||
Gateway::sendToUid($str_uid, self::sendReceive($notice_data));
|
Gateway::sendToUid($str_uid, self::sendReceive($notice_data));
|
||||||
|
|||||||
Reference in New Issue
Block a user