Upd:运营端消费者排名排序

master
dulingling 5 years ago
parent 01f5e0266f
commit 2e20929642

@ -37,8 +37,9 @@ public class AnalysisBean {
private String amount_to; private String amount_to;
private String bd_name; private String bd_name;
private String timezone; private String timezone;
private boolean orderAmountFlag; private String orderValue;
private boolean orderOrdersFlag;
public JSONObject toParams(String timezone) { public JSONObject toParams(String timezone) {
JSONObject params = new JSONObject(); JSONObject params = new JSONObject();
if (timezone != null) { if (timezone != null) {
@ -91,8 +92,7 @@ public class AnalysisBean {
if (amount_from != null && amount_from.length() > 0){ if (amount_from != null && amount_from.length() > 0){
params.put("amount_from", new BigDecimal(amount_from)); params.put("amount_from", new BigDecimal(amount_from));
} }
params.put("orderAmountFlag", orderAmountFlag); params.put("orderValue", orderValue);
params.put("orderOrdersFlag", orderOrdersFlag);
return params; return params;
} }
@ -240,20 +240,11 @@ public class AnalysisBean {
this.timezone = timezone; this.timezone = timezone;
} }
public boolean isOrderAmountFlag() { public String getOrderValue() {
return orderValue;
return orderAmountFlag;
}
public void setOrderAmountFlag(boolean orderAmountFlag) {
this.orderAmountFlag = orderAmountFlag;
}
public boolean isOrderOrdersFlag() {
return orderOrdersFlag;
} }
public void setOrderOrdersFlag(boolean orderOrdersFlag) { public void setOrderValue(String orderValue) {
this.orderOrdersFlag = orderOrdersFlag; this.orderValue = orderValue;
} }
} }

@ -109,11 +109,8 @@ public class CustomersAnalysisServiceImp implements CustomersAnalysisService {
@Override @Override
public JSONObject getCustomersRanking(JSONObject params, int page, int limit) { public JSONObject getCustomersRanking(JSONObject params, int page, int limit) {
PageList<JSONObject> logs = orderAnalysisMapper.listCustomersData(params, new PageBounds(page, limit,
Order.formString( PageList<JSONObject> logs = orderAnalysisMapper.listCustomersData(params, new PageBounds(page, limit, Order.formString( params.getString("orderValue") )));
(params.getBoolean("orderAmountFlag")?"orders.desc":"amount.desc")
)
));
if (logs.size() > 0) { if (logs.size() > 0) {
for (JSONObject log : logs) { for (JSONObject log : logs) {
generatorUserProfile(log, params); generatorUserProfile(log, params);

@ -14,8 +14,9 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', '
}]); }]);
app.controller('customersListCtrl', ['$scope', '$http','$filter', '$uibModal', 'commonDialog', 'orderService', 'refunder', function ($scope, $http,$filter, $uibModal, commonDialog, orderService, refunder) { app.controller('customersListCtrl', ['$scope', '$http','$filter', '$uibModal', 'commonDialog', 'orderService', 'refunder', function ($scope, $http,$filter, $uibModal, commonDialog, orderService, refunder) {
$scope.one_customer = {}; $scope.one_customer = {};
$scope.orderAmountFlag = true; $scope.orderAmountFlag = false;
$scope.orderOrdersFlag = true; $scope.orderOrdersFlag = true;
var echartsConfig = function (graph) { var echartsConfig = function (graph) {
var categories = []; var categories = [];
var c = 0; var c = 0;
@ -68,6 +69,7 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', '
}; };
$scope.pagination = {}; $scope.pagination = {};
$scope.params = {}; $scope.params = {};
$scope.params.orderValue = "amount.desc";
$scope.params.openid_type = '0'; $scope.params.openid_type = '0';
$scope.today = new Date(); $scope.today = new Date();
@ -232,13 +234,15 @@ define(['angular', 'static/commons/commons', 'static/commons/angular-ueditor', '
refunder.refunded(order.order_id) refunder.refunded(order.order_id)
}; };
$scope.clickOrderAmount = function () { $scope.clickOrderAmount = function () {
$scope.params.orderAmountFlag = !$scope.orderAmountFlag; $scope.orderAmountFlag = !$scope.orderAmountFlag;
$scope.params.orderOrdersFlag = true; $scope.params.orderValue = "amount"+($scope.orderAmountFlag?".asc":".desc")
$scope.orderOrdersFlag = true;
$scope.listCustomers(1); $scope.listCustomers(1);
}; };
$scope.clickOrderOrders = function () { $scope.clickOrderOrders = function () {
$scope.params.orderOrdersFlag = !$scope.orderOrdersFlag; $scope.orderOrdersFlag = !$scope.orderOrdersFlag;
$scope.params.orderAmountFlag = true; $scope.params.orderValue = "orders"+($scope.orderOrdersFlag?".asc":".desc")
$scope.orderAmountFlag = true;
$scope.listCustomers(1); $scope.listCustomers(1);
} }
}]); }]);

@ -122,11 +122,11 @@
<th style="width: 200px">Nick Name</th> <th style="width: 200px">Nick Name</th>
<th>Customer openId</th> <th>Customer openId</th>
<th ng-click="orderAmount()">Amount(AUD) <th ng-click="orderAmount()">Amount(AUD)
<i ng-click="clickOrderAmount()" ng-class="params.orderAmountFlag?'glyphicon glyphicon-chevron-up':'glyphicon glyphicon-chevron-down'"></i> <i ng-click="clickOrderAmount()" ng-class="orderAmountFlag?'glyphicon glyphicon-chevron-up':'glyphicon glyphicon-chevron-down'"></i>
</th> </th>
<!-- <th>Points</th>--> <!-- <th>Points</th>-->
<th >Orders <th >Orders
<i ng-click="clickOrderOrders()" ng-class="params.orderOrdersFlag?'glyphicon glyphicon-chevron-up':'glyphicon glyphicon-chevron-down'"></i> <i ng-click="clickOrderOrders()" ng-class="orderOrdersFlag?'glyphicon glyphicon-chevron-up':'glyphicon glyphicon-chevron-down'"></i>
</th> </th>
<th>Max Order(AUD)</th> <th>Max Order(AUD)</th>
</tr> </tr>

Loading…
Cancel
Save