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
cd17b35d
Commit
cd17b35d
authored
Aug 19, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
parents
45976511
a67b4ef6
Show 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 @
cd17b35d
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 @
cd17b35d
...
...
@@ -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