群信息
This commit is contained in:
@@ -210,6 +210,8 @@ namespace extend\chat\model;
|
||||
'from_id' => self::$user_info['uid'],
|
||||
'to_id' => $message['to_id'],
|
||||
'group_id' => $group_id,
|
||||
'shop_id' => !empty($message['shop_id'])?$message['shop_id']:null,
|
||||
'chat_coupon_id' => !empty($message['chat_coupon_id'])?$message['chat_coupon_id']:null,
|
||||
'chat_type' => $message['chat_type'],
|
||||
'msg_type' => $message['msg_type'],
|
||||
'content' => !empty($message['content'])?$message['content']:null,
|
||||
@@ -267,6 +269,22 @@ namespace extend\chat\model;
|
||||
if($grep['user_id'] != self::$user_info['uid']) {
|
||||
$user_type = $grep['role']==1?2:1;
|
||||
$str_uid = self::getUid($grep['user_id'], $user_type);
|
||||
|
||||
// 如果发送的是优惠券,检查这个人有没有领取过
|
||||
if($message['msg_type'] == 4 && !empty($message['coupon']) && !empty($message['chat_coupon_id'])) {
|
||||
// 查询有没有领取过优惠券
|
||||
$mk_shop_coupon_record = Db::name('mk_shop_coupon_record')->where([
|
||||
'source' => '群聊发放',
|
||||
'source_id ' => $message['chat_coupon_id'],
|
||||
'user_id' => $grep['user_id'],
|
||||
'shop_id' => $message['shop_id'],
|
||||
])->find();
|
||||
if($mk_shop_coupon_record) {
|
||||
$notice_data['coupon_claim'] = 1;
|
||||
}else {
|
||||
$notice_data['coupon_claim'] = 0;
|
||||
}
|
||||
}
|
||||
// 群成员是否在线,在线发 不在线存起来等上线了发 免打扰也不发消息
|
||||
if($grep['is_dist'] == 0) {
|
||||
if(Gateway::isUidOnline($str_uid)) {
|
||||
|
||||
Reference in New Issue
Block a user