fix mapper client_rates&&orderAnalysis

master
luoyang 6 years ago
parent f2104e2af5
commit 9b6f1e38dc

@ -30,13 +30,12 @@
INNER JOIN ( INNER JOIN (
SELECT SELECT
c.client_id, c.client_id,
count(o.order_id) orders SUM(o.orders) orders
FROM sys_clients c FROM sys_clients c
LEFT JOIN pmt_orders o LEFT JOIN statistics_customer_order o
ON o.client_id = c.client_id AND o.status > 4 ON o.client_id = c.client_id AND o.total > 10
AND date(o.create_time) <= date(#{end}) AND date(o.date) <= date(#{end})
AND date(o.create_time) >= date(#{begin}) AND date(o.date) >= date(#{begin})
and o.total_amount>10
WHERE c.approve_result=1 and c.is_valid=1 WHERE c.approve_result=1 and c.is_valid=1
GROUP BY c.client_id GROUP BY c.client_id
) c ON c.client_id = r.client_id ) c ON c.client_id = r.client_id

@ -197,10 +197,9 @@
</select> </select>
<select id="listCustomersData" resultType="com.alibaba.fastjson.JSONObject"> <select id="listCustomersData" resultType="com.alibaba.fastjson.JSONObject">
SELECT r.nickname,r.headimg,o.customer_id,sum(if(t.transaction_type='Credit',t.clearing_amount,0)) amount, SELECT r.nickname,r.headimg,o.customer_id,sum(if(o.status='5',o.customer_payment_amount,0)) amount,
COUNT(DISTINCT o.order_id) orders,max(t.clearing_amount) max_order COUNT(DISTINCT o.order_id) orders,max(o.customer_payment_amount) max_order
FROM pmt_orders o FROM pmt_orders o
INNER JOIN pmt_transactions t on t.order_id=o.order_id and t.system_generate=0 and (t.transaction_type='Credit' or t.transaction_type>0)
<if test="openid_type==4"> <if test="openid_type==4">
LEFT JOIN sys_customer_relation r on r.globalpay_openid = o.customer_id LEFT JOIN sys_customer_relation r on r.globalpay_openid = o.customer_id
</if> </if>
@ -236,9 +235,8 @@
</select> </select>
<select id="listCustomersDataAnalysis" resultType="com.alibaba.fastjson.JSONObject"> <select id="listCustomersDataAnalysis" resultType="com.alibaba.fastjson.JSONObject">
SELECT sum(if(t.transaction_type='Credit',t.clearing_amount,0)) total_amount SELECT sum(if(o.status='5',o.customer_payment_amount,0)) total_amount
FROM pmt_orders o FROM pmt_orders o
INNER JOIN pmt_transactions t on t.order_id=o.order_id and t.system_generate=0 and (t.transaction_type='Credit' or t.refund_id is not null)
<where> <where>
<if test="begin!=null">and o.create_time &gt;= #{begin}</if> <if test="begin!=null">and o.create_time &gt;= #{begin}</if>
<if test="end!=null">and o.create_time &lt; #{end}</if> <if test="end!=null">and o.create_time &lt; #{end}</if>

@ -288,7 +288,7 @@ margin-bottom: 10%;"/>
</a> </a>
</li> </li>
<li class="menu-group" ng-if="roleNow!=null && roleNow!='administrator' && roleNow!='developer' && roleNow!='sitemanager'"> <li class="menu-group" ng-if="roleNow!=null && roleNow!='administrator' && roleNow!='developer'">
<p role="button" ng-class="{'active': Partner,'is-hide':hideSideBar}" ng-click="Partner = !Partner"> <p role="button" ng-class="{'active': Partner,'is-hide':hideSideBar}" ng-click="Partner = !Partner">
<span>商户管理|Merchant</span> <span>商户管理|Merchant</span>
<span class="pull-right-container"> <span class="pull-right-container">
@ -330,7 +330,7 @@ margin-bottom: 10%;"/>
</ul> </ul>
</li> </li>
<li class="menu-group" ng-if="roleNow!=null && roleNow!='administrator' && roleNow!='developer' && roleNow!='sitemanager'"> <li class="menu-group" ng-if="roleNow!=null && roleNow!='administrator' && roleNow!='developer'">
<p role="button" ng-class="{'active': Transaction,'is-hide':hideSideBar}" ng-click="Transaction = !Transaction"> <p role="button" ng-class="{'active': Transaction,'is-hide':hideSideBar}" ng-click="Transaction = !Transaction">
<span>交易管理|Transaction</span> <span>交易管理|Transaction</span>
<span class="pull-right-container"> <span class="pull-right-container">

@ -32,7 +32,7 @@
</div> </div>
</div> </div>
--> <a role="button" style="float: right;line-height: 46px" ui-sref="home" ng-click="headerCopyDisplay()"><i class="fa fa-reply"></i> 返回</a> --> <a role="button" style="float: right;line-height: 46px" ui-sref="home" ng-click="headerCopyDisplay()"><i class="fa fa-reply"></i> 返回</a>
<div class="list-group" ng-if="role!=null && role!='administrator' && role!='developer' && role!='sitemanager' && 'partners'|withModule"> <div class="list-group" ng-if="role!=null && role!='administrator' && role!='developer' && 'partners'|withModule">
<div class="row"> <div class="row">
<div class="col-sm-2 col-lg-2 col-xs-6" id="partners"> <div class="col-sm-2 col-lg-2 col-xs-6" id="partners">
<div class="description-block"> <div class="description-block">
@ -113,7 +113,7 @@
</div>--> </div>-->
</div> </div>
</div> </div>
<div class="list-group" ng-if="role!=null && role!='administrator' && role!='developer' && role!='sitemanager'"> <div class="list-group" ng-if="role!=null && role!='administrator' && role!='developer'">
<div class="row"> <div class="row">
<div class="col-sm-2 col-lg-2 col-xs-6" id="transaction"> <div class="col-sm-2 col-lg-2 col-xs-6" id="transaction">
<div class="description-block"> <div class="description-block">
@ -551,16 +551,6 @@
</div> </div>
</a> </a>
</div> </div>
<div ng-if="('cashbackAnalysis'|withModule)" class="col-sm-2 col-xs-6">
<a ui-sref="cashbackAnalysis" ui-sref-opts="{reload:true}">
<div class="description-block">
<img src="/static/images/main_menu/activity_marketing_account.png"/>
<div class="description-text">
<span class="description-text">营销账户</span>
</div>
</div>
</a>
</div>
<div ng-if="'settleDelay'|withModule" class="col-sm-2 col-xs-6"> <div ng-if="'settleDelay'|withModule" class="col-sm-2 col-xs-6">
<a ui-sref="settle_delay" ui-sref-opts="{reload:true}"> <a ui-sref="settle_delay" ui-sref-opts="{reload:true}">
<div class="description-block"> <div class="description-block">

Loading…
Cancel
Save