示例#1
0
        /// <summary>
        /// 拉取卡券概况数据接口
        /// </summary>
        /// <param name="beginDate">查询数据的起始时间。</param>
        /// <param name="endDate">查询数据的截至时间。</param>
        /// <param name="condSource">卡券来源,0为公众平台创建的卡券数据、1是API创建的卡券数据 </param>
        /// <returns></returns>
        public ActionResult GetCardBizuinInfo(string beginDate, string endDate, int condSource)
        {
            string cSource = condSource.ToString();

            if (!VerifyParam("beginDate,endDate,cSource"))
            {
                return(ErrMsg());
            }

            var weChatConfig = GetWechatConfig();

            var ret = CardApi.GetCardBizuinInfo(weChatConfig.WeixinAppId, weChatConfig.WeixinCorpSecret, beginDate, endDate, condSource);

            if (ret.errcode == Weixin.ReturnCode.请求成功)
            {
                return(Json(new
                {
                    message = "",
                    success = true,
                    list = ret.list
                }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(new
                {
                    message = ret.errmsg,
                    success = false
                }, JsonRequestBehavior.AllowGet));
            }
        }