fix 二级商户查询三级商户

master
luoyang 6 years ago
parent b3e7055917
commit d9ebf26430

@ -25,27 +25,6 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
$scope.params.client_ids = [$scope.currentUser.client.client_id]; $scope.params.client_ids = [$scope.currentUser.client.client_id];
$scope.showLevel3Clients = false; $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.chooseLast7Days();
})
}else {
$scope.chooseLast7Days();
}
$scope.today = new Date(); $scope.today = new Date();
$scope.chooseToday = function () { $scope.chooseToday = function () {
$scope.params.datefrom = $scope.params.dateto = new Date(); $scope.params.datefrom = $scope.params.dateto = new Date();
@ -211,7 +190,27 @@ define(['angular', 'uiBootstrap', 'uiRouter'], function (angular) {
return url; 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; return app;

Loading…
Cancel
Save