合并微信账号和h5账号时有信息遗漏问题修复
public static function setUserRelationInfos($bindingPhone, $uid, $newUid, $isDel = true, $qcodeId = 0)
{
self::startTrans();
try {
//修改下级推广人关系
self::where('spread_uid', $uid)->update(['spread_uid' => $newUid]);
//修改用户金额变动记录表
self::getDb('user_bill')->where('uid', $uid)->update(['uid' => $newUid]);
//修改签到记录表
self::getDb('user_sign')->where('uid', $uid)->update(['uid' => $newUid]);
//修改虚拟币充值记录表
self::getDb('user_recharge')->where('uid', $uid)->update(['uid' => $newUid]);
//修改收货地址表
self::getDb('user_address')->where('uid', $uid)->update(['uid' => $newUid]);
//修改提现记录用户
self::getDb('user_extract')->where('uid', $uid)->update(['uid' => $newUid]);
//修改专题相关表
self::getDb('special_buy')->where('uid', $uid)->update(['uid' => $newUid]);
self::getDb('special_watch')->where('uid', $uid)->update(['uid' => $newUid]);
self::getDb('learning_records')->where('uid', $uid)->update(['uid' => $newUid]);
self::getDb('special_exchange')->where('use_uid', $uid)->update(['use_uid' => $newUid]);
self::getDb('special_record')->where('uid', $uid)->update(['uid' => $newUid]);
self::getDb('special_relation')->where('uid', $uid)->update(['uid' => $newUid]);
self::getDb('special_reply')->where('uid', $uid)->update(['uid' => $newUid]);
//修改直播嘉宾表
self::getDb('live_user')->where('uid', $uid)->update(['uid' => $newUid]);
self::getDb('live_barrage')->where('uid', $uid)->update(['uid' => $newUid]);
self::getDb('live_honoured_guest')->where('uid', $uid)->update(['uid' => $newUid]);
self::getDb('live_reward')->where('uid', $uid)->update(['uid' => $newUid]);
//修改购物车记录表
self::getDb('store_cart')->where('uid', $uid)->update(['uid' => $newUid]);
self::getDb('store_product_reply')->where('uid', $uid)->update(['uid' => $newUid]);
//修改用户订单记录
self::getDb('store_order')->where('uid', $uid)->update(['uid' => $newUid]);
//修改拼团用户记录
self::getDb('store_pink')->where('uid', $uid)->update(['uid' => $newUid]);
//修改手机用户表记录
self::getDb('phone_user')->where('uid', $uid)->update(['uid' => $newUid]);
//修改会员记录表记录
self::getDb('member_record')->where('uid', $uid)->update(['uid' => $newUid]);
//修改搜索记录表记录
self::getDb('search_history')->where('uid', $uid)->update(['uid' => $newUid]);
//修改用户报名表记录
self::getDb('event_sign_up')->where('uid', $uid)->update(['uid' => $newUid]);
self::getDb('event_write_off_user')->where('uid', $uid)->update(['uid' => $newUid]);
//修改资料订单表记录
self::getDb('data_download_buy')->where('uid', $uid)->update(['uid' => $newUid]);
self::getDb('data_download_order')->where('uid', $uid)->update(['uid' => $newUid]);
self::getDb('data_download_records')->where('uid', $uid)->update(['uid' => $newUid]);
//修改证书记录表记录
self::getDb('certificate_record')->where('uid', $uid)->update(['uid' => $newUid]);
//修改考试相关表记录
self::getDb('examination_record')->where('uid', $uid)->update(['uid' => $newUid]);
self::getDb('examination_test_record')->where('uid', $uid)->update(['uid' => $newUid]);
self::getDb('examination_wrong_bank')->where('uid', $uid)->update(['uid' => $newUid]);
self::getDb('test_paper_obtain')->where('uid', $uid)->update(['uid' => $newUid]);
self::getDb('test_paper_order')->where('uid', $uid)->update(['uid' => $newUid]);
//修改讲师相关表
self::getDb('merchant')->where('uid', $uid)->update(['uid' => $newUid]);
self::getDb('merchant_follow')->where('uid', $uid)->update(['uid' => $newUid]);
self::getDb('user_enter')->where('uid', $uid)->update(['uid' => $newUid]);
//修改学员相关表
self::getDb('student')->where('uid', $uid)->update(['uid' => $newUid]);
//修改老师相关表
self::getDb('teacher')->where('uid', $uid)->update(['uid' => $newUid]);
//删除用户表H5用户记录
$user = self::where('uid', $uid)->find();
if ($isDel) self::where('uid', $uid)->delete();
//修改上级推广关系和绑定手机号码
self::where('uid', $newUid)->update([
'phone' => $bindingPhone,
'spread_uid' => $user['spread_uid'],
'spread_time' => $user['spread_time'],
'valid_time' => $user['valid_time'],
'is_promoter' => $user['is_promoter'],
'pay_count' => $user['pay_count'],
'is_senior' => $user['is_senior'],
'now_money' => $user['now_money'],
'gold_num' => $user['gold_num'],
'brokerage_price' => $user['brokerage_price'],
'is_permanent' => $user['is_permanent'],
'member_time' => $user['member_time'],
'overdue_time' => $user['overdue_time'],
'level' => $user['level'],
'identitys' => $user['identitys'],
'is_write_off' => $user['is_write_off'],
'business' => $user['business']
]);
if ($qcodeId) WechatQrcode::where('id', $qcodeId)->update(['scan_id' => $newUid]);
self::commit();
Session::clear('wap');
Session::set('loginUid', $newUid, 'wap');
return true;
} catch (\Exception $e) {
self::rollback();
return self::setErrorInfo($e->getMessage());
}
}
{{item.user_info.nickname ? item.user_info.nickname : item.user_name}}
作者 管理员 企业
{{itemf.name}}
{{itemc.user_info.nickname}}
{{itemc.user_name}}
回复 {{itemc.comment_user_info.nickname}}
{{itemf.name}}