master
yuan 6 years ago
parent 11e7bd5e13
commit 4c3360f9e5

@ -198,7 +198,6 @@
<select id="listCustomersData" resultType="com.alibaba.fastjson.JSONObject">
SELECT o.customer_id,sum(if(t.transaction_type='Credit',t.clearing_amount,0)) amount,
sum(if(t.transaction_type='Credit',t.clearing_amount div 10,0)) points,
COUNT(DISTINCT o.order_id) orders,max(t.clearing_amount) max_order
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)
@ -224,12 +223,11 @@
<if test="org_ids!=null">and o.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
</where>
GROUP BY o.customer_id ORDER BY points desc
GROUP BY o.customer_id
</select>
<select id="listCustomersDataAnalysis" resultType="com.alibaba.fastjson.JSONObject">
SELECT sum(if(t.transaction_type='Credit',t.clearing_amount,0)) total_amount,
sum(if(t.transaction_type='Credit',t.clearing_amount div 10,0)) total_points
SELECT sum(if(t.transaction_type='Credit',t.clearing_amount,0)) total_amount
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>

@ -148,6 +148,7 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', '
// $scope.analysis = resp.data.analysis;
});
};
$scope.chooseToday();
$scope.orderDetail = function (order) {
orderService.managerOrderDetail(order)

@ -90,8 +90,8 @@
<div class="box">
<div class="box-header">
<h3 class="box-title">Customer List</h3>
<small>Total Amount:{{customers_analysis.total_amount}},Total
Points:{{customers_analysis.total_points}}
<small>Total Amount:{{customers_analysis.total_amount}}<!--,Total
Points:{{customers_analysis.total_points}}-->
</small>
</div>
@ -101,7 +101,7 @@
<tr>
<th>Customer openId</th>
<th>Amount(AUD)</th>
<th>Points</th>
<!-- <th>Points</th>-->
<th>Orders</th>
<th>Max Order(AUD)</th>
</tr>
@ -112,7 +112,7 @@
ng-click="order_params.customer_id=customer.customer_id;listCustomerOrders()">
<td ng-bind="customer.customer_id"></td>
<td ng-bind="customer.amount"></td>
<td ng-bind="customer.points"></td>
<!-- <td ng-bind="customer.points"></td>-->
<td ng-bind="customer.orders"></td>
<td ng-bind="customer.max_order"></td>
</tr>

Loading…
Cancel
Save