From e59e24ee6b64f143df8318ce38c91e13364c0bcf Mon Sep 17 00:00:00 2001
From: Hentua <wangdoubleone@gmail.com>
Date: Tue, 06 Jun 2023 17:10:05 +0800
Subject: [PATCH] fix

---
 src/main/resources/mapper/modules/MallMemberMapper.xml |   24 ++++++++++++++++++------
 1 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/src/main/resources/mapper/modules/MallMemberMapper.xml b/src/main/resources/mapper/modules/MallMemberMapper.xml
index e068693..fad5e17 100644
--- a/src/main/resources/mapper/modules/MallMemberMapper.xml
+++ b/src/main/resources/mapper/modules/MallMemberMapper.xml
@@ -43,7 +43,7 @@
                 </if>
             </if>
         </where>
-        order by m.CREATED_TIME desc
+        order by m.id desc
     </select>
 
     <select id="getMallMemberInfoById" resultType="cc.mrbird.febs.mall.vo.MallMemberVo">
@@ -87,10 +87,11 @@
             a.name,
             a.phone,
             a.invite_id,
+            a.sex,
+            a.level,
             2 isCurrent,
             a.created_time,
             p.prize_score,
-            u.description levelName,
             (select sum(e.amount)
              from mall_order_info e
                       inner join mall_member b on e.member_id=b.ID
@@ -102,7 +103,6 @@
             (select count(1) from mall_member x where x.invite_id=a.invite_id or find_in_set(a.invite_id, x.referrer_ids)) cnt
         from mall_member a
         inner join mall_member_wallet p on a.id=p.member_id
-        left join data_dictionary_custom u on a.level=u.code and u.type='AGENT_LEVEL'
         where a.referrer_id=#{inviteId}
     </select>
 
@@ -482,13 +482,25 @@
     </select>
 
     <select id="selectAgentOrPartnetMemberList" resultType="cc.mrbird.febs.mall.entity.MallMember">
-        select * from mall_membebr a
+        select * from mall_member a
         where 1=1
         <if test="level == 2">
-            a.account_level in (2, 3)
+            and a.account_level in (2, 3)
         </if>
         <if test="level == 3">
-            a.account_level = 3
+            and a.account_level = 3
+        </if>
+    </select>
+
+    <select id="selectOwnCntByInviteIdAndAccountLevel" resultType="java.lang.Integer">
+        select IFNULL(count(1),0)
+        from mall_member x where x.referrer_id=#{inviteId}
+        and x.level != 'ZERO_LEVEL'
+        <if test="accountLevel == 1  or accountLevel == 2">
+            and x.account_level = #{accountLevel}
+        </if>
+        <if test="accountLevel == 3">
+            and x.account_level in (2, 3)
         </if>
     </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1