Commit 43b24407 authored by liudong1993's avatar liudong1993

等级大于vip的 无法购买vip商品

parent 97f5affd
......@@ -2304,12 +2304,12 @@ namespace Mall.Module.Product
}
#region 司导信息
string SiteName = sitelist.Where(x => x.ID == gmodel.SiteId).FirstOrDefault()?.SiteName ?? "";
string GuideName = guidelist.Where(x => x.ID == gmodel.GuideId).FirstOrDefault()?.Name ?? "";
decimal GuideScore = guidelist.Where(x => x.ID == gmodel.GuideId).FirstOrDefault()?.Score ?? 5;
string CarName = carlist.Where(x => x.ID == gmodel.CarId).FirstOrDefault()?.Name ?? "";
decimal CarScore = carlist.Where(x => x.ID == gmodel.CarId).FirstOrDefault()?.Score ?? 5;
string CarColorName = carcolorlist.Where(x => x.ID == gmodel.CarColorId).FirstOrDefault()?.ColorName ?? "";
//string SiteName = sitelist.Where(x => x.ID == gmodel.SiteId).FirstOrDefault()?.SiteName ?? "";
//string GuideName = guidelist.Where(x => x.ID == gmodel.GuideId).FirstOrDefault()?.Name ?? "";
//decimal GuideScore = guidelist.Where(x => x.ID == gmodel.GuideId).FirstOrDefault()?.Score ?? 5;
//string CarName = carlist.Where(x => x.ID == gmodel.CarId).FirstOrDefault()?.Name ?? "";
//decimal CarScore = carlist.Where(x => x.ID == gmodel.CarId).FirstOrDefault()?.Score ?? 5;
//string CarColorName = carcolorlist.Where(x => x.ID == gmodel.CarColorId).FirstOrDefault()?.ColorName ?? "";
var targetList = goods_TargetDateRepository.GetList(new RB_Goods_TargetDate_Extend() { GoodsId = gmodel.Id, IsReserve = 1, DateTime = demodel.TripSTime.Value.ToString("yyyy-MM-dd") });
if (gmodel.AdvanceDay > 0)
{
......@@ -2320,6 +2320,24 @@ namespace Mall.Module.Product
{
date_enable = false;
}
var targetModel = targetList.FirstOrDefault();
if (targetModel.ReserveNum + (item.Number ?? 0) > (gmodel.RideNum ?? 0))
{
date_enable = false;
}
string SiteName = sitelist.Where(x => x.ID == gmodel.SiteId).FirstOrDefault()?.SiteName ?? "";
var guideModel = guidelist.Where(x => x.ID == gmodel.GuideId).FirstOrDefault();
string GuideName = guideModel?.Name ?? "";
string GuidePhoto = guideModel?.GuidePhoto ?? "";
decimal GuideScore = guideModel?.Score ?? 5;
string Introduction = guideModel?.Introduction ?? "";
decimal GuideWorkYears = guideModel?.WorkYears ?? 1;
var carModel = carlist.Where(x => x.ID == gmodel.CarId).FirstOrDefault();
string CarName = carModel?.Name ?? "";
string CarColorName = carcolorlist.Where(x => x.ID == gmodel.CarColorId).FirstOrDefault()?.ColorName ?? "";
decimal CarScore = carModel?.Score ?? 5;
string CarModel = carModel?.CarType ?? "";
#endregion
goods_list.Add(new
......@@ -2328,6 +2346,7 @@ namespace Mall.Module.Product
name = gmodel.Name,
categoryIdList = item.CategoryIdList,
num = item.Number,
surplus_num = (gmodel.RideNum ?? 0) - targetModel.ReserveNum,
forehead_integral = gmodel.PointsDeduction,
forehead_integral_type = gmodel.PointsDeductionType,
accumulative = gmodel.IsMultipleDeduction,//累计多件抵扣
......@@ -2372,10 +2391,14 @@ namespace Mall.Module.Product
guide_name = GuideName,
guide_id = gmodel.GuideId,
guide_score = GuideScore,
guide_photo = GuidePhoto,
guide_introduction = Introduction,
guide_workyears = GuideWorkYears,
car_name = CarName,
car_id = gmodel.CarId,
car_score = CarScore,
carcolor_name = CarColorName,
car_model = CarModel,
carcolor_id = gmodel.CarColorId,
car_number = gmodel.CarNumber,
car_buyyear = gmodel.CarBuyYear,
......
......@@ -2881,6 +2881,14 @@ namespace Mall.Module.Product
//多商品
return ApiResult.Failed("VIP商品不能与其他商品同时下单,请先购买VIP商品");
}
var disModel = distributor_InfoRepository.GetListForSingle(new RB_Distributor_Info_Extend() { UserId = umodel.Id }).FirstOrDefault();
if (disModel != null) {
var fxgradeList = distributor_FXGradeRepository.GetList(new RB_Distributor_FXGrade_Extend() { TenantId = umodel.TenantId, MallBaseId = umodel.MallBaseId });
fxgradeList = fxgradeList.Where(x => x.IsGuest == 1 || x.IsGuest == 3).ToList();
if (!fxgradeList.Select(x => x.Id).Contains(disModel.FXGradeId ?? 0)) {
return ApiResult.Failed("您当前等级无法购买VIP商品");
}
}
}
var categoryList = clist.Where(x => x.GoodsId == item.GoodsId).ToList();
if ((mallbaseModel?.IsFreeShipping ?? 0) == 1 && (gmodel.FullMoneyPinkage ?? 0) == 0 && (gmodel.FullNumPinkage ?? 0) == 0)
......
......@@ -371,7 +371,7 @@ namespace Mall.WebApi.Controllers.MallBase
public ApiResult GetGoodsTargetDateList() {
var req = RequestParm;
JObject parms = JObject.Parse(req.msg.ToString());
int DayType = parms.GetInt("DayType", 1);//类型 1时间范围 2按周 3按月份
int DayType = parms.GetInt("DayType", 1);//类型 1时间范围 2月份 3周
string StartDate = parms.GetStringValue("StartDate");
string EndDate = parms.GetStringValue("EndDate");
string Year = parms.GetStringValue("Year");//年
......@@ -416,7 +416,10 @@ namespace Mall.WebApi.Controllers.MallBase
{
if (!DateList.Contains(dt.ToString("yyyy-MM-dd")))
{
DateList.Add(dt.ToString("yyyy-MM-dd"));
if (dt >= DateTime.Now)
{
DateList.Add(dt.ToString("yyyy-MM-dd"));
}
}
dt = dt.AddDays(1);
}
......@@ -451,7 +454,10 @@ namespace Mall.WebApi.Controllers.MallBase
{
if (!DateList.Contains(dt.ToString("yyyy-MM-dd")))
{
DateList.Add(dt.ToString("yyyy-MM-dd"));
if (dt >= DateTime.Now)
{
DateList.Add(dt.ToString("yyyy-MM-dd"));
}
}
}
dt = dt.AddDays(1);
......@@ -660,6 +666,31 @@ namespace Mall.WebApi.Controllers.MallBase
{
return ApiResult.ParamIsNull("请传递分销佣金列表");
}
//转换
List<RB_Goods_DistributionCommission_Extend> Rlist = new List<RB_Goods_DistributionCommission_Extend>();
foreach (var item in demodel.DistributionCommissionList)
{
if (item.GradeCommissionList == null || !item.GradeCommissionList.Any())
{
return ApiResult.ParamIsNull("请传递分销佣金列表");
}
foreach (var qitem in item.GradeCommissionList)
{
Rlist.Add(new RB_Goods_DistributionCommission_Extend()
{
DistributorGrade = qitem.DistributorGrade,
Id = 0,
SpecificationSort = item.SpecificationSort,
OneCommission = qitem.OneCommission,
TwoCommission = qitem.TwoCommission,
ThreeCommission = qitem.ThreeCommission
});
}
}
if (Rlist.Any())
{
demodel.DistributionCommissionList = Rlist;
}
//普通设置 直接根据等级验证数量
if (DGradeList.Count() != demodel.DistributionCommissionList.Count())
{
......@@ -706,6 +737,29 @@ namespace Mall.WebApi.Controllers.MallBase
{
return ApiResult.ParamIsNull("请传递会员价格列表");
}
//转换
List<RB_Goods_MemberPrice_Extend> Rlist = new List<RB_Goods_MemberPrice_Extend>();
foreach (var item in demodel.MemberPriceList)
{
if (item.GradePriceList == null || !item.GradePriceList.Any())
{
return ApiResult.ParamIsNull("请传递会员价格列表");
}
foreach (var qitem in item.GradePriceList)
{
Rlist.Add(new RB_Goods_MemberPrice_Extend()
{
MemberGrade = qitem.MemberGrade,
Id = 0,
SpecificationSort = item.SpecificationSort,
MemberPrice = qitem.MemberPrice
});
}
}
if (Rlist.Any())
{
demodel.MemberPriceList = Rlist;
}
if (MGradeList.Count() != demodel.MemberPriceList.Count())
{
return ApiResult.ParamIsNull("会员价格列表数量不正确");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment