Browse Source

Merge branch 'dev' into 'mp-server-test'

Dev

See merge request quanshu/mp-server!423
zhong chunping 3 years ago
parent
commit
6577e7580c
1 changed files with 12 additions and 11 deletions
  1. 12 11
      mp-service/src/main/resources/mapper/channel/ChannelMapper.xml

+ 12 - 11
mp-service/src/main/resources/mapper/channel/ChannelMapper.xml

@@ -88,19 +88,20 @@
              t2.off_line_qty_cnt, t2.off_line_sale_cnt, t4.sale_qty-t2.off_line_sale_cnt as on_line_sale_cnt, t3.user_cnt
       from mp_channel t1
              left join (
-        select channel_id, SUM(  b.pkg_unit - b.sale_qty ) AS off_line_qty_cnt,
-               SUM(  b.sale_qty  ) AS off_line_sale_cnt
-        from mp_channel_order_detail a
-               left join mp_ticket_package b on a.pkg_id=b.pkg_id
-        group by a.channel_id) t2 on t1.channel_id = t2.channel_id
+                select channel_id, SUM(  b.pkg_unit - b.sale_qty ) AS off_line_qty_cnt,
+                       SUM(  b.sale_qty  ) AS off_line_sale_cnt
+                from mp_channel_order_detail a
+                       left join mp_ticket_package b on a.pkg_id=b.pkg_id
+                group by a.channel_id) t2 on t1.channel_id = t2.channel_id
              left join (
-        select channel_id, count(*) AS user_cnt
-        from mp_channel_user_rel
-        group by channel_id) t3 on t1.channel_id = t3.channel_id
+                select channel_id, count(*) AS user_cnt
+                from mp_channel_user_rel
+                group by channel_id) t3 on t1.channel_id = t3.channel_id
              left join (
-        select channel_id, count(*) AS sale_qty
-        from mp_channel_commission
-        group by channel_id) t4 on t1.channel_id = t4.channel_id
+                select channel_id, sum(ticket_num) AS sale_qty
+                from mp_user_ticket_order
+                where status=1
+                group by channel_id) t4 on t1.channel_id = t4.channel_id
         ${ew.customSqlSegment}
 	</select>