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
775e2488
Commit
775e2488
authored
Apr 19, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
9a65b332
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
0 deletions
+93
-0
ActivityModule.cs
Mall.Module.Education/ActivityModule.cs
+43
-0
RB_Education_ActivityRepository.cs
Mall.Repository/Education/RB_Education_ActivityRepository.cs
+8
-0
EducationController.cs
Mall.WebApi/Controllers/Education/EducationController.cs
+42
-0
No files found.
Mall.Module.Education/ActivityModule.cs
View file @
775e2488
...
...
@@ -2597,5 +2597,48 @@ namespace Mall.Module.Education
}
#
endregion
#
region
活动日历表
/// <summary>
/// 获取活动日历
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
object
GetEduActivityCalendar
(
RB_Education_Activity_Extend
query
)
{
var
list
=
education_ActivityRepository
.
GetList
(
query
);
list
=
list
.
Where
(
x
=>
!
string
.
IsNullOrEmpty
(
x
.
CoverImg
)).
ToList
();
//排除没有封面图的
//根据查询日期 开始遍历
DateTime
STime
=
Convert
.
ToDateTime
(
query
.
SelectStartTimeStr
);
DateTime
ETime
=
Convert
.
ToDateTime
(
query
.
SelectEndTimeStr
);
List
<
object
>
RList
=
new
List
<
object
>();
while
(
true
)
{
var
alist
=
list
.
Where
(
x
=>
Convert
.
ToDateTime
(
x
.
StartTime
.
ToString
(
"yyyy-MM-dd"
))
<=
STime
&&
Convert
.
ToDateTime
(
x
.
EndTime
.
ToString
(
"yyyy-MM-dd"
))
>=
STime
).
ToList
();
RList
.
Add
(
new
{
Date
=
STime
.
ToString
(
"yyyy-MM-dd"
),
ActivityList
=
alist
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
ActivityName
,
StartTime
=
x
.
StartTime
.
ToString
(
"MM-dd HH:mm"
),
EndTime
=
x
.
EndTime
.
ToString
(
"MM-dd HH:mm"
),
x
.
CoverImg
,
x
.
IsFree
,
x
.
Price
,
x
.
LocationName
,
x
.
ActivityStatus
})
});
if
(
STime
==
ETime
)
{
break
;
}
STime
=
STime
.
AddDays
(
1
);
}
return
RList
;
}
#
endregion
}
}
Mall.Repository/Education/RB_Education_ActivityRepository.cs
View file @
775e2488
...
...
@@ -279,6 +279,14 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND A.{0} in({1}) "
,
nameof
(
RB_Education_Activity_Extend
.
Id
),
query
.
ActivityIds
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
SelectStartTimeStr
))
{
builder
.
AppendFormat
(
$" and DATE_FORMAT(a.
{
nameof
(
RB_Education_Activity_Extend
.
StartTime
)}
,'%Y-%m-%d' )>=DATE_FORMAT('
{
query
.
SelectStartTimeStr
}
','%Y-%m-%d' ) "
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
SelectEndTimeStr
))
{
builder
.
AppendFormat
(
$" and DATE_FORMAT(a.
{
nameof
(
RB_Education_Activity_Extend
.
StartTime
)}
,'%Y-%m-%d' )<= DATE_FORMAT('
{
query
.
SelectEndTimeStr
}
','%Y-%m-%d' ) "
);
}
}
return
Get
<
RB_Education_Activity_Extend
>(
builder
.
ToString
()).
ToList
();
}
...
...
Mall.WebApi/Controllers/Education/EducationController.cs
View file @
775e2488
...
...
@@ -3297,6 +3297,48 @@ namespace Mall.WebApi.Controllers.Education
#
endregion
#
region
活动日历表
/// <summary>
/// 获取教育首页活动日历表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetEduActivityCalendar
()
{
JObject
jObj
=
JObject
.
Parse
(
RequestParm
.
msg
.
ToString
());
var
query
=
new
RB_Education_Activity_Extend
()
{
ActivityName
=
jObj
.
GetStringValue
(
"ActivityName"
),
SelectStartTimeStr
=
jObj
.
GetStringValue
(
"SelectStartTimeStr"
),
SelectEndTimeStr
=
jObj
.
GetStringValue
(
"SelectEndTimeStr"
),
};
if
(
string
.
IsNullOrEmpty
(
query
.
SelectStartTimeStr
)
||
string
.
IsNullOrEmpty
(
query
.
SelectEndTimeStr
))
{
return
ApiResult
.
ParamIsNull
();
}
try
{
query
.
SelectStartTimeStr
=
Convert
.
ToDateTime
(
query
.
SelectStartTimeStr
).
ToString
(
"yyyy-MM-dd"
);
query
.
SelectEndTimeStr
=
Convert
.
ToDateTime
(
query
.
SelectEndTimeStr
).
ToString
(
"yyyy-MM-dd"
);
}
catch
(
Exception
)
{
return
ApiResult
.
ParamIsNull
();
}
if
(
Convert
.
ToDateTime
(
query
.
SelectStartTimeStr
)
>
Convert
.
ToDateTime
(
query
.
SelectEndTimeStr
))
{
return
ApiResult
.
Failed
(
"结束日期不能大于开始日期"
);
}
query
.
MallBaseId
=
RequestParm
.
MallBaseId
;
query
.
TenantId
=
RequestParm
.
TenantId
;
var
robj
=
activityModule
.
GetEduActivityCalendar
(
query
);
return
ApiResult
.
Success
(
""
,
robj
);
}
#
endregion
#
region
会员列表
/// <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