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
59284fab
Commit
59284fab
authored
Sep 25, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
61f9edff
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
9 deletions
+28
-9
RequestParm.cs
Mall.Common/API/RequestParm.cs
+2
-0
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+11
-0
MallController.cs
Mall.WebApi/Controllers/Mall/MallController.cs
+3
-3
MallHelper.cs
Mall.WebApi/Controllers/Mall/MallHelper.cs
+12
-6
No files found.
Mall.Common/API/RequestParm.cs
View file @
59284fab
...
...
@@ -104,6 +104,8 @@ namespace Mall.Common.API
/// 微店id
/// </summary>
public
int
SmallShopsId
{
get
;
set
;
}
public
int
open_school
{
get
;
set
;
}
/// <summary>
/// token信息
/// </summary>
...
...
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
59284fab
...
...
@@ -324,6 +324,17 @@ where {where} group by g.Id order by {orderBy}";
{
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
=
$@"
SELECT g.*,C.CategoryId
FROM RB_Goods g INNER JOIN rb_goods_category c on g.Id=c.GoodsId
...
...
Mall.WebApi/Controllers/Mall/MallController.cs
View file @
59284fab
...
...
@@ -169,7 +169,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
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
...
...
@@ -242,7 +242,7 @@ namespace Mall.WebApi.Controllers.MallBase
{
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
...
...
@@ -272,7 +272,7 @@ namespace Mall.WebApi.Controllers.MallBase
//配置了首页
if
(
miniProgram
.
HomeDataList
!=
null
&&
miniProgram
.
HomeDataList
.
Count
>
0
)
{
var
tempObj
=
MallHelper
.
DefaultHomepage
(
miniProgram
);
var
tempObj
=
MallHelper
.
DefaultHomepage
(
miniProgram
,
isOpenSchool
);
list
.
Add
(
tempObj
);
homePage
=
new
{
...
...
Mall.WebApi/Controllers/Mall/MallHelper.cs
View file @
59284fab
...
...
@@ -83,7 +83,7 @@ namespace Mall.WebApi.Controllers
/// </summary>
/// <param name="item"></param>
/// <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
();
switch
(
subItem
.
Id
)
...
...
@@ -196,7 +196,8 @@ namespace Mall.WebApi.Controllers
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
GoodsIds
=
Ids
,
GoodsStatus
=
1
GoodsStatus
=
1
,
GoodsPageType
=
IsOpenSchool
==
1
?
Common
.
Enum
.
Goods
.
GoodsPageTypeEnum
.
School
:
Common
.
Enum
.
Goods
.
GoodsPageTypeEnum
.
Mall
},
SmallShopsId
:
SmallShopsId
);
List
<
GoodsDetailsItem2
>
newGoodsList
=
new
List
<
GoodsDetailsItem2
>();
...
...
@@ -226,7 +227,8 @@ namespace Mall.WebApi.Controllers
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
CategoryIds
=
childItem
.
id
.
ToString
(),
GoodsStatus
=
1
GoodsStatus
=
1
,
GoodsPageType
=
IsOpenSchool
==
1
?
Common
.
Enum
.
Goods
.
GoodsPageTypeEnum
.
School
:
Common
.
Enum
.
Goods
.
GoodsPageTypeEnum
.
Mall
},
SmallShopsId
:
SmallShopsId
);
if
(
catGoodsList
!=
null
&&
catGoodsList
.
Count
>
0
)
{
...
...
@@ -257,7 +259,8 @@ namespace Mall.WebApi.Controllers
{
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
GoodsStatus
=
1
GoodsStatus
=
1
,
GoodsPageType
=
IsOpenSchool
==
1
?
Common
.
Enum
.
Goods
.
GoodsPageTypeEnum
.
School
:
Common
.
Enum
.
Goods
.
GoodsPageTypeEnum
.
Mall
});
#
region
微店价格
RB_SmallShops_Info_Extend
smallModel
=
new
RB_SmallShops_Info_Extend
();
...
...
@@ -377,7 +380,8 @@ namespace Mall.WebApi.Controllers
TenantId
=
TenantId
,
MallBaseId
=
MallBaseId
,
GoodsIds
=
Ids
,
GoodsStatus
=
1
GoodsStatus
=
1
,
GoodsPageType
=
IsOpenSchool
==
1
?
Common
.
Enum
.
Goods
.
GoodsPageTypeEnum
.
School
:
Common
.
Enum
.
Goods
.
GoodsPageTypeEnum
.
Mall
});
#
region
微店价格
RB_SmallShops_Info_Extend
smallModel
=
new
RB_SmallShops_Info_Extend
();
...
...
@@ -730,7 +734,7 @@ namespace Mall.WebApi.Controllers
/// </summary>
/// <param name="miniProgram"></param>
/// <returns></returns>
public
static
object
DefaultHomepage
(
RB_MiniProgram_Extend
miniProgram
)
public
static
object
DefaultHomepage
(
RB_MiniProgram_Extend
miniProgram
,
int
IsOpenSchool
)
{
var
templateData
=
new
{
...
...
@@ -976,6 +980,7 @@ namespace Mall.WebApi.Controllers
TenantId
=
Convert
.
ToInt32
(
miniProgram
.
TenantId
),
MallBaseId
=
miniProgram
.
MallBaseId
,
GoodsStatus
=
1
,
GoodsPageType
=
IsOpenSchool
==
1
?
Common
.
Enum
.
Goods
.
GoodsPageTypeEnum
.
School
:
Common
.
Enum
.
Goods
.
GoodsPageTypeEnum
.
Mall
});
if
(
goodsList
!=
null
&&
goodsList
.
Count
>
0
)
{
...
...
@@ -1000,6 +1005,7 @@ namespace Mall.WebApi.Controllers
MallBaseId
=
miniProgram
.
MallBaseId
,
CategoryIds
=
subitem
.
relation_id
.
ToString
(),
GoodsStatus
=
1
,
GoodsPageType
=
IsOpenSchool
==
1
?
Common
.
Enum
.
Goods
.
GoodsPageTypeEnum
.
School
:
Common
.
Enum
.
Goods
.
GoodsPageTypeEnum
.
Mall
});
if
(
goodsList
!=
null
&&
goodsList
.
Count
>
0
)
{
...
...
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