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
a67b4ef6
Commit
a67b4ef6
authored
Aug 19, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
fd169da4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
2 deletions
+39
-2
RB_Share_Category_Extend.cs
....Model/Extend/MarketingCenter/RB_Share_Category_Extend.cs
+1
-0
ShareModule.cs
Mall.Module.MarketingCenter/ShareModule.cs
+38
-2
No files found.
Mall.Model/Extend/MarketingCenter/RB_Share_Category_Extend.cs
View file @
a67b4ef6
using
Mall.Model.Entity.MarketingCenter
;
using
System
;
using
System.Collections.Generic
;
using
VT.FW.DB
;
namespace
Mall.Model.Extend.MarketingCenter
...
...
Mall.Module.MarketingCenter/ShareModule.cs
View file @
a67b4ef6
...
...
@@ -5,6 +5,7 @@ using System;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
using
System.Linq
;
namespace
Mall.Module.MarketingCenter
{
...
...
@@ -42,9 +43,44 @@ namespace Mall.Module.MarketingCenter
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public
List
<
RB_Share_Category_Extend
>
GetShareCategoryListModule
(
RB_Share_Category_Extend
query
)
public
List
<
object
>
GetShareCategoryListModule
(
RB_Share_Category_Extend
query
)
{
return
share_CategoryRepository
.
GetShareCategoryListRepository
(
query
);
List
<
object
>
resultList
=
new
List
<
object
>();
var
list
=
share_CategoryRepository
.
GetShareCategoryListRepository
(
query
);
if
(
list
!=
null
)
{
var
leavelList
=
list
.
GroupBy
(
qitem
=>
new
{
qitem
.
Level
}).
OrderBy
(
qitem
=>
qitem
.
Key
.
Level
);
foreach
(
var
item
in
list
.
Where
(
qitem
=>
qitem
.
Level
==
1
))
{
List
<
object
>
secondList
=
new
List
<
object
>();
var
subList
=
list
.
Where
(
qitem
=>
qitem
.
Level
==
2
&&
qitem
.
ParentId
==
item
.
Id
).
ToList
();
foreach
(
var
subItem
in
subList
)
{
var
subModel
=
new
{
subItem
.
Id
,
subItem
.
Level
,
subItem
.
Name
,
subItem
.
ParentId
,
hasChildren
=
list
.
Where
(
qitem
=>
qitem
.
Level
==
3
&&
qitem
.
ParentId
==
subItem
.
Id
)?.
Count
()
>
0
,
children
=
list
.
Where
(
qitem
=>
qitem
.
Level
==
3
&&
qitem
.
ParentId
==
subItem
.
Id
).
Select
(
qitem
=>
new
{
qitem
.
Id
,
qitem
.
Name
,
qitem
.
Level
,
qitem
.
ParentId
})
};
secondList
.
Add
(
subModel
);
}
var
rootModel
=
new
{
item
.
Id
,
item
.
Level
,
item
.
Name
,
item
.
ParentId
,
hasChildren
=
secondList
?.
Count
>
0
,
children
=
secondList
};
resultList
.
Add
(
rootModel
);
}
}
return
resultList
;
}
/// <summary>
...
...
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