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
4d93b5b1
Commit
4d93b5b1
authored
Oct 10, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
46e979a2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
172 additions
and
12 deletions
+172
-12
RB_Education_Teacher_Extend.cs
Mall.Model/Extend/Education/RB_Education_Teacher_Extend.cs
+14
-1
EducationModule.cs
Mall.Module.Education/EducationModule.cs
+30
-0
RB_GoodsRepository.cs
Mall.Repository/Product/RB_GoodsRepository.cs
+64
-0
AppletEducationController.cs
...WebApi/Controllers/Education/AppletEducationController.cs
+33
-0
AppletSchoolController.cs
Mall.WebApi/Controllers/Education/AppletSchoolController.cs
+31
-11
No files found.
Mall.Model/Extend/Education/RB_Education_Teacher_Extend.cs
View file @
4d93b5b1
...
...
@@ -10,7 +10,7 @@ namespace Mall.Model.Extend.Education
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Education_Teacher_Extend
:
Entity
.
Education
.
RB_Education_Teacher
public
class
RB_Education_Teacher_Extend
:
Entity
.
Education
.
RB_Education_Teacher
{
/// <summary>
...
...
@@ -28,11 +28,24 @@ namespace Mall.Model.Extend.Education
/// </summary>
public
int
OrderGuestNum
{
get
;
set
;
}
/// <summary>
/// 关注人数
/// </summary>
public
int
FollowteacherNum
{
get
;
set
;
}
/// <summary>
/// 商品数
/// </summary>
public
int
GoodsNum
{
get
;
set
;
}
/// <summary>
/// 当前登录人id
/// </summary>
public
int
UserId
{
get
;
set
;
}
/// <summary>
/// 关联商品
/// </summary>
...
...
Mall.Module.Education/EducationModule.cs
View file @
4d93b5b1
...
...
@@ -2694,5 +2694,35 @@ namespace Mall.Module.Education
}
#
endregion
#
region
我的收藏
/// <summary>
/// 获取用户收藏商品分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="count"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_Goods_Extend
>
GetCollectEducationGoodsPageList
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Goods_Extend
demodel
)
{
var
list
=
goodsRepository
.
GetCollectEducationGoodsPageList
(
pageIndex
,
pageSize
,
out
count
,
demodel
);
if
(
list
.
Any
())
{
foreach
(
var
item
in
list
)
{
item
.
CoverImage
=
""
;
if
(!
string
.
IsNullOrEmpty
(
item
.
CarouselImage
)
&&
item
.
CarouselImage
!=
"[]"
)
{
List
<
string
>
CarouselIdList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
item
.
CarouselImage
);
//封面图
item
.
CoverImage
=
CarouselIdList
[
0
];
}
}
}
return
list
;
}
#
endregion
}
}
Mall.Repository/Product/RB_GoodsRepository.cs
View file @
4d93b5b1
...
...
@@ -1219,6 +1219,70 @@ LEFT JOIN rb_goods_wk_teacher as b on g.Id=b.GoodsId
LEFT JOIN (SELECT GoodsId,COUNT(*) as CourseNum from rb_goods_wk_course where `Status`=0 GROUP BY GoodsId) as c on c.GoodsId=g.Id where
{
where
}
order by
{
orderBy
}
"
;
return
GetPage
<
RB_Goods_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
sql
).
ToList
();
}
/// <summary>
/// 获取会员收藏商品分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public
List
<
RB_Goods_Extend
>
GetCollectEducationGoodsPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Goods_Extend
dmodel
)
{
string
where
=
$" 1=1 and col.
{
nameof
(
RB_Goods_Extend
.
Status
)}
=0 and g.GoodsClassify=2"
;
where
+=
$" and col.Type=1 and col.UserId=
{
dmodel
.
UserId
}
and g.
{
nameof
(
RB_Goods_Extend
.
Status
)}
=0 and g.
{
nameof
(
RB_Goods_Extend
.
GoodsStatus
)}
=1"
;
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and col.
{
nameof
(
RB_Goods_Extend
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
}
if
(
dmodel
.
MallBaseId
>
0
)
{
where
+=
$@" and col.
{
nameof
(
RB_Goods_Extend
.
MallBaseId
)}
=
{
dmodel
.
MallBaseId
}
"
;
}
if
(
dmodel
.
Id
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
Id
)}
=
{
dmodel
.
Id
}
"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
GoodsIds
))
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
Id
)}
in(
{
dmodel
.
GoodsIds
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
Name
))
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
Name
)}
like '%
{
dmodel
.
Name
}
%'"
;
}
if
(
dmodel
.
GoodsStatus
>
0
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
GoodsStatus
)}
=
{
dmodel
.
GoodsStatus
}
"
;
}
if
(
dmodel
.
IsSelectSellOut
==
1
)
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
InventoryNum
)}
<=0"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
CategoryIds
))
{
where
+=
$@" and c.
{
nameof
(
RB_Goods_Category
.
CategoryId
)}
in(
{
dmodel
.
CategoryIds
}
)"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
StartTime
))
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
CreateDate
)}
>='
{
dmodel
.
StartTime
}
'"
;
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
EndTime
))
{
where
+=
$@" and g.
{
nameof
(
RB_Goods_Extend
.
CreateDate
)}
<='
{
dmodel
.
EndTime
+
" 23:59:59"
}
'"
;
}
string
sql
=
$@"select g.* from
rb_member_collection col
inner join RB_Goods g on col.GoodsId=g.Id
inner join rb_goods_category c on g.Id=c.GoodsId
where
{
where
}
group by g.Id order by col.Id desc"
;
return
GetPage
<
RB_Goods_Extend
>(
pageIndex
,
pageSize
,
out
rowCount
,
sql
).
ToList
();
}
#
endregion
}
...
...
Mall.WebApi/Controllers/Education/AppletEducationController.cs
View file @
4d93b5b1
...
...
@@ -702,6 +702,39 @@ namespace Mall.WebApi.Controllers.Education
}
#
endregion
#
region
我的收藏
/// <summary>
/// 获取收藏商品分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetUserCollectionPageList
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
req
.
msg
.
ToString
());
RB_Goods_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Goods_Extend
>(
req
.
msg
.
ToString
());
demodel
.
UserId
=
userInfo
.
UserId
;
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
var
list
=
educationModule
.
GetCollectEducationGoodsPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
Id
,
x
.
Name
,
x
.
CoverImage
,
x
.
SellingPrice
,
x
.
SalesNum
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
#
endregion
}
}
\ No newline at end of file
Mall.WebApi/Controllers/Education/AppletSchoolController.cs
View file @
4d93b5b1
...
...
@@ -160,7 +160,8 @@ namespace Mall.WebApi.Controllers.Education
/// <param name="requestMsg"></param>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetAppletGoodsCourseList
(
object
requestMsg
)
{
public
ApiResult
GetAppletGoodsCourseList
(
object
requestMsg
)
{
var
req
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
if
(
req
.
MallBaseId
<=
0
)
{
...
...
@@ -173,7 +174,7 @@ namespace Mall.WebApi.Controllers.Education
{
return
ApiResult
.
ParamIsNull
();
}
var
list
=
productModule
.
GetAppletGoodsCourseList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
GoodsId
,
req
.
TenantId
,
req
.
MallBaseId
);
var
list
=
productModule
.
GetAppletGoodsCourseList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
GoodsId
,
req
.
TenantId
,
req
.
MallBaseId
);
bool
IsPay
=
productModule
.
GetAppletCourseIsPay
(
GoodsId
,
req
.
UserId
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
...
...
@@ -206,16 +207,21 @@ namespace Mall.WebApi.Controllers.Education
/// <param name="Number"></param>
/// <param name="Image"></param>
/// <returns></returns>
public
List
<
CourseImageModel
>
GetCourseImage
(
int
IsTrySee
,
bool
IsPay
,
int
Number
,
string
Image
)
{
if
(
string
.
IsNullOrEmpty
(
Image
)
||
Image
==
"[]"
)
{
public
List
<
CourseImageModel
>
GetCourseImage
(
int
IsTrySee
,
bool
IsPay
,
int
Number
,
string
Image
)
{
if
(
string
.
IsNullOrEmpty
(
Image
)
||
Image
==
"[]"
)
{
return
new
List
<
CourseImageModel
>();
}
if
(
IsPay
)
{
if
(
IsPay
)
{
return
JsonConvert
.
DeserializeObject
<
List
<
CourseImageModel
>>(
Image
);
}
if
(
IsTrySee
==
1
)
{
if
(
IsTrySee
==
1
)
{
var
list
=
JsonConvert
.
DeserializeObject
<
List
<
CourseImageModel
>>(
Image
);
if
(
Number
>
0
)
{
if
(
Number
>
0
)
{
list
=
list
.
Take
(
Number
).
ToList
();
}
return
list
;
...
...
@@ -381,22 +387,36 @@ namespace Mall.WebApi.Controllers.Education
{
oldLogisticsModel
.
LableNameList
=
JsonConvert
.
DeserializeObject
<
List
<
string
>>(
oldLogisticsModel
.
LableName
);
}
//获取老师的关注数
//判断是否已经关注过
var
oldList
=
educationModule
.
GetFollowTeacherList
(
new
RB_Education_FollowTeacher_Extend
{
TeacherId
=
query
.
ID
,
MallBaseId
=
query
.
MallBaseId
,
TenantId
=
query
.
TenantId
});
oldLogisticsModel
.
FollowteacherNum
=
oldList
.
Count
();
int
Followteacher
=
0
;
if
(
query
.
UserId
>
0
)
{
Followteacher
=
(
oldList
!=
null
&&
oldList
.
Any
())
?
oldList
.
Where
(
x
=>
x
.
UserId
==
query
.
UserId
).
Count
()
:
0
;
}
//获取老师对应的课程
var
goodsList
=
educationModule
.
GetListByTeacherId
(
1
,
4
,
out
long
count
,
new
RB_Goods_Extend
{
TeacherId
=
oldLogisticsModel
.
ID
,
TenantId
=
oldLogisticsModel
.
TenantId
,
MallBaseId
=
oldLogisticsModel
.
MallBaseId
});
var
goodsResult
=
goodsList
.
Select
(
x
=>
new
{
x
.
CoverImage
,
x
.
Name
,
x
.
CourseNum
x
.
CourseNum
,
x
.
Id
});
var
teacherResult
=
new
{
var
teacherResult
=
new
{
oldLogisticsModel
?.
WorkYears
,
oldLogisticsModel
?.
Major
,
oldLogisticsModel
?.
LableNameList
,
oldLogisticsModel
?.
Name
,
oldLogisticsModel
?.
TeacherLogo
,
oldLogisticsModel
?.
Introduction
oldLogisticsModel
?.
Introduction
,
oldLogisticsModel
.
FollowteacherNum
,
Followteacher
//是否关注该老师,0-没有,1-已关注
};
return
ApiResult
.
Success
(
""
,
new
{
teacherResult
,
goodsResult
});
}
...
...
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