Commit 28c8b2ea authored by liudong1993's avatar liudong1993
parents f4fb5a8f 5ece639f
......@@ -178,5 +178,10 @@ namespace Mall.Model.Extend.Product
/// </summary>
public decimal MemberPrice { get; set; }
/// <summary>
/// 供应商ids 2020-08-04 Add By:W
/// </summary>
public string SupplierIds { get; set; }
}
}
......@@ -57,5 +57,26 @@ namespace Mall.Model.Extend.Product
/// 返佣ids
/// </summary>
public string IntroductionIds { get; set; }
/// <summary>
/// 商品名称
/// </summary>
public string GoodsName { get; set; }
public int? OrderBy { get; set; }
/// <summary>
/// 开始时间
/// </summary>
public string StartTime { get; set; }
/// <summary>
/// 结束时间
/// </summary>
public string EndTime { get; set; }
/// <summary>
/// ids
/// </summary>
public string OrderDetailIds { get; set; }
}
}
......@@ -22,5 +22,10 @@ namespace Mall.Model.Extend.User
/// 供应商名称
/// </summary>
public string SupplierName { get; set; }
/// <summary>
/// 0-全部,不包含拒绝的,1-待打款,2-已打款
/// </summary>
public int SelectBillState { get; set; }
}
}
......@@ -1082,6 +1082,34 @@ namespace Mall.Module.BaseSetUp
return flag;
}
/// <summary>
/// 新增/修改基础信息
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool AddOrUpdateIsEnable(int id, int IsEnable)
{
try
{
IDictionary<string, object> fileds = new Dictionary<string, object>()
{
{ nameof(RB_FreeShipping.IsEnable),IsEnable},
};
IList<WhereHelper> whereHelpers = new List<WhereHelper>()
{
new WhereHelper (){ FiledName=nameof(RB_FreeShipping.ID),FiledValue=id,OperatorEnum=OperatorEnum.Equal}
};
return freeShippingRepository.Update(fileds, whereHelpers);
}
catch (Exception ex)
{
LogHelper.Write(ex, "AddOrUpdateIsEnable");
mallBaseRepository.DBSession.Rollback("AddOrUpdateIsEnable");
return false;
}
}
/// <summary>
/// 删除分类包邮规则
/// </summary>
......
......@@ -1268,7 +1268,7 @@ namespace Mall.Module.Product
var disModel = distributor_InfoRepository.GetList(new RB_Distributor_Info_Extend() { TenantId = TenantId, MallBaseId = MallBaseId, UserId = UserId, AuditStatus = Common.Enum.User.DistributorAuditStatusEnum.Audited }).FirstOrDefault();
if (disModel != null)
{
if ((BasicsModel?.IsEnableFXGrade??2) == 1 && (model.PresentFXGrade ?? 0) == 0)
if ((BasicsModel?.IsEnableFXGrade ?? 2) == 1 && (model.PresentFXGrade ?? 0) == 0)
{
var FXList = distributor_FXGradeRepository.GetList(new RB_Distributor_FXGrade_Extend() { TenantId = TenantId, MallBaseId = MallBaseId });
if (FXList.Any() && FXList.Where(x => x.IsGuest == 1).Any())
......@@ -1670,11 +1670,14 @@ namespace Mall.Module.Product
string PresentFXGradeMsg = "";
if ((BasicsModel?.IsEnableFXGrade ?? 2) == 1)
{
if (model.PresentFXGrade > 0) {
if (model.PresentFXGrade > 0)
{
var fxmodel = distributor_FXGradeRepository.GetEntity(model.PresentFXGrade);
if (fxmodel != null) {
if (fxmodel != null)
{
PresentFXGradeMsg = "购买收货后赠送" + fxmodel.GradeName + "会员";
if (model.PresentFXMonth > 0) {
if (model.PresentFXMonth > 0)
{
PresentFXGradeMsg += (model.PresentFXMonth ?? 0) + "个月";
}
}
......@@ -3348,9 +3351,9 @@ namespace Mall.Module.Product
List<RB_Product_Category_Extend> categoryList = product_CategoryRepository.GetList(new RB_Product_Category_Extend() { MallBaseId = demodel.MallBaseId, TenantId = demodel.TenantId });
var goodsList = goodsRepository.GetList(demodel);
if (categoryList!=null&& categoryList.Count>0)
if (categoryList != null && categoryList.Count > 0)
{
var firstCategoryList = categoryList.Where(qitem=>qitem.Tier==1).ToList();
var firstCategoryList = categoryList.Where(qitem => qitem.Tier == 1).ToList();
foreach (var firstItem in firstCategoryList)
{
var rootGoodsList = goodsList.Where(qitem => qitem.CategoryId == firstItem.Id).ToList();
......@@ -5031,6 +5034,35 @@ namespace Mall.Module.Product
{
return goodsRepository.GetList(dmodel);
}
/// <summary>
/// 根据商品id获取商品规格
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public List<RB_Goods_Specification_Extend> GetSpecificationList(RB_Goods_Specification_Extend model)
{
return goods_SpecificationRepository.GetList(model);
}
/// <summary>
/// 根据商品id获取商品规格价格
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public List<RB_Goods_SpecificationPrice_Extend> GetSpecificationPriceList(RB_Goods_SpecificationPrice_Extend model)
{
return goods_SpecificationPriceRepository.GetList(model);
}
/// <summary>
/// 根据商品id获取商品规格值
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public List<RB_Goods_SpecificationValue_Extend> GetSpecificationValueList(RB_Goods_SpecificationValue_Extend model)
{
return goods_SpecificationValueRepository.GetList(model);
}
#endregion
#region 商品代理
......@@ -5893,7 +5925,8 @@ namespace Mall.Module.Product
//查询所有的规格价格
var splist = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsIds = goodsIds, TenantId = tenantId, MallBaseId = mallBaseId });
foreach (var item in goodsList) {
foreach (var item in goodsList)
{
if (item.SeparateDistribution == 1 && item.SeparateDistributionMoneyType == 2)
{
var dc1list = dclist.Where(x => x.GoodsId == item.Id).ToList();
......@@ -5972,9 +6005,11 @@ namespace Mall.Module.Product
goodsRepository.Update(keyValues, wheres);
}
}
else {
else
{
//只更新成本
if (item.IsCustomSpecification == 1) {
if (item.IsCustomSpecification == 1)
{
var sp1list = splist.Where(x => x.GoodsId == item.Id).ToList();
foreach (var qitem in sp1list)
{
......
......@@ -2424,7 +2424,7 @@ namespace Mall.Module.User
/// 推荐生成提现单据
/// </summary>
/// <returns></returns>
public bool OrderIncomeFinanceModuleForRecommend(int UserId,int BillId,List<RB_Goods_OrderIntroduction_Extend> list, int TenantId, int MallBaseId)
public bool OrderIncomeFinanceModuleForRecommend(int UserId, int BillId, List<RB_Goods_OrderIntroduction_Extend> list, int TenantId, int MallBaseId)
{
var flag = false;
try
......@@ -2445,7 +2445,8 @@ namespace Mall.Module.User
var item = financeConfigurineList.FirstOrDefault();
var detailList = new List<object>();
var OrderNoList = list.Select(x => x.OrderNo).Distinct().ToList();
foreach (var qitem in OrderNoList) {
foreach (var qitem in OrderNoList)
{
var NoList = list.Where(x => x.OrderNo == qitem).ToList();
decimal unitmoney = NoList.Sum(x => x.Commission ?? 0);
detailList.Add(new
......@@ -5546,17 +5547,20 @@ namespace Mall.Module.User
public List<RB_Distributor_Bill_Extend> GetRecommendOrdersBillPageList(int pageIndex, int pageSize, out long count, RB_Distributor_Bill_Extend demodel)
{
var list = distributor_BillRepository.GetPageList(pageIndex, pageSize, out count, demodel);
if (list.Any()) {
if (list.Any())
{
//查询用户
string userIds = string.Join(",", list.Select(x => x.UserId ?? 0));
var ulist = member_UserRepository.GetList(new RB_Member_User_Extend() { UserIds = userIds });
//查询供应商
List<RB_Supplier_Extend> supplierList = new List<RB_Supplier_Extend>();
if (list.Where(x => x.SupplierId > 0).Any()) {
if (list.Where(x => x.SupplierId > 0).Any())
{
string supplierIds = string.Join(",", list.Where(x => x.SupplierId > 0).Select(x => x.SupplierId));
supplierList = supplierRepository.GetList(new RB_Supplier_Extend() { SupplierIds = supplierIds });
}
foreach (var item in list) {
foreach (var item in list)
{
item.UserName = ulist.Where(x => x.Id == item.UserId).FirstOrDefault()?.Name ?? "";
item.SupplierName = supplierList.Where(x => x.ID == item.SupplierId).FirstOrDefault()?.Name ?? "";
}
......@@ -5580,7 +5584,8 @@ namespace Mall.Module.User
var smodel = supplierRepository.GetEntity(bmodel?.SupplierId ?? 0);
List<object> RList = new List<object>();
var list = distributor_BillDetailRepository.GetList(new RB_Distributor_BillDetail_Extend() { BillId = demodel.BillId, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
if (list.Any()) {
if (list.Any())
{
//获取订单明细
string DetailIds = string.Join(",", list.Select(x => x.OrderDetailId ?? 0));
var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, OrderDetailIds = DetailIds });
......@@ -5662,6 +5667,7 @@ namespace Mall.Module.User
}
};
bool flag = distributor_BillRepository.Update(keyValues, wheres);
if (flag) {
//回滚 订单返佣状态
var dlist = distributor_BillDetailRepository.GetList(new RB_Distributor_BillDetail_Extend() { TenantId = tenantId, MallBaseId = mallBaseId, BillId = billId });
......@@ -5689,6 +5695,82 @@ namespace Mall.Module.User
return flag;
}
/// <summary>
/// 获取商品订单介绍返佣表列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_OrderIntroduction_Extend> GetOrderIntroductionList(RB_Goods_OrderIntroduction_Extend dmodel)
{
return goods_OrderIntroductionRepository.GetListByNormal(dmodel);
}
/// <summary>
/// 获取用户分销订单
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_Goods_OrderIntroduction_Extend> GetOrderIntroductionPageList(int pageIndex, int pageSize, out long count, RB_Goods_OrderIntroduction_Extend demodel)
{
var oclist = goods_OrderIntroductionRepository.GetOrderIntroductionPageList(pageIndex, pageSize, out count, demodel);
if (oclist.Any())
{
//获取用户
var ulist = member_UserRepository.GetList(new RB_Member_User_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, UserIds = string.Join(",", oclist.Select(x => x.UserId).Distinct()) });
string orderIds = string.Join(",", oclist.Select(x => x.OrderId).Distinct());
//查询订单明细
var dlist = goods_OrderDetailRepository.GetOrderDetailList(new RB_Goods_OrderDetail_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, OrderIds = orderIds });
//查询图片
List<RB_Material_Info_Extend> Mlist = new List<RB_Material_Info_Extend>();
if (dlist.Any())
{
foreach (var item in dlist)
{
item.CoverImagePath = item.CoverImage;
}
}
foreach (var item in oclist)
{
var umodel = ulist.Where(x => x.Id == item.UserId).FirstOrDefault();
item.UserName = umodel?.Name ?? "";
item.Mobile = umodel?.Moblie ?? "";
item.Photo = umodel?.Photo ?? "";
item.OrderDetailList = new List<RB_Goods_OrderDetail_Extend>();
if (!string.IsNullOrWhiteSpace(item.OrderDetailIds))
{
var orderDetailIds = item.OrderDetailIds.Split(",");
foreach (var itemOrderDetailId in orderDetailIds)
{
if (!string.IsNullOrWhiteSpace(itemOrderDetailId))
{
item.OrderDetailList.AddRange(dlist.Where(x => x.OrderId == item.OrderId && x.Id == Convert.ToInt32(itemOrderDetailId)));
}
}
}
// item.OrderDetailList = dlist.Where(x => x.OrderId == item.OrderId).ToList();
}
}
return oclist;
}
/// <summary>
/// 获取推荐供应商返佣账单列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Distributor_Bill_Extend> GetDistributorBillList(RB_Distributor_Bill_Extend dmodel)
{
return distributor_BillRepository.GetList(dmodel);
}
/// <summary>
/// 修改备注
/// </summary>
......
......@@ -24,46 +24,60 @@ namespace Mall.Repository.Product
public List<RB_Goods_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Goods_Extend dmodel)
{
string where = $" 1=1 and g.{nameof(RB_Goods_Extend.Status)}=0";
if (dmodel.TenantId > 0) {
if (dmodel.TenantId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.TenantId)}={dmodel.TenantId}";
}
if (dmodel.NotTenantId > 0) {
if (dmodel.NotTenantId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.TenantId)}<>{dmodel.NotTenantId}";
}
if (dmodel.MallBaseId > 0) {
if (dmodel.MallBaseId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0) {
if (dmodel.Id > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.Id)}={dmodel.Id}";
}
if (!string.IsNullOrEmpty(dmodel.GoodsIds)) {
if (!string.IsNullOrEmpty(dmodel.GoodsIds))
{
where += $@" and g.{nameof(RB_Goods_Extend.Id)} in({dmodel.GoodsIds})";
}
if (!string.IsNullOrEmpty(dmodel.Name)) {
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and g.{nameof(RB_Goods_Extend.Name)} like '%{dmodel.Name}%'";
}
if (dmodel.GoodsStatus > 0) {
if (dmodel.GoodsStatus > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.GoodsStatus)}={dmodel.GoodsStatus}";
}
if (dmodel.IsSelectSellOut == 1) {
if (dmodel.IsSelectSellOut == 1)
{
where += $@" and g.{nameof(RB_Goods_Extend.InventoryNum)}<=0";
}
if (!string.IsNullOrEmpty(dmodel.CategoryIds)) {
if (!string.IsNullOrEmpty(dmodel.CategoryIds))
{
where += $@" and c.{nameof(RB_Goods_Category.CategoryId)} in({dmodel.CategoryIds})";
}
if (!string.IsNullOrEmpty(dmodel.StartTime)) {
if (!string.IsNullOrEmpty(dmodel.StartTime))
{
where += $@" and g.{nameof(RB_Goods_Extend.CreateDate)} >='{dmodel.StartTime}'";
}
if (!string.IsNullOrEmpty(dmodel.EndTime)) {
if (!string.IsNullOrEmpty(dmodel.EndTime))
{
where += $@" and g.{nameof(RB_Goods_Extend.CreateDate)} <='{dmodel.EndTime + " 23:59:59"}'";
}
if (dmodel.IsProcurement > 0) {
if (dmodel.IsProcurement > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.IsProcurement)}={dmodel.IsProcurement}";
}
if (dmodel.IsProxy > 0) {
if (dmodel.IsProxy > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.IsProxy)}={dmodel.IsProxy}";
}
if (dmodel.SupplierId > 0) {
if (dmodel.SupplierId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.SupplierId)}={dmodel.SupplierId}";
}
......@@ -155,6 +169,11 @@ where {where} group by g.Id order by {orderBy}";
{
where += $@" and c.{nameof(RB_Goods_Category.CategoryId)} in({dmodel.CategoryIds})";
}
if (!string.IsNullOrEmpty(dmodel.SupplierIds))
{
where += $@" and g.{nameof(RB_Goods_Extend.SupplierId)} in({dmodel.SupplierIds})";
}
if (!string.IsNullOrEmpty(dmodel.StartTime))
{
where += $@" and g.{nameof(RB_Goods_Extend.CreateDate)} >='{dmodel.StartTime}'";
......@@ -163,7 +182,10 @@ where {where} group by g.Id order by {orderBy}";
{
where += $@" and g.{nameof(RB_Goods_Extend.CreateDate)} <='{dmodel.EndTime + " 23:59:59"}'";
}
if (dmodel.SupplierId > 0)
{
where += $@" and g.{nameof(RB_Goods_Extend.SupplierId)}={dmodel.SupplierId}";
}
string sql = $@"
SELECT g.*,C.CategoryId
FROM RB_Goods g INNER JOIN rb_goods_category c on g.Id=c.GoodsId
......@@ -357,6 +379,10 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
{
where += $@" and g.{nameof(RB_Goods_Extend.Id)} in({dmodel.GoodsIds})";
}
if (!string.IsNullOrEmpty(dmodel.SupplierIds))
{
where += $@" and g.{nameof(RB_Goods_Extend.SupplierId)} in({dmodel.SupplierIds})";
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and g.{nameof(RB_Goods_Extend.Name)} like '%{dmodel.Name}%'";
......@@ -400,11 +426,13 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
//价格高-低
orderBy = $" order by g.{nameof(RB_Goods_Extend.SellingPrice)} desc";
}
else if (dmodel.OrderBy == 4) {
else if (dmodel.OrderBy == 4)
{
//销量高-低
orderBy = $" order by g.{nameof(RB_Goods_Extend.SalesNum)} desc";
}
if (dmodel.IsSelectVideo == 1) {
if (dmodel.IsSelectVideo == 1)
{
where += $@" and g.{nameof(RB_Goods_Extend.VideoAddress)} !=''";
}
if (dmodel.GoodsId > 0)
......
......@@ -43,7 +43,8 @@ namespace Mall.Repository.Product
{
where += $@" and oc.{nameof(RB_Goods_OrderIntroduction.OrderId)} in({dmodel.OrderIds})";
}
if (!string.IsNullOrEmpty(dmodel.IntroductionIds)) {
if (!string.IsNullOrEmpty(dmodel.IntroductionIds))
{
where += $@" and oc.{nameof(RB_Goods_OrderIntroduction.Id)} in({dmodel.IntroductionIds})";
}
......@@ -58,7 +59,7 @@ where {where} order by oc.Id asc";
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_OrderIntroduction_Extend> GetPageList(int pageIndex,int pageSize,out long count,RB_Goods_OrderIntroduction_Extend dmodel)
public List<RB_Goods_OrderIntroduction_Extend> GetPageList(int pageIndex, int pageSize, out long count, RB_Goods_OrderIntroduction_Extend dmodel)
{
string where = $" 1=1 and oa.ReOrderId is null";
if (dmodel.TenantId > 0)
......@@ -85,7 +86,8 @@ where {where} order by oc.Id asc";
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.SupplierId)}={dmodel.SupplierId}";
}
if (dmodel.RemitStatus > 0) {
if (dmodel.RemitStatus > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderIntroduction.RemitStatus)}={dmodel.RemitStatus}";
}
if (dmodel.CommissionState > 0)
......@@ -100,5 +102,126 @@ where {where} order by oc.Id asc";
return GetPage<RB_Goods_OrderIntroduction_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_OrderIntroduction_Extend> GetListByNormal(RB_Goods_OrderIntroduction_Extend dmodel)
{
string where = $" and oa.ReOrderId is null";
if (dmodel.TenantId > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderIntroduction.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderIntroduction.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.OrderId > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderIntroduction.OrderId)}={dmodel.OrderId}";
}
if (dmodel.UserId > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderIntroduction.UserId)}={dmodel.UserId}";
}
if (!string.IsNullOrEmpty(dmodel.OrderIds))
{
where += $@" and oc.{nameof(RB_Goods_OrderIntroduction.OrderId)} in({dmodel.OrderIds})";
}
if (!string.IsNullOrEmpty(dmodel.IntroductionIds))
{
where += $@" and oc.{nameof(RB_Goods_OrderIntroduction.Id)} in({dmodel.IntroductionIds})";
}
string sql = $@"SELECT oc.* FROM RB_Goods_OrderIntroduction oc
left join rb_goods_orderaftersale oa on oc.OrderDetailId= oa.OrderDetialId and oa.Type=1 and oa.Status=0 and oa.ReOrderStatus in (2,3,4,5)
LEFT JOIN rb_goods_order go on oc.OrderId=go.OrderId
where go.OrderStatus in(1,2,3,4,5,6) and go.`Status`=0 {where}";
return Get<RB_Goods_OrderIntroduction_Extend>(sql).ToList();
}
/// <summary>
/// 获取用户返佣
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Goods_OrderIntroduction_Extend> GetOrderIntroductionPageList(int pageIndex, int pageSize, out long count, RB_Goods_OrderIntroduction_Extend dmodel)
{
string where = $" 1=1 and o.Recycled=2 and oa.ReOrderId is null";
if (dmodel.TenantId > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderCommission.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderCommission.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.OrderId > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderCommission.OrderId)}={dmodel.OrderId}";
}
if (dmodel.Type > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderCommission.Type)}={dmodel.Type}";
}
if (dmodel.UserId > 0)
{
where += $@" and oc.{nameof(RB_Goods_OrderCommission.UserId)}={dmodel.UserId}";
}
if (!string.IsNullOrEmpty(dmodel.OrderIds))
{
where += $@" and oc.{nameof(RB_Goods_OrderCommission.OrderId)} in({dmodel.OrderIds})";
}
if (!string.IsNullOrEmpty(dmodel.OrderNo))
{
where += $@" and o.{nameof(RB_Goods_Order.OrderNo)}='{dmodel.OrderNo}'";
}
if (dmodel.SupplierId.HasValue && dmodel.SupplierId.Value > 0)
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.SupplierId)}={dmodel.SupplierId}";
}
if (!string.IsNullOrEmpty(dmodel.StartTime))
{
where += $@" and o.{nameof(RB_Goods.CreateDate)} >='{dmodel.StartTime}'";
}
if (!string.IsNullOrEmpty(dmodel.EndTime))
{
where += $@" and o.{nameof(RB_Goods.CreateDate)} <='{dmodel.EndTime + " 23:59:59"}'";
}
if (!string.IsNullOrEmpty(dmodel.GoodsName))
{
where += $@" and od.{nameof(RB_Goods_OrderDetail.GoodsName)}='{dmodel.GoodsName}'";
}
if (dmodel.CommissionState > 0)
{
switch (dmodel.CommissionState)
{
case 2: where += $@" and o.{nameof(RB_Goods_Order.OrderStatus)}={(int)OrderStatusEnum.Completed}"; break;
case 1: where += $@" and o.{nameof(RB_Goods_Order.OrderStatus)} in(2,3,4,6)"; break;
case 3: where += $@" and o.{nameof(RB_Goods_Order.OrderStatus)}=1 "; break;
}
}
else
{
where += $@" and o.{nameof(RB_Goods_Order.OrderStatus)} in(1,2,3,4,5,6)";
}
string sql = $@"SELECT GROUP_CONCAT(oc.OrderDetailId) as OrderDetailIds,oc.OrderId,oc.OrderDetailId,o.OrderNo,o.UserId,oc.CommissionRatio,oc.Type,oc.CommissionState,o.OrderStatus as DistrbutionOrderSelectStatus,SUM(oc.Commission) as Commission
FROM RB_Goods_OrderIntroduction oc
inner join rb_goods_order o on oc.OrderId = o.OrderId
INNER JOIN rb_goods_orderdetail as od on od.Id=oc.OrderDetailId
left join rb_goods_orderaftersale oa on oc.OrderDetailId= oa.OrderDetialId and oa.Type=1 and oa.Status=0 and oa.ReOrderStatus in (2,3,4,5)
where {where} group by oc.OrderId,o.OrderNo order by oc.OrderId desc";
return GetPage<RB_Goods_OrderIntroduction_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
}
}
......@@ -49,6 +49,14 @@ namespace Mall.Repository.User
where += $@" and {nameof(RB_Distributor_Bill.BillState)}={dmodel.BillState}";
}
if (dmodel.SelectBillState > 0)
{
where += $@" and {nameof(RB_Distributor_Bill.BillState)}={dmodel.SelectBillState}";
}
else if (dmodel.SelectBillState == -1)
{
where += $@" and {nameof(RB_Distributor_Bill.BillState)} in(1,2)";
}
string sql = $@"select * from RB_Distributor_Bill where {where} order by Id desc";
return GetPage<RB_Distributor_Bill_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
}
......
......@@ -61,6 +61,10 @@ namespace Mall.Repository.User
{
where += $@" and a.{nameof(RB_Supplier.ID)}={dmodel.ID}";
}
if (dmodel.Introducer > 0)
{
where += $@" and a.{nameof(RB_Supplier.Introducer)}={dmodel.Introducer}";
}
if (!string.IsNullOrEmpty(dmodel.SupplierIds))
{
where += $@" and a.{nameof(RB_Supplier.ID)} in({dmodel.SupplierIds})";
......
......@@ -995,8 +995,8 @@ namespace Mall.WebApi.Controllers.MallBase
x.ID,
x.FullMoneyPinkage,
x.FullNumPinkage,
x.CategoryList
x.CategoryList,
x.IsEnable
});
return ApiResult.Success("", pagelist);
}
......@@ -1058,7 +1058,7 @@ namespace Mall.WebApi.Controllers.MallBase
}
else
{
if ((query.FullMoneyPinkage ?? 0) <= 0 || (query.FullNumPinkage ?? 0) <= 0)
if (((query.FullMoneyPinkage ?? 0)+ (query.FullNumPinkage ?? 0)) <= 0)
{
return ApiResult.Failed("满减/满额不能同时为零");
}
......@@ -1124,6 +1124,34 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
/// <summary>
/// 保存是否启用
/// </summary>
/// <returns></returns>
public ApiResult AddOrUpdateIsEnable()
{
var parms = RequestParm;
JObject parmsJob = JObject.Parse(RequestParm.msg.ToString());
int Id = parmsJob.GetInt("Id", 0);
int IsFreeShipping = parmsJob.GetInt("IsEnable", 0);
if (Id <= 0)
{
return ApiResult.Failed("请传递参数");
}
bool flag = mallBaseModule.AddOrUpdateIsEnable(Id, IsFreeShipping);
if (flag)
{
return ApiResult.Success();
}
else
{
return ApiResult.Failed();
}
}
#endregion
}
}
\ No newline at end of file
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