Validate1.js 939 Bytes
/**
 * 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;