master
yuan 7 years ago
parent 11e7bd5e13
commit 4c3360f9e5

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

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

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

Loading…
Cancel
Save