Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
32ed971a
Commit
32ed971a
authored
Aug 03, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
e99585d7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
182 additions
and
6 deletions
+182
-6
RB_Miniprogram_Template_Extend.cs
.../Extend/MarketingCenter/RB_Miniprogram_Template_Extend.cs
+15
-0
RB_Goods_Category_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Category_Extend.cs
+10
-0
RB_Goods_Extend.cs
Mall.Model/Extend/Product/RB_Goods_Extend.cs
+6
-0
ProductModule.cs
Mall.Module.Product/ProductModule.cs
+112
-0
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+4
-3
RB_Goods_CategoryRepository.cs
Mall.Repository/Product/RB_Goods_CategoryRepository.cs
+4
-3
TenantController.cs
Mall.WebApi/Controllers/User/TenantController.cs
+31
-0
No files found.
Mall.Model/Extend/MarketingCenter/RB_Miniprogram_Template_Extend.cs
View file @
32ed971a
...
@@ -260,6 +260,21 @@ namespace Mall.Model.Extend.MarketingCenter
...
@@ -260,6 +260,21 @@ namespace Mall.Model.Extend.MarketingCenter
/// 轮播图
/// 轮播图
/// </summary>
/// </summary>
public
List
<
bannerDetailItem
>
banners
{
get
;
set
;
}
public
List
<
bannerDetailItem
>
banners
{
get
;
set
;
}
/// <summary>
/// 圆角
/// </summary>
public
string
radius
{
get
;
set
;
}
/// <summary>
/// 上下边距
/// </summary>
public
string
topAndBottom
{
get
;
set
;
}
/// <summary>
/// 左右边距
/// </summary>
public
string
leftAndRight
{
get
;
set
;
}
}
}
/// <summary>
/// <summary>
...
...
Mall.Model/Extend/Product/RB_Goods_Category_Extend.cs
View file @
32ed971a
...
@@ -25,5 +25,15 @@ namespace Mall.Model.Extend.Product
...
@@ -25,5 +25,15 @@ namespace Mall.Model.Extend.Product
/// 是否可以分享
/// 是否可以分享
/// </summary>
/// </summary>
public
int
?
IsForeignShare
{
get
;
set
;
}
public
int
?
IsForeignShare
{
get
;
set
;
}
/// <summary>
/// 父级分类编号
/// </summary>
public
int
ParentId
{
get
;
set
;
}
/// <summary>
/// 商品层级
/// </summary>
public
int
Tier
{
get
;
set
;
}
}
}
}
}
Mall.Model/Extend/Product/RB_Goods_Extend.cs
View file @
32ed971a
...
@@ -69,6 +69,12 @@ namespace Mall.Model.Extend.Product
...
@@ -69,6 +69,12 @@ namespace Mall.Model.Extend.Product
/// 分类ids
/// 分类ids
/// </summary>
/// </summary>
public
string
CategoryIds
{
get
;
set
;
}
public
string
CategoryIds
{
get
;
set
;
}
/// <summary>
/// 商品分类Id【HK0803新增】
/// </summary>
public
int
CategoryId
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 商品ids
/// 商品ids
/// </summary>
/// </summary>
...
...
Mall.Module.Product/ProductModule.cs
View file @
32ed971a
...
@@ -3336,6 +3336,118 @@ namespace Mall.Module.Product
...
@@ -3336,6 +3336,118 @@ namespace Mall.Module.Product
return
list
;
return
list
;
}
}
/// <summary>
/// 获取分类=>商品列表
/// </summary>
/// <param name="demodel">查询条件</param>
/// <returns></returns>
public
List
<
object
>
GetGoodsListModule
(
RB_Goods_Extend
demodel
)
{
List
<
object
>
resultList
=
new
List
<
object
>();
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
)
{
var
firstCategoryList
=
categoryList
.
Where
(
qitem
=>
qitem
.
Tier
==
1
).
ToList
();
foreach
(
var
firstItem
in
firstCategoryList
)
{
var
rootGoodsList
=
goodsList
.
Where
(
qitem
=>
qitem
.
CategoryId
==
firstItem
.
Id
).
ToList
();
var
secondCategoryList
=
categoryList
.
Where
(
qitem
=>
qitem
.
Tier
==
2
&&
qitem
.
ParentId
==
firstItem
.
Id
).
ToList
();
List
<
object
>
secondResultList
=
new
List
<
object
>();
foreach
(
var
secondItem
in
secondCategoryList
)
{
var
secondGoodList
=
goodsList
.
Where
(
qitem
=>
qitem
.
CategoryId
==
secondItem
.
Id
).
ToList
();
List
<
object
>
thirdResultList
=
new
List
<
object
>();
var
thirdCategoryList
=
categoryList
.
Where
(
qitem
=>
qitem
.
Tier
==
3
&&
qitem
.
ParentId
==
secondItem
.
Id
).
ToList
();
foreach
(
var
thirdItem
in
thirdCategoryList
)
{
var
thirdGoodList
=
goodsList
.
Where
(
qitem
=>
qitem
.
CategoryId
==
thirdItem
.
Id
).
ToList
();
thirdResultList
.
Add
(
new
{
PageId
=
thirdItem
.
Id
+
100000
,
PageName
=
thirdItem
.
Name
,
PageUrl
=
"/pages/cats/cats?cat_id="
+
thirdItem
.
Id
,
PageType
=
Common
.
Enum
.
MallBase
.
PageTypeEnum
.
DiyPage
,
IsParameter
=
0
,
TipText
=
""
,
SelfPageName
=
thirdItem
.
Name
,
ParameterValue
=
""
,
SubMenuList
=
thirdGoodList
.
Select
(
qitem
=>
new
{
PageId
=
qitem
.
Id
+
100000
,
PageName
=
qitem
.
Name
,
PageUrl
=
"/pages/goods/goods?id="
+
qitem
.
Id
,
PageType
=
Common
.
Enum
.
MallBase
.
PageTypeEnum
.
DiyPage
,
IsParameter
=
0
,
TipText
=
""
,
SelfPageName
=
qitem
.
Name
,
ParameterValue
=
""
,
})
});
}
if
(
secondGoodList
!=
null
&&
secondGoodList
.
Count
>
0
)
{
thirdResultList
.
AddRange
(
secondGoodList
.
Select
(
qitem
=>
new
{
PageId
=
qitem
.
Id
+
100000
,
PageName
=
qitem
.
Name
,
PageUrl
=
"/pages/goods/goods?id="
+
qitem
.
Id
,
PageType
=
Common
.
Enum
.
MallBase
.
PageTypeEnum
.
DiyPage
,
IsParameter
=
0
,
TipText
=
""
,
SelfPageName
=
qitem
.
Name
,
ParameterValue
=
""
,
}));
}
secondResultList
.
Add
(
new
{
PageId
=
secondItem
.
Id
+
100000
,
PageName
=
secondItem
.
Name
,
PageUrl
=
"/pages/cats/cats?cat_id="
+
secondItem
.
Id
,
PageType
=
Common
.
Enum
.
MallBase
.
PageTypeEnum
.
DiyPage
,
IsParameter
=
0
,
TipText
=
""
,
SelfPageName
=
secondItem
.
Name
,
ParameterValue
=
""
,
SubMenuList
=
thirdResultList
,
});
}
if
(
rootGoodsList
!=
null
&&
rootGoodsList
.
Count
>
0
)
{
secondResultList
.
AddRange
(
rootGoodsList
.
Select
(
qitem
=>
new
{
PageId
=
qitem
.
Id
+
100000
,
PageName
=
qitem
.
Name
,
PageUrl
=
"/pages/goods/goods?id="
+
qitem
.
Id
,
PageType
=
Common
.
Enum
.
MallBase
.
PageTypeEnum
.
DiyPage
,
IsParameter
=
0
,
TipText
=
""
,
SelfPageName
=
qitem
.
Name
,
ParameterValue
=
""
,
}));
}
resultList
.
Add
(
new
{
PageId
=
firstItem
.
Id
+
100000
,
PageName
=
firstItem
.
Name
,
PageUrl
=
"/pages/cats/cats?cat_id="
+
firstItem
.
Id
,
PageType
=
Common
.
Enum
.
MallBase
.
PageTypeEnum
.
DiyPage
,
IsParameter
=
0
,
TipText
=
""
,
SelfPageName
=
firstItem
.
Name
,
ParameterValue
=
""
,
SubMenuList
=
secondResultList
,
});
}
}
return
resultList
;
}
/// <summary>
/// <summary>
/// 首页查询使用
/// 首页查询使用
/// </summary>
/// </summary>
...
...
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
32ed971a
...
@@ -164,9 +164,10 @@ where {where} group by g.Id order by {orderBy}";
...
@@ -164,9 +164,10 @@ where {where} group by g.Id order by {orderBy}";
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
CreateDate
)}
<='
{
dmodel
.
EndTime
+
" 23:59:59"
}
'"
;
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
CreateDate
)}
<='
{
dmodel
.
EndTime
+
" 23:59:59"
}
'"
;
}
}
string
sql
=
$@"select g.* from RB_Goods g
string
sql
=
$@"
inner join rb_goods_category c on g.Id=c.GoodsId
SELECT g.*,C.CategoryId
where
{
where
}
group by g.Id order by g.CreateDate desc"
;
FROM RB_Goods g INNER JOIN rb_goods_category c on g.Id=c.GoodsId
WHERE
{
where
}
group by g.Id order by g.CreateDate desc"
;
return
Get
<
RB_Goods_Extend
>(
sql
).
ToList
();
return
Get
<
RB_Goods_Extend
>(
sql
).
ToList
();
}
}
...
...
Mall.Repository/Product/RB_Goods_CategoryRepository.cs
View file @
32ed971a
...
@@ -37,9 +37,10 @@ namespace Mall.Repository.Product
...
@@ -37,9 +37,10 @@ namespace Mall.Repository.Product
where
+=
$@" and gc.
{
nameof
(
RB_Goods_Category
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
where
+=
$@" and gc.
{
nameof
(
RB_Goods_Category
.
GoodsId
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
}
string
sql
=
$@"select gc.*,pc.Name as CategoryName,pc.IsForeignShare from RB_Goods_Category gc
string
sql
=
$@"
inner join rb_product_category pc on gc.CategoryId=pc.Id
SELECT gc.*,pc.Name as CategoryName,pc.IsForeignShare,pc.ParentId,pc.Tier
where
{
where
}
order by gc.Id desc"
;
FROM RB_Goods_Category gc inner join rb_product_category pc on gc.CategoryId=pc.Id
WHERE
{
where
}
ORDER BY gc.Id DESC "
;
return
Get
<
RB_Goods_Category_Extend
>(
sql
).
ToList
();
return
Get
<
RB_Goods_Category_Extend
>(
sql
).
ToList
();
}
}
}
}
...
...
Mall.WebApi/Controllers/User/TenantController.cs
View file @
32ed971a
...
@@ -1242,6 +1242,9 @@ namespace Mall.WebApi.Controllers.User
...
@@ -1242,6 +1242,9 @@ namespace Mall.WebApi.Controllers.User
/// <returns></returns>
/// <returns></returns>
public
ApiResult
GetMiniprogramPageListExt
()
public
ApiResult
GetMiniprogramPageListExt
()
{
{
JObject
parms
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
//是否隐藏商品【1-隐藏】
int
IsHiddenGoods
=
parms
.
GetInt
(
"IsHiddenGoods"
);
List
<
object
>
resultList
=
new
List
<
object
>();
List
<
object
>
resultList
=
new
List
<
object
>();
var
pageList
=
programPageModule
.
GetMiniprogram_Page_ListExtModule
(
new
RB_MiniProgram_Page_Extend
()
{
MallBaseId
=
RequestParm
.
MallBaseId
});
var
pageList
=
programPageModule
.
GetMiniprogram_Page_ListExtModule
(
new
RB_MiniProgram_Page_Extend
()
{
MallBaseId
=
RequestParm
.
MallBaseId
});
var
pageTypeList
=
Common
.
Plugin
.
EnumHelper
.
EnumToList
(
typeof
(
PageTypeEnum
));
var
pageTypeList
=
Common
.
Plugin
.
EnumHelper
.
EnumToList
(
typeof
(
PageTypeEnum
));
...
@@ -1266,6 +1269,34 @@ namespace Mall.WebApi.Controllers.User
...
@@ -1266,6 +1269,34 @@ namespace Mall.WebApi.Controllers.User
.
ToList
()
.
ToList
()
});
});
}
}
int
MallBaseId
=
-
1
;
if
(
UserInfo
.
MallBaseId
>
0
)
{
MallBaseId
=
UserInfo
.
MallBaseId
;
}
if
(
MallBaseId
==
-
1
)
{
if
(
RequestParm
.
MallBaseId
>
0
)
{
MallBaseId
=
RequestParm
.
MallBaseId
;
}
}
if
(
IsHiddenGoods
==
0
)
{
var
categoryList
=
productModule
.
GetGoodsListModule
(
new
Model
.
Extend
.
Product
.
RB_Goods_Extend
()
{
TenantId
=
RequestParm
.
TenantId
,
MallBaseId
=
MallBaseId
,
GoodsStatus
=
1
,
});
//新增商品选项卡
resultList
.
Add
(
new
{
PageTypeName
=
"商品"
,
PageTypeId
=
6
,
SubMenuList
=
categoryList
});
}
return
ApiResult
.
Success
(
data
:
resultList
);
return
ApiResult
.
Success
(
data
:
resultList
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment