StatisticsService.js
3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
"use strict";
var StatisticsService = angular.module('StatisticsService',[]);
StatisticsService.service("StatisticsService", [
'$rootScope',
'BaseService',
function ($rootScope,BaseService) {
var _service = {
products:[],
orderStatictis:{},
productSearchs:[],
memberShopcarts:[],
pagerProduct:function(productQuery) {
BaseService.request({
url:BaseService.url.pagerStatProduct_url,
method:'post',
mark:true,
data:productQuery,
fn:function(response) {
if(response.code == 0) {
_service.products = response.data;
$rootScope.$broadcast('product.list');
}
}
});
},
pagerProductList:function(productQuery) {
BaseService.request({
url:BaseService.url.pagerStatProductList_url,
method:'post',
mark:true,
data:productQuery,
fn:function(response) {
if(response.code == 0) {
_service.products = response.data;
$rootScope.$broadcast('product.list');
}
}
});
},
getCurrentOrderStatictis:function() {
BaseService.request({
url:BaseService.url.orderStatictis_url+"?isCurrentDay=111",
method:'get',
mark:true,
fn:function(response) {
if(response.code == 0) {
_service.orderStatictis = response.data;
$rootScope.$broadcast('orderCount:statictis');
}
}
});
}
,
getIntegralOrderStatictis:function() {
BaseService.request({
url:BaseService.url.orderStatictis_url+"?orderType=integral",
method:'get',
mark:true,
fn:function(response) {
if(response.code == 0) {
_service.orderStatictis = response.data;
$rootScope.$broadcast('integralOrderCount:statictis');
}
}
});
}
,
getMoneyOrderStatictis:function() {
BaseService.request({
url:BaseService.url.orderStatictis_url+"?orderType=money",
method:'get',
mark:true,
fn:function(response) {
if(response.code == 0) {
_service.orderStatictis = response.data;
$rootScope.$broadcast('moneyOrderCount:statictis');
}
}
});
},
listProductSearch:function(pageNow, pageSize, searchStartDt, searchEndDt) {
BaseService.request({
url:BaseService.url.productSearch_url+"?pageNow="+pageNow+"&pageSize="+pageSize+"&searchStartDt="+searchStartDt+"&searchEndDt="+searchEndDt,
method:'get',
mark:true,
fn:function(response) {
if(response.code == 0) {
_service.productSearchs = response.data;
$rootScope.$broadcast('productSearchs.list');
}
}
});
},
listMemberShopcart:function(pageNow, pageSize, searchStartDt, searchEndDt) {
BaseService.request({
url:BaseService.url.memberShopcart_url+"?pageNow="+pageNow+"&pageSize="+pageSize+"&searchStartDt="+searchStartDt+"&searchEndDt="+searchEndDt,
method:'get',
mark:true,
fn:function(response) {
if(response.code == 0) {
_service.memberShopcarts = response.data;
$rootScope.$broadcast('memberShopcarts.list');
}
}
});
},
};
return _service;
}]);