diff --git a/mallinkAdmin/src/main/resources/db/migration/V202007311200__FOR_MEMBER_ONLY_001.sql b/mallinkAdmin/src/main/resources/db/migration/V202007311200__FOR_MEMBER_ONLY_001.sql
index d144035a2..5ddf79084 100644
--- a/mallinkAdmin/src/main/resources/db/migration/V202007311200__FOR_MEMBER_ONLY_001.sql
+++ b/mallinkAdmin/src/main/resources/db/migration/V202007311200__FOR_MEMBER_ONLY_001.sql
@@ -138,16 +138,21 @@ BEGIN
--UPDATE wx_c_user_car SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ;
UPDATE wx_c_user_from_b SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ;
UPDATE wx_coupon_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ;
- --UPDATE wx_credit_history SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ;
+ UPDATE wx_credit_history SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ;
UPDATE wx_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ;
UPDATE wx_pay_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ;
UPDATE wx_refund_order SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ;
- --UPDATE wx_score_history SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ;
+ UPDATE wx_score_history SET c_user_id = newCuserId WHERE c_user_id = oldCuserId ;
UPDATE wx_card_spend SET owner_id = newCuserId WHERE owner_id = oldCuserId ;
UPDATE wx_coupon_order SET owner_id = newCuserId WHERE owner_id = oldCuserId ;
- --UPDATE wx_credit_history SET operator_id = newCuserId WHERE operator_type in (1,2) and operator_id = oldCuserId ;
+ UPDATE wx_credit_history SET operator_id = newCuserId WHERE operator_type in (1,2) and operator_id = oldCuserId ;
+
+ UPDATE wx_c_user_basic_info SET poins = (SELECT SUM(poins) FROM wx_c_user_basic_info WHERE id in (oldCuserId,newCuserId)),
+ credit = (SELECT SUM(credit) FROM wx_c_user_basic_info WHERE id in (oldCuserId,newCuserId)),
+ login_count = (SELECT SUM(login_count) FROM wx_c_user_basic_info WHERE id in (oldCuserId,newCuserId))
+ WHERE id = newCuserId ;
UPDATE wx_c_user_basic_info SET phone = phone + '(作废)',`status` = 1 WHERE id = oldCuserId ;
diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserTagsServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserTagsServiceImpl.java
index b96bf3d39..c7af1ee08 100644
--- a/mallinkService/src/main/java/com/iformall/service/impl/WxCUserTagsServiceImpl.java
+++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCUserTagsServiceImpl.java
@@ -788,6 +788,7 @@ public class WxCUserTagsServiceImpl implements WxCUserTagsService {
if (userTags.getId() != null) {
wxCUserTagsMapper.updateById(userTags);
} else {
+ userTags.setTenantId(wxCUserBasicInfo.getFinalTenantId());
userTags.setCreateDate(new Date());
userTags.setUpdateDate(new Date());
wxCUserTagsMapper.insert(userTags);
diff --git a/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml b/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml
index 3c64a7814..218b8ce2c 100644
--- a/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml
+++ b/mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml
@@ -717,6 +717,7 @@
#{idItem}
+ order by cu.`active_time` DESC
@@ -790,6 +791,7 @@
#{idItem}
+ order by cu.`active_time` DESC
@@ -801,7 +803,6 @@
limit #{begin}, #{limit}
- order by cu.`active_time` DESC