fix 二级商户查询三级商户

master
luoyang 6 years ago
parent 936c792b2c
commit 4ad021d020

@ -25,24 +25,6 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.params.client_ids = [$scope.currentUser.client.client_id];
$scope.showLevel3Clients = false;
if ($scope.currentUser.client.has_children) {
$http.get('/client/partner_info/sub_partners').then(function (resp) {
var clientList = resp.data;
clientList.forEach(function (client) {
$scope.clients.push(client);
});
$scope.clientIds = [];
$scope.clients.forEach(function (client) {
$scope.clientIds.push(client.client_id);
if (client.level3Clients) {
client.level3Clients.forEach(function (level3Client) {
$scope.clientIds.push(level3Client.client_id);
});
}
});
$scope.params.client_ids = angular.copy($scope.clientIds);
})
}
$scope.today = new Date();
$scope.chooseToday = function () {
$scope.params.datefrom = $scope.params.dateto = new Date();
@ -114,7 +96,6 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.analysis.refund_fee = angular.copy(Math.abs($scope.analysis.refund_fee));
});
};
$scope.chooseLast7Days();
$scope.chooseClient = function (client) {
if (client == 'all') {
$scope.params.client_ids = angular.copy($scope.clientIds);
@ -209,6 +190,27 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
return url;
}
if ($scope.currentUser.client.has_children) {
$http.get('/client/partner_info/sub_partners').then(function (resp) {
var clientList = resp.data;
clientList.forEach(function (client) {
$scope.clients.push(client);
});
$scope.clientIds = [];
$scope.clients.forEach(function (client) {
$scope.clientIds.push(client.client_id);
if (client.level3Clients) {
client.level3Clients.forEach(function (level3Client) {
$scope.clientIds.push(level3Client.client_id);
});
}
});
$scope.params.client_ids = angular.copy($scope.clientIds);
$scope.chooseLast7Days();
})
}else {
$scope.chooseLast7Days();
}
}]);
return app;

Loading…
Cancel
Save