Validate1.js
936 Bytes
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
/**
* Created by JiangMin on 2016/4/18.
*/
var common=require('../../common/common');
var Validate1 = {
"getCoupon": [
{
name: "couponID", fn: function (data) {
var a = "";
var b=false;
data.data.forEach(function (x) {
if (x.couponID) {
if (a == "") {
a = x.couponID;
}
else {
a = a + ',' + x.couponID;
}
}
});
common.util.__ajax({
url: "/coupon/batchCheckCoupons",
async:false,
data: {
params: a
}
}, function (res) {
if(res.code=='200'){
b=true;
}
});
return b;
}
}
]
};
module.exports=Validate1;