Upd:客户订单交易数据修改为无交易也显示日期

master
dulingling 5 years ago
parent 2859c8bf4c
commit 0c5ff3ef26

@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>1.3.21</version>
<version>1.3.22</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.4.0</jib-maven-plugin.version>

@ -93,9 +93,18 @@
<select id="getSumCustomersAnalysis" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT sum(s.customers) customers,sum(s.orders) orders,sum(s.new_customers) new_customers,
select date_format(calendar.datelist,'%d/%m/%Y') AS trade_date,
IFNULL(customerStatic.customers,0) AS customers,
IFNULL(customerStatic.orders,0) AS orders,
IFNULL(customerStatic.new_customers,0) AS new_customers,
IFNULL(customerStatic.old_customers,0) AS old_customers,
IFNULL(customerStatic.total,0) AS total,
IFNULL(customerStatic.single_amount,0) AS single_amount
FROM calendar
LEFT JOIN
(SELECT sum(s.customers) customers,sum(s.orders) orders,sum(s.new_customers) new_customers,
sum(s.old_customers) old_customers,sum(s.total) total, sum(s.total)/sum(s.customers) single_amount,
date_format(s.date,'%d/%m/%Y') trade_date
date_format(s.date,'%Y-%m-%d') trade_date
FROM statistics_customer_order s
LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
]]>
@ -122,7 +131,14 @@
)
</if>
</where>
GROUP BY s.date ORDER BY date DESC
GROUP BY s.date
) AS customerStatic
ON calendar.datelist = customerStatic.trade_date
<where>
<if test="begin!=null">and calendar.datelist &gt;= #{begin}</if>
<if test="end!=null">and calendar.datelist &lt; #{end}</if>
</where>
ORDER BY calendar.datelist DESC
</select>
<select id="getSumChannelAnalysis" resultType="com.alibaba.fastjson.JSONObject">

Loading…
Cancel
Save