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
8d96b883
Commit
8d96b883
authored
Sep 28, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
470d4242
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
134 additions
and
23 deletions
+134
-23
EducationModule.cs
Mall.Module.Education/EducationModule.cs
+36
-23
AppletEducationController.cs
...WebApi/Controllers/Education/AppletEducationController.cs
+57
-0
AppletSchoolController.cs
Mall.WebApi/Controllers/Education/AppletSchoolController.cs
+41
-0
No files found.
Mall.Module.Education/EducationModule.cs
View file @
8d96b883
...
...
@@ -1200,39 +1200,39 @@ namespace Mall.Module.Education
}
if
(
demodel
.
SmallShopsId
>
0
)
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
||
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
UpPrice
>
0
).
Any
())
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
||
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
UpPrice
>
0
).
Any
())
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
{
var
sspModel
=
smallPList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
&&
x
.
SpecificationKey
==
""
).
FirstOrDefault
();
if
(
sspModel
!=
null
)
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
//单商品设置的
if
(
sspModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
sspModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
sspModel
.
UpPrice
??
0
)
/
100
);
}
else
else
if
(
sspModel
.
PriceType
==
2
)
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
sspModel
.
UpPrice
??
0
);
}
}
else
{
if
((
smallModel
.
UpPrice
??
0
)
>
0
)
{
if
(
smallModel
.
PriceType
==
1
)
{
if
(
smallModel
.
PriceType
==
1
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
Math
.
Ceiling
((
item
.
SellingPrice
??
0
)
*
(
smallModel
.
UpPrice
??
0
)
/
100
);
}
else
if
(
smallModel
.
PriceType
==
2
)
{
item
.
SellingPrice
=
(
item
.
SellingPrice
??
0
)
+
(
smallModel
.
UpPrice
??
0
);
}
}
}
}
}
if
(
item
.
EnjoyMember
==
1
&&
item
.
SeparateSetMember
==
1
)
{
item
.
MemberPriceList
=
MemberPriceList
.
Where
(
x
=>
x
.
GoodsId
==
item
.
Id
).
ToList
();
...
...
@@ -2089,6 +2089,19 @@ namespace Mall.Module.Education
}
/// <summary>
/// 获取资讯实体
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public
RB_Education_Article
GetArticleEntity
(
int
id
)
{
return
educationArticleRepository
.
GetEntity
(
id
);
}
/// <summary>
/// 资讯配置
/// </summary>
...
...
Mall.WebApi/Controllers/Education/AppletEducationController.cs
View file @
8d96b883
...
...
@@ -269,5 +269,62 @@ namespace Mall.WebApi.Controllers.Education
}
}
#
endregion
#
region
资讯留言
/// <summary>
/// 管理新增评论
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetArticleCommentInfo
()
{
var
req
=
RequestParm
;
var
userInfo
=
AppletUserInfo
;
RB_Education_ArticleComment_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Education_ArticleComment_Extend
>(
req
.
msg
.
ToString
());
if
(
demodel
.
ArticleId
<=
0
)
{
return
ApiResult
.
ParamIsNull
(
"请选择资讯"
);
}
if
(
string
.
IsNullOrEmpty
(
demodel
.
Content
))
{
return
ApiResult
.
ParamIsNull
(
"请输入评价内容"
);
}
var
articleModle
=
educationModule
.
GetArticleEntity
(
demodel
.
ArticleId
);
if
(
articleModle
==
null
)
{
return
ApiResult
.
ParamIsNull
(
"资讯信息不存在"
);
}
if
(
articleModle
.
IsComment
==
0
)
{
return
ApiResult
.
ParamIsNull
(
"资讯不允许留言"
);
}
demodel
.
CommentGrade
??=
Common
.
Enum
.
Goods
.
GoodsCommentTypeEnum
.
Praise
;
demodel
.
CommentScore
??=
5
;
demodel
.
CommentImage
=
""
;
if
(
demodel
.
CommentImgList
!=
null
&&
demodel
.
CommentImgList
.
Any
())
{
demodel
.
CommentImage
=
JsonConvert
.
SerializeObject
(
demodel
.
CommentImgList
);
}
demodel
.
UserId
=
userInfo
.
UserId
;
demodel
.
UserName
=
userInfo
.
Name
;
demodel
.
PlatformSource
=
userInfo
.
Source
;
demodel
.
UserPhoto
??=
0
;
demodel
.
Is_Top
??=
2
;
demodel
.
Is_Show
??=
1
;
demodel
.
Is_Anonymity
??=
2
;
demodel
.
Reply
??=
""
;
demodel
.
TenantId
=
userInfo
.
TenantId
;
demodel
.
MallBaseId
=
userInfo
.
MallBaseId
;
demodel
.
Status
=
0
;
demodel
.
UpdateDate
=
DateTime
.
Now
;
demodel
.
CreateDate
=
DateTime
.
Now
;
bool
flag
=
educationModule
.
SetArticleCommentInfo
(
demodel
);
if
(
flag
)
{
return
ApiResult
.
Success
();
}
else
{
return
ApiResult
.
Failed
();
}
}
#
endregion
}
}
\ No newline at end of file
Mall.WebApi/Controllers/Education/AppletSchoolController.cs
View file @
8d96b883
...
...
@@ -278,6 +278,47 @@ namespace Mall.WebApi.Controllers.Education
return
ApiResult
.
Success
(
""
,
oldLogisticsModel
);
}
/// <summary>
/// 获取商品评论分页列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetArticleCommentPageList
(
object
requestMsg
)
{
var
parms
=
JsonConvert
.
DeserializeObject
<
RequestParm
>(
requestMsg
.
ToString
());
ResultPageModel
pagelist
=
JsonConvert
.
DeserializeObject
<
ResultPageModel
>(
parms
.
msg
.
ToString
());
RB_Education_ArticleComment_Extend
demodel
=
JsonConvert
.
DeserializeObject
<
RB_Education_ArticleComment_Extend
>(
parms
.
msg
.
ToString
());
demodel
.
TenantId
=
parms
.
TenantId
;
demodel
.
MallBaseId
=
parms
.
MallBaseId
;
var
list
=
educationModule
.
GetArticleCommentPageList
(
pagelist
.
pageIndex
,
pagelist
.
pageSize
,
out
long
count
,
demodel
);
pagelist
.
count
=
Convert
.
ToInt32
(
count
);
pagelist
.
pageData
=
list
.
Select
(
x
=>
new
{
x
.
ID
,
x
.
UserId
,
x
.
UserName
,
x
.
ArticleId
,
x
.
ArticleName
,
x
.
CommentScore
,
x
.
CommentGrade
,
CommentGradeName
=
x
.
CommentGrade
.
GetEnumName
(),
x
.
CommentImgList
,
x
.
Content
,
x
.
Reply
,
x
.
Is_Top
,
x
.
Is_Show
,
x
.
Is_Anonymity
,
x
.
PlatformSource
,
x
.
TenantId
,
x
.
MallBaseId
,
CreateDate
=
x
.
CreateDate
.
HasValue
?
x
.
CreateDate
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
});
return
ApiResult
.
Success
(
""
,
pagelist
);
}
#
endregion
}
}
\ No newline at end of file
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