admin_province_report.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. app.controller('AdminProvinceReportCtrl', function($rootScope, $scope, $http, $timeout, $state, toaster) {
  2. $scope.load = function(){
  3. $scope.myPromise = $http({
  4. url : $rootScope.host_url + '/adminOptr/provinceReport?session=' + $rootScope.session,
  5. method : 'GET'
  6. }).success(function(data) {
  7. if(data.code == 0){
  8. $scope.array = data.result;
  9. $scope.summary = {regStd:0, boy:0, girl:0, wen:0, li:0, wenli:0, czyj:0, czwj:0, ncyj:0, ncwj:0, fr:0,ru:0,en:0,de:0,jp:0,sp:0,shengjzx:0,sjzx:0,qtzx:0};
  10. angular.forEach($scope.array, function(item){
  11. $scope.summary.regStd += item.regStd;
  12. $scope.summary.boy += item.boy;
  13. $scope.summary.girl += item.girl;
  14. $scope.summary.wen += item.wen;
  15. $scope.summary.li += item.li;
  16. $scope.summary.wenli += item.wenli;
  17. $scope.summary.czyj += item.czyj;
  18. $scope.summary.czwj += item.czwj;
  19. $scope.summary.ncyj += item.ncyj;
  20. $scope.summary.ncwj += item.ncwj;
  21. $scope.summary.fr += item.fr;
  22. $scope.summary.ru += item.ru;
  23. $scope.summary.en += item.en;
  24. $scope.summary.de += item.de;
  25. $scope.summary.jp += item.jp;
  26. $scope.summary.sp += item.sp;
  27. $scope.summary.shengjzx += item.shengjzx;
  28. $scope.summary.sjzx += item.sjzx;
  29. $scope.summary.qtzx += item.qtzx;
  30. })
  31. }
  32. }).error(function() {
  33. });
  34. }
  35. $scope.load();
  36. })