public ActionResult GetUnivBeautyRedemptionCodes(string code, string mobile, string codeType, int pageIndex = 1, int pageSize = 10) { if (string.IsNullOrWhiteSpace(code) && string.IsNullOrWhiteSpace(mobile) && string.IsNullOrWhiteSpace(codeType)) { return(Json(new { status = false, msg = "查询条件不能为空" })); } code = code?.Trim(); mobile = mobile?.Trim(); Tuple <IEnumerable <UnivBeautyRedemptionCodeResult>, int> result = null; if (string.Equals(codeType, "BeautyServicePackageCode", StringComparison.OrdinalIgnoreCase)) { result = BeautyServicePackageManager.GetBeautyServicePackageCodes(code, mobile, pageIndex, pageSize); } else if (string.Equals(codeType, "RedemptionCodeRecord", StringComparison.OrdinalIgnoreCase)) { result = manager.GetRedemptionCodeRecordsByCondition(code, mobile, pageIndex, pageSize); } else { return(Json(new { status = false, msg = "未知的兑换码类型" }, JsonRequestBehavior.AllowGet)); } return(Json(new { status = true, data = result?.Item1, total = result?.Item2 ?? 0 }, JsonRequestBehavior.AllowGet)); }