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
1208acac
Commit
1208acac
authored
Sep 30, 2020
by
liudong1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
课程评论调整
parent
c48d2e31
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
9 deletions
+48
-9
Program.cs
Mall.Education/Program.cs
+9
-9
OrderModule.cs
Mall.Module.Product/OrderModule.cs
+28
-0
RB_Goods_CommentRepository.cs
Mall.Repository/Product/RB_Goods_CommentRepository.cs
+10
-0
EducationController.cs
Mall.WebApi/Controllers/Education/EducationController.cs
+1
-0
No files found.
Mall.Education/Program.cs
View file @
1208acac
...
...
@@ -24,15 +24,15 @@ namespace Mall.Education
//ServiceBase.Run(ServicesToRun);
Console
.
WriteLine
(
"进来了"
);
string
FilePath
=
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Education/wkxq.docx"
;
string
[]
patharr
=
FilePath
.
Split
(
'/'
);
string
kjkj
=
""
;
for
(
var
i
=
3
;
i
<
patharr
.
Length
-
1
;
i
++)
{
kjkj
+=
patharr
[
i
]
+
"/"
;
}
Console
.
WriteLine
(
"2:"
+
kjkj
);
//
string FilePath = "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Education/wkxq.docx";
//
string[] patharr = FilePath.Split('/');
//
string kjkj = "";
//
for (var i = 3; i < patharr.Length - 1; i++)
//
{
//
kjkj += patharr[i] + "/";
//
}
//
Console.WriteLine("2:" + kjkj);
...
...
Mall.Module.Product/OrderModule.cs
View file @
1208acac
...
...
@@ -12138,6 +12138,34 @@ namespace Mall.Module.Product
}
};
goods_OrderDetailRepository
.
Update
(
keyValues
,
wheres
);
#
region
更新课程评分
var
goodsModel
=
goodsRepository
.
GetEntity
(
demodel
.
GoodsId
??
0
);
if
(
goodsModel
!=
null
&&
goodsModel
.
GoodsClassify
==
2
)
{
var
gcsModel
=
goods_CommentRepository
.
GetGoodsCommentScore
(
demodel
.
GoodsId
??
0
);
if
(
gcsModel
!=
null
)
{
decimal
score
=
0
;
if
(
gcsModel
.
CommentNum
>
0
)
{
score
=
Math
.
Round
(
Convert
.
ToDecimal
(
gcsModel
.
CommentScore
??
0
)
/
gcsModel
.
CommentNum
,
2
,
MidpointRounding
.
AwayFromZero
);
}
Dictionary
<
string
,
object
>
keyValues1
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Goods
.
CourseScore
),
score
}
};
List
<
WhereHelper
>
wheres1
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_Goods
.
Id
),
FiledValue
=
demodel
.
GoodsId
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
goodsRepository
.
Update
(
keyValues1
,
wheres1
);
}
}
#
endregion
if
(
OrderId
<
0
)
{
var
dlist
=
goods_OrderDetailRepository
.
GetOrderDetailList
(
new
RB_Goods_OrderDetail_Extend
()
{
OrderId
=
OrderId
,
IsComment
=
2
,
TenantId
=
demodel
.
TenantId
,
MallBaseId
=
demodel
.
MallBaseId
});
...
...
Mall.Repository/Product/RB_Goods_CommentRepository.cs
View file @
1208acac
...
...
@@ -342,6 +342,16 @@ from rb_goods_comment as c where {where} GROUP BY OrderDetailId) as t GROUP BY t
return
Get
<
RB_Goods_Comment_Extend
>(
sql
).
ToList
();
}
/// <summary>
/// 获取商品评分
/// </summary>
/// <param name="goodsId"></param>
/// <returns></returns>
public
RB_Goods_Comment_Extend
GetGoodsCommentScore
(
int
goodsId
)
{
string
sql
=
$@"SELECT SUM(CommentScore) AS CommentScore, COUNT(0) AS CommentNum FROM rb_goods_comment WHERE Status =0 and GoodsId =
{
goodsId
}
"
;
return
Get
<
RB_Goods_Comment_Extend
>(
sql
).
FirstOrDefault
();
}
}
}
Mall.WebApi/Controllers/Education/EducationController.cs
View file @
1208acac
...
...
@@ -616,6 +616,7 @@ namespace Mall.WebApi.Controllers.Education
demodel
.
IntegralComment
??=
0
;
//评论反积分
demodel
.
IntegralCommentType
??=
1
;
demodel
.
GoodsPageType
??=
GoodsPageTypeEnum
.
All
;
demodel
.
CourseScore
??=
0
;
bool
flag
=
educationModule
.
SetProductGoodsInfo
(
demodel
);
if
(
flag
)
...
...
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