Commit 59284fab authored by 吴春's avatar 吴春

提交代码

parent 61f9edff
...@@ -104,6 +104,8 @@ namespace Mall.Common.API ...@@ -104,6 +104,8 @@ namespace Mall.Common.API
/// 微店id /// 微店id
/// </summary> /// </summary>
public int SmallShopsId { get; set; } public int SmallShopsId { get; set; }
public int open_school { get; set; }
/// <summary> /// <summary>
/// token信息 /// token信息
/// </summary> /// </summary>
......
...@@ -324,6 +324,17 @@ where {where} group by g.Id order by {orderBy}"; ...@@ -324,6 +324,17 @@ where {where} group by g.Id order by {orderBy}";
{ {
where += $@" and g.{nameof(RB_Goods_Extend.SupplierId)}={dmodel.SupplierId}"; where += $@" and g.{nameof(RB_Goods_Extend.SupplierId)}={dmodel.SupplierId}";
} }
if (dmodel.GoodsPageType.HasValue)
{
if (dmodel.GoodsPageType == Common.Enum.Goods.GoodsPageTypeEnum.Mall)
{
where += $@" and g.{nameof(RB_Goods_Extend.GoodsPageType)} in(0,1)";
}
else if (dmodel.GoodsPageType == Common.Enum.Goods.GoodsPageTypeEnum.School)
{
where += $@" and g.{nameof(RB_Goods_Extend.GoodsPageType)} in(0,2)";
}
}
string sql = $@" string sql = $@"
SELECT g.*,C.CategoryId SELECT g.*,C.CategoryId
FROM RB_Goods g INNER JOIN rb_goods_category c on g.Id=c.GoodsId FROM RB_Goods g INNER JOIN rb_goods_category c on g.Id=c.GoodsId
......
...@@ -169,7 +169,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -169,7 +169,7 @@ namespace Mall.WebApi.Controllers.MallBase
{ {
foreach (var subItem in templateModel.ComponentDataList) foreach (var subItem in templateModel.ComponentDataList)
{ {
templateData.data.Add(MallHelper.PlusDataToObject(subItem, (miniProgram?.TenantId ?? 0), miniProgram.MallBaseId, RequestParm.SmallShopsId)); templateData.data.Add(MallHelper.PlusDataToObject(subItem, (miniProgram?.TenantId ?? 0), miniProgram.MallBaseId, RequestParm.SmallShopsId, isOpenSchool));
} }
} }
var tempObj = new var tempObj = new
...@@ -242,7 +242,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -242,7 +242,7 @@ namespace Mall.WebApi.Controllers.MallBase
{ {
foreach (var subItem in templateModel.ComponentDataList) foreach (var subItem in templateModel.ComponentDataList)
{ {
templateData.data.Add(MallHelper.PlusDataToObject(subItem, (miniProgram?.TenantId ?? 0), miniProgram.MallBaseId, RequestParm.SmallShopsId)); templateData.data.Add(MallHelper.PlusDataToObject(subItem, (miniProgram?.TenantId ?? 0), miniProgram.MallBaseId, RequestParm.SmallShopsId, isOpenSchool));
} }
} }
var tempObj = new var tempObj = new
...@@ -272,7 +272,7 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -272,7 +272,7 @@ namespace Mall.WebApi.Controllers.MallBase
//配置了首页 //配置了首页
if (miniProgram.HomeDataList != null && miniProgram.HomeDataList.Count > 0) if (miniProgram.HomeDataList != null && miniProgram.HomeDataList.Count > 0)
{ {
var tempObj = MallHelper.DefaultHomepage(miniProgram); var tempObj = MallHelper.DefaultHomepage(miniProgram, isOpenSchool);
list.Add(tempObj); list.Add(tempObj);
homePage = new homePage = new
{ {
......
...@@ -83,7 +83,7 @@ namespace Mall.WebApi.Controllers ...@@ -83,7 +83,7 @@ namespace Mall.WebApi.Controllers
/// </summary> /// </summary>
/// <param name="item"></param> /// <param name="item"></param>
/// <returns></returns> /// <returns></returns>
public static object PlusDataToObject(ComponentItem subItem, int TenantId, int MallBaseId, int SmallShopsId) public static object PlusDataToObject(ComponentItem subItem, int TenantId, int MallBaseId, int SmallShopsId,int IsOpenSchool)
{ {
var obj = new object(); var obj = new object();
switch (subItem.Id) switch (subItem.Id)
...@@ -196,7 +196,8 @@ namespace Mall.WebApi.Controllers ...@@ -196,7 +196,8 @@ namespace Mall.WebApi.Controllers
TenantId = TenantId, TenantId = TenantId,
MallBaseId = MallBaseId, MallBaseId = MallBaseId,
GoodsIds = Ids, GoodsIds = Ids,
GoodsStatus = 1 GoodsStatus = 1,
GoodsPageType = IsOpenSchool == 1 ? Common.Enum.Goods.GoodsPageTypeEnum.School : Common.Enum.Goods.GoodsPageTypeEnum.Mall
}, SmallShopsId: SmallShopsId); }, SmallShopsId: SmallShopsId);
List<GoodsDetailsItem2> newGoodsList = new List<GoodsDetailsItem2>(); List<GoodsDetailsItem2> newGoodsList = new List<GoodsDetailsItem2>();
...@@ -226,7 +227,8 @@ namespace Mall.WebApi.Controllers ...@@ -226,7 +227,8 @@ namespace Mall.WebApi.Controllers
TenantId = TenantId, TenantId = TenantId,
MallBaseId = MallBaseId, MallBaseId = MallBaseId,
CategoryIds = childItem.id.ToString(), CategoryIds = childItem.id.ToString(),
GoodsStatus = 1 GoodsStatus = 1,
GoodsPageType= IsOpenSchool==1?Common.Enum.Goods.GoodsPageTypeEnum.School:Common.Enum.Goods.GoodsPageTypeEnum.Mall
},SmallShopsId:SmallShopsId); },SmallShopsId:SmallShopsId);
if (catGoodsList != null && catGoodsList.Count > 0) if (catGoodsList != null && catGoodsList.Count > 0)
{ {
...@@ -257,7 +259,8 @@ namespace Mall.WebApi.Controllers ...@@ -257,7 +259,8 @@ namespace Mall.WebApi.Controllers
{ {
TenantId = TenantId, TenantId = TenantId,
MallBaseId = MallBaseId, MallBaseId = MallBaseId,
GoodsStatus = 1 GoodsStatus = 1,
GoodsPageType = IsOpenSchool == 1 ? Common.Enum.Goods.GoodsPageTypeEnum.School : Common.Enum.Goods.GoodsPageTypeEnum.Mall
}); });
#region 微店价格 #region 微店价格
RB_SmallShops_Info_Extend smallModel = new RB_SmallShops_Info_Extend(); RB_SmallShops_Info_Extend smallModel = new RB_SmallShops_Info_Extend();
...@@ -377,7 +380,8 @@ namespace Mall.WebApi.Controllers ...@@ -377,7 +380,8 @@ namespace Mall.WebApi.Controllers
TenantId = TenantId, TenantId = TenantId,
MallBaseId = MallBaseId, MallBaseId = MallBaseId,
GoodsIds = Ids, GoodsIds = Ids,
GoodsStatus = 1 GoodsStatus = 1,
GoodsPageType = IsOpenSchool == 1 ? Common.Enum.Goods.GoodsPageTypeEnum.School : Common.Enum.Goods.GoodsPageTypeEnum.Mall
}); });
#region 微店价格 #region 微店价格
RB_SmallShops_Info_Extend smallModel = new RB_SmallShops_Info_Extend(); RB_SmallShops_Info_Extend smallModel = new RB_SmallShops_Info_Extend();
...@@ -730,7 +734,7 @@ namespace Mall.WebApi.Controllers ...@@ -730,7 +734,7 @@ namespace Mall.WebApi.Controllers
/// </summary> /// </summary>
/// <param name="miniProgram"></param> /// <param name="miniProgram"></param>
/// <returns></returns> /// <returns></returns>
public static object DefaultHomepage(RB_MiniProgram_Extend miniProgram) public static object DefaultHomepage(RB_MiniProgram_Extend miniProgram,int IsOpenSchool)
{ {
var templateData = new var templateData = new
{ {
...@@ -976,6 +980,7 @@ namespace Mall.WebApi.Controllers ...@@ -976,6 +980,7 @@ namespace Mall.WebApi.Controllers
TenantId = Convert.ToInt32(miniProgram.TenantId), TenantId = Convert.ToInt32(miniProgram.TenantId),
MallBaseId = miniProgram.MallBaseId, MallBaseId = miniProgram.MallBaseId,
GoodsStatus = 1, GoodsStatus = 1,
GoodsPageType = IsOpenSchool == 1 ? Common.Enum.Goods.GoodsPageTypeEnum.School : Common.Enum.Goods.GoodsPageTypeEnum.Mall
}); });
if (goodsList != null && goodsList.Count > 0) if (goodsList != null && goodsList.Count > 0)
{ {
...@@ -1000,6 +1005,7 @@ namespace Mall.WebApi.Controllers ...@@ -1000,6 +1005,7 @@ namespace Mall.WebApi.Controllers
MallBaseId = miniProgram.MallBaseId, MallBaseId = miniProgram.MallBaseId,
CategoryIds = subitem.relation_id.ToString(), CategoryIds = subitem.relation_id.ToString(),
GoodsStatus = 1, GoodsStatus = 1,
GoodsPageType = IsOpenSchool == 1 ? Common.Enum.Goods.GoodsPageTypeEnum.School : Common.Enum.Goods.GoodsPageTypeEnum.Mall
}); });
if (goodsList != null && goodsList.Count > 0) if (goodsList != null && goodsList.Count > 0)
{ {
......
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