From 8b92a1b10e9d919fd8673ece41722bb966babbb3 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 06 Jan 2023 13:49:40 +0800
Subject: [PATCH] 20221227 充值归集

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

diff --git a/src/main/resources/mapper/modules/MallMemberMapper.xml b/src/main/resources/mapper/modules/MallMemberMapper.xml
index b249646..22eae8b 100644
--- a/src/main/resources/mapper/modules/MallMemberMapper.xml
+++ b/src/main/resources/mapper/modules/MallMemberMapper.xml
@@ -77,15 +77,16 @@
             a.name,
             a.phone,
             a.invite_id,
+            a.account_level,
+            a.level,
             2 isCurrent,
             a.created_time,
             (select sum(e.amount)
              from mall_order_info e
                       inner join mall_member b on e.member_id=b.ID
-                      inner join mall_order_item c on e.id = c.order_id -- and c.is_normal=2
-             where e.status <![CDATA[>= ]]> 4 and (b.invite_id=a.invite_id or b.referrer_id=a.invite_id)) amount,
-            (select count(1) from mall_member e
-                      inner join mall_order_info b on e.id=b.member_id and b.status <![CDATA[>= ]]> 4
+             where e.status = 4 and find_in_set(a.invite_id, b.referrer_ids)) amount,
+            (select count(1) from mall_order_info b
+                      inner join mall_member e on e.id=b.member_id and b.status = 4
              where find_in_set(a.invite_id, e.referrer_ids)) orderCnt,
             (select count(1) from mall_member x where find_in_set(a.invite_id, x.referrer_ids)) cnt
         from mall_member a
@@ -150,7 +151,7 @@
         FROM mall_member m
         left join data_dictionary_custom a on a.description = m.level
         <where>
-            and m.level != '代理'
+            and m.level != 'VIP'
             <if test="record != null" >
                 <if test="record.name!=null and record.name!=''">
                     and m.name like concat('%',  #{record.name},'%')
@@ -356,7 +357,8 @@
         from mall_order_info a
              inner join mall_member b on a.member_id=b.ID
         where 1=1
-        and a.status <![CDATA[>= ]]> 4
+        and a.status = 4
+        and a.comment_state = 2
         <if test="type == 1">
             and b.invite_id=#{inviteId}
         </if>
@@ -444,4 +446,22 @@
         where
             id = #{id}
     </update>
+
+    <select id="selectMemberChargeListInPage" resultType="cc.mrbird.febs.mall.entity.MemberCoinChargeEntity">
+        SELECT a.*,
+               b.name name
+        FROM member_coin_charge a
+        inner join mall_member b on a.member_id = b.id
+        <where>
+            <if test="record != null" >
+                <if test="record.name!=null and record.name!=''">
+                    and b.name like concat('%',  #{record.name},'%')
+                </if>
+                <if test="record.address!=null and record.address!=''">
+                    and a.address like concat('%',  #{record.address},'%')
+                </if>
+            </if>
+        </where>
+        order by a.CREATED_TIME desc
+    </select>
 </mapper>
\ No newline at end of file

--
Gitblit v1.9.1