Commit cb811e3a authored by 黄奎's avatar 黄奎

新增查询

parent 26709c8b
......@@ -349,5 +349,10 @@ namespace Mall.Model.Extend.Product
return Common.ConvertHelper.ConvertToListInt(this.StoresIds);
}
}
/// <summary>
/// 门店名称
/// </summary>
public List<string> StoreNameList { get; set; }
}
}
......@@ -33,5 +33,10 @@ namespace Mall.Model.Entity.User
/// 距离公里数
/// </summary>
public decimal KM { get; set; }
/// <summary>
/// 查询门店编号
/// </summary>
public string QIds { get; set; }
}
}
......@@ -208,6 +208,11 @@ namespace Mall.Module.Product
/// </summary>
private readonly RB_Member_IntegralRepository member_IntegralRepository = new RB_Member_IntegralRepository();
/// <summary>
/// 门店仓储层对象
/// </summary>
private readonly RB_StoresRepository storesRepository = new RB_StoresRepository();
/// <summary>
/// 获取会员等级列表
......@@ -250,9 +255,16 @@ namespace Mall.Module.Product
string ids = string.Join(",", list.Select(x => x.Id));
var clist = goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { GoodsIds = ids, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
var olist = goods_OrderRepository.GetGoodsOrderNum(ids);
var storesIds = string.Join(",", list.Where(qitem => !string.IsNullOrWhiteSpace(qitem.StoresIds)).Select(qitem => qitem.StoresIds));
List<RB_Stores_Extend> storeList = new List<RB_Stores_Extend>();
if (!string.IsNullOrWhiteSpace(storesIds))
{
storeList = storesRepository.GetStoresListRepository(new RB_Stores_Extend() { QIds = storesIds });
}
foreach (var item in list)
{
item.StoreNameList = new List<string>();
item.CategoryList = clist.Where(x => x.GoodsId == item.Id).ToList();
//轮播图
item.CoverImage = "";
......@@ -274,6 +286,24 @@ namespace Mall.Module.Product
}
}
item.GoodsBuyNum = olist.Where(x => x.GoodsId == item.Id).FirstOrDefault()?.OrderNum ?? 0;
if (!string.IsNullOrEmpty(item.StoresIds))
{
List<int> storesResultList = Common.ConvertHelper.ConvertToListInt(item.StoresIds);
if (storesResultList != null && storesResultList.Count > 0)
{
foreach (var sItem in storesResultList)
{
string storeName = storeList?.Where(qitem => qitem.Id == sItem)?.FirstOrDefault()?.Name ?? "";
if (!string.IsNullOrEmpty(storeName))
{
item.StoreNameList.Add(storeName);
}
}
}
}
}
}
return list;
......@@ -828,7 +858,7 @@ namespace Mall.Module.Product
var pupmodel = demodel.DistributionCommissionList.Where(x => x.SpecificationSort == item.SpecificationSort && x.DistributorGrade == item.DistributorGrade).FirstOrDefault();
if (item.OneCommission != pupmodel.OneCommission || item.TwoCommission != pupmodel.TwoCommission || item.ThreeCommission != pupmodel.ThreeCommission)
{
Dictionary<string, object> keyValues1 = new Dictionary<string, object>()
Dictionary<string, object> keyValues1 = new Dictionary<string, object>()
{
{ nameof(RB_Goods_DistributionCommission.OneCommission),pupmodel.OneCommission},
{ nameof(RB_Goods_DistributionCommission.TwoCommission),pupmodel.TwoCommission},
......@@ -875,7 +905,7 @@ namespace Mall.Module.Product
var pupmodel = demodel.MemberPriceList.Where(x => x.SpecificationSort == item.SpecificationSort && x.MemberGrade == item.MemberGrade).FirstOrDefault();
if (item.MemberPrice != pupmodel.MemberPrice)
{
Dictionary<string, object> keyValues1 = new Dictionary<string, object>()
Dictionary<string, object> keyValues1 = new Dictionary<string, object>()
{
{ nameof(RB_Goods_MemberPrice.MemberPrice),pupmodel.MemberPrice}
};
......@@ -943,8 +973,6 @@ namespace Mall.Module.Product
});
}
}
//插入分销佣金
if (demodel.SeparateDistribution == 1)
{
......
......@@ -4,6 +4,7 @@ using System.Text;
using Mall.Model.Entity.User;
using Mall.Model.Extend.User;
using System.Linq;
using Mall.Model.Extend.MarketingCenter;
namespace Mall.Repository.User
{
......@@ -137,6 +138,10 @@ WHERE 1 = 1 AND Status = 0 ");
{
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Stores_Extend.Id), query.Id);
}
if (!string.IsNullOrEmpty(query.QIds))
{
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Stores_Extend.Id), query.QIds);
}
if (query.Name != null && !string.IsNullOrEmpty(query.Name.Trim()))
{
builder.AppendFormat(" AND {0} LIKE '%{1}%' ", nameof(RB_Stores_Extend.Name), query.Name.Trim());
......
......@@ -68,7 +68,10 @@ namespace Mall.WebApi.Controllers.Reserve
x.GoodsStatus,
x.TenantId,
x.MallBaseId,
CreateDate = x.CreateDate.HasValue ? x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : ""
CreateDate = x.CreateDate.HasValue ? x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
x.DepositMoney,
x.IsChooseServicePerson,
x.StoreNameList
});
return ApiResult.Success("", pagelist);
}
......
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