feat 添加商品详情页的店铺信息接口
This commit is contained in:
parent
cee6867ac7
commit
ab710a6f6e
@ -20,10 +20,17 @@ namespace ARW.Model.Dto.Api.GoodsManager.Goodss
|
|||||||
/// 店铺经营类目
|
/// 店铺经营类目
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long? GoodsCategoryGuid { get; set; }
|
public long? GoodsCategoryGuid { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 店铺商品类目
|
||||||
|
/// </summary>
|
||||||
|
public long? ShopGoodsCategoryGuid { get; set; }
|
||||||
public string GoodsName { get; set; }
|
public string GoodsName { get; set; }
|
||||||
public string GoodsCoding { get; set; }
|
public string GoodsCoding { get; set; }
|
||||||
public int GoodsSort { get; set; }
|
public int GoodsSort { get; set; }
|
||||||
public int GoodsSortType { get; set; }
|
public int GoodsSortType { get; set; }
|
||||||
|
public decimal MinPrice { get; set;}
|
||||||
|
public decimal MaxPrice { get; set;}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -129,6 +129,25 @@ namespace ARW.Model.Vo.Api.GoodsManager.Goodss
|
|||||||
[JsonConverter(typeof(ValueToStringConverter))]
|
[JsonConverter(typeof(ValueToStringConverter))]
|
||||||
public long CategoryIds { get; set; }
|
public long CategoryIds { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :店铺Logo
|
||||||
|
/// </summary>
|
||||||
|
public string ShopLogo { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :店铺名称
|
||||||
|
/// </summary>
|
||||||
|
public string ShopName { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :店铺销售单量
|
||||||
|
/// </summary>
|
||||||
|
public int ShopSalesOrderCount { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :店铺简介
|
||||||
|
/// </summary>
|
||||||
|
public string ShopIntro { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 描述 :商品名称
|
/// 描述 :商品名称
|
||||||
|
@ -63,7 +63,7 @@ namespace ARW.Service.Api.BusinessService.GoodsManager.Goodss
|
|||||||
{
|
{
|
||||||
//开始拼装查询条件
|
//开始拼装查询条件
|
||||||
var predicate = Expressionable.Create<Goods>();
|
var predicate = Expressionable.Create<Goods>();
|
||||||
string[] goodsCategoryArr = null;
|
//string[] goodsCategoryArr = null;
|
||||||
|
|
||||||
// 检索经营类目
|
// 检索经营类目
|
||||||
//if (parm.GoodsCategoryGuid != null)
|
//if (parm.GoodsCategoryGuid != null)
|
||||||
@ -79,9 +79,11 @@ namespace ARW.Service.Api.BusinessService.GoodsManager.Goodss
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
predicate = predicate.AndIF(parm.ShopGuid != null, s => s.ShopGuid == parm.ShopGuid);
|
predicate = predicate.AndIF(parm.ShopGuid != null, s => s.ShopGuid == parm.ShopGuid);
|
||||||
//predicate = predicate.AndIF(parm.GoodsCategoryGuid != null, s => s.GoodsCategoryGuid == parm.GoodsCategoryGuid);
|
predicate = predicate.AndIF(parm.ShopGoodsCategoryGuid != null, s => s.ShopGoodsCategoryGuid == parm.ShopGoodsCategoryGuid);
|
||||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.GoodsName), s => s.GoodsName.Contains(parm.GoodsName));
|
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.GoodsName), s => s.GoodsName.Contains(parm.GoodsName));
|
||||||
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.GoodsCoding), s => s.GoodsCoding.Contains(parm.GoodsCoding));
|
predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.GoodsCoding), s => s.GoodsCoding.Contains(parm.GoodsCoding));
|
||||||
|
predicate = predicate.AndIF(parm.MinPrice != 0, s => s.GoodsPriceLowest >= parm.MinPrice);
|
||||||
|
predicate = predicate.AndIF(parm.MaxPrice != 0, s => s.GoodsPriceLowest <= parm.MaxPrice);
|
||||||
|
|
||||||
var sortType = OrderByType.Asc;
|
var sortType = OrderByType.Asc;
|
||||||
if(parm.GoodsSortType == 1) sortType = OrderByType.Desc;
|
if(parm.GoodsSortType == 1) sortType = OrderByType.Desc;
|
||||||
@ -95,6 +97,7 @@ namespace ARW.Service.Api.BusinessService.GoodsManager.Goodss
|
|||||||
.Where(s => s.GoodsShelfStatus == 1)
|
.Where(s => s.GoodsShelfStatus == 1)
|
||||||
.OrderByIF(parm.GoodsSort == 0 , s => s.GoodsSort, OrderByType.Asc)
|
.OrderByIF(parm.GoodsSort == 0 , s => s.GoodsSort, OrderByType.Asc)
|
||||||
.OrderByIF(parm.GoodsSort == 1 , s => s.GoodsPriceLowest, sortType)
|
.OrderByIF(parm.GoodsSort == 1 , s => s.GoodsPriceLowest, sortType)
|
||||||
|
.OrderByIF(parm.GoodsSort == 2 , s => s.GoodsSalesInitial + s.GoodsSalesActual, sortType)
|
||||||
//.OrderBy(s => s.GoodsSort, OrderByType.Desc)
|
//.OrderBy(s => s.GoodsSort, OrderByType.Desc)
|
||||||
.Select((s, c) => new GoodsVoApi
|
.Select((s, c) => new GoodsVoApi
|
||||||
{
|
{
|
||||||
@ -128,11 +131,16 @@ namespace ARW.Service.Api.BusinessService.GoodsManager.Goodss
|
|||||||
|
|
||||||
var query = _GoodsRepository
|
var query = _GoodsRepository
|
||||||
.Queryable()
|
.Queryable()
|
||||||
|
.LeftJoin<Shop>((s, c) => s.ShopGuid == c.ShopGuid)
|
||||||
.Where(s => s.GoodsGuid == parm.SpuId)
|
.Where(s => s.GoodsGuid == parm.SpuId)
|
||||||
.Select(s => new GoodsApiDetailsVo
|
.Select((s,c) => new GoodsApiDetailsVo
|
||||||
{
|
{
|
||||||
SpuId = s.GoodsGuid,
|
SpuId = s.GoodsGuid,
|
||||||
ShopGuid = s.ShopGuid,
|
ShopGuid = s.ShopGuid,
|
||||||
|
ShopLogo = c.ShopLogo,
|
||||||
|
ShopName = c.ShopName,
|
||||||
|
ShopSalesOrderCount = c.ShopSalesOrderCount,
|
||||||
|
ShopIntro = c.ShopIntro,
|
||||||
CategoryIds = s.ShopGoodsCategoryGuid,
|
CategoryIds = s.ShopGoodsCategoryGuid,
|
||||||
Title = s.GoodsName,
|
Title = s.GoodsName,
|
||||||
GoodsCoding = s.GoodsCoding,
|
GoodsCoding = s.GoodsCoding,
|
||||||
|
Loading…
Reference in New Issue
Block a user