Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projecttwo
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
wangtao
projecttwo
Commits
9d77a40f
Commit
9d77a40f
authored
Jul 08, 2025
by
wangtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
学习资料
parent
204ef093
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
547 additions
and
18 deletions
+547
-18
CourseComment.php
app/admin/controller/course/CourseComment.php
+95
-0
detail.html
app/admin/view/course/course/detail.html
+15
-10
index.html
app/admin/view/course/course/index.html
+1
-1
index.html
app/admin/view/course/course_class/index.html
+9
-7
getcomment.html
app/admin/view/course/course_comment/getcomment.html
+291
-0
index.html
app/admin/view/course/course_comment/index.html
+129
-0
CourseComment.php
app/model/CourseComment.php
+7
-0
No files found.
app/admin/controller/course/CourseComment.php
0 → 100644
View file @
9d77a40f
<?php
/**
* ===========================================================================
* Veitool 快捷开发框架系统
* Author: Niaho 26843818@qq.com
* Copyright (c)2019-2025 www.veitool.com All rights reserved.
* Licensed: 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
* ---------------------------------------------------------------------------
*/
namespace
app\admin\controller\course
;
use
app\admin\controller\AdminBase
;
use
app\model\CourseComment
AS
CourseCommentModel
;
use
think\App
;
/**
* 后台主控制器
*/
class
CourseComment
extends
AdminBase
{
protected
$coursecomment
;
public
function
__construct
(
App
$app
)
{
parent
::
__construct
(
$app
);
$this
->
coursecomment
=
new
CourseCommentModel
();
}
// 课程评论列表
public
function
index
(
string
$do
=
''
)
{
$limit
=
10
;
if
(
$do
==
'json'
)
{
$post
=
input
();
$post
[
'limit'
]
=
isset
(
$post
[
'limit'
])
?
$post
[
'limit'
]
:
$limit
;
$map
[
'parent_id'
]
=
'0'
;
$hasmap
=
[];
if
(
isset
(
$post
[
'kc'
])
&&
!
empty
(
$post
[
'kc'
]))
{
$hasmap
[]
=
[
'title'
,
'like'
,
'%'
.
trim
(
$post
[
'kc'
])
.
'%'
];
}
if
(
isset
(
$post
[
'course_id'
])
&&
!
empty
(
$post
[
'course_id'
]))
{
$map
[]
=
[
'course_id'
,
'='
,
$post
[
'course_id'
]];
}
$usermap
=
[];
if
(
isset
(
$post
[
'user'
])
&&
!
empty
(
$post
[
'user'
]))
{
$usermap
[]
=
[
'username|mobile'
,
'like'
,
'%'
.
$post
[
'user'
]
.
'%'
];
}
$list
=
$this
->
coursecomment
->
where
(
$map
)
->
hasWhere
(
'course'
,
$hasmap
)
->
hasWhere
(
'user'
,
$usermap
)
->
with
([
'user'
,
'course'
])
->
order
(
'createtime desc'
)
->
paginate
(
$post
[
'limit'
]);
return
$this
->
returnMsg
(
$list
);
}
$this
->
assign
(
'limit'
,
$limit
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
//快速编辑
public
function
editup
()
{
$post
=
input
();
$this
->
coursecomment
->
update
([
$post
[
'af'
]
=>
$post
[
'av'
]],
[[
'id'
,
'='
,
$post
[
'id'
]]]);
return
$this
->
returnMsg
(
'修改成功'
);
}
public
function
del
()
{
$post
=
input
();
// $ids = is_array($post['id']) ? implode(',', $post['id']) : $post['id'];
if
(
$this
->
coursecomment
->
destroy
(
$post
[
'id'
]))
{
return
$this
->
returnMsg
(
"删除成功"
,
1
);
}
else
{
return
$this
->
returnMsg
(
"删除失败"
);
}
}
//查看回复列表
public
function
getcomment
()
{
$post
=
input
();
$info
=
$this
->
coursecomment
->
with
([
'user'
=>
[
'headico'
],
'replies'
])
->
find
(
$post
[
'id'
]);
$this
->
assign
(
'info'
,
$info
);
return
$this
->
fetch
(
''
,
''
,
false
);
}
}
\ No newline at end of file
app/admin/view/course/course/detail.html
View file @
9d77a40f
...
...
@@ -89,14 +89,14 @@
<div
class=
"layui-tab-item"
>
<div
class=
"layui-card-body"
style=
" padding: 0px 10px !important; "
>
<div
class=
"layui-card-box"
style=
"width: 850px;"
>
<div
class=
"layui-card-box"
>
<table
lay-filter=
"courseclasscategory"
id=
"courseclasscategory"
></table>
</div>
</div>
</div>
<div
class=
"layui-tab-item"
>
<div
class=
"layui-card-body"
style=
" padding: 0px 10px !important; "
>
<div
class=
"layui-card-box"
style=
"width: 850px;"
>
<div
class=
"layui-card-box"
>
<table
lay-filter=
"coursework"
id=
"coursework"
></table>
</div>
</div>
...
...
@@ -149,9 +149,9 @@
where
:{
course_id
:
course_id
},
cols
:
[[
{
field
:
'id'
,
width
:
50
,
align
:
'center'
,
title
:
'ID'
,
sort
:
!
0
},
{
field
:
'title'
,
width
:
2
0
0
,
align
:
'center'
,
title
:
'课时名称'
},
{
field
:
'title'
,
width
:
2
5
0
,
align
:
'center'
,
title
:
'课时名称'
},
{
field
:
'course_class_cate'
,
width
:
200
,
align
:
'center'
,
title
:
'所属章节'
},
{
field
:
'course_title'
,
width
:
2
0
0
,
align
:
'center'
,
title
:
'所属课程'
},
{
field
:
'course_title'
,
width
:
2
5
0
,
align
:
'center'
,
title
:
'所属课程'
},
{
field
:
'username'
,
width
:
120
,
align
:
'center'
,
title
:
'发布者'
,
templet
:
'<div>{{d.user_info.username}}</div>'
},
{
field
:
'createtime'
,
width
:
120
,
align
:
'center'
,
title
:
'创建时间'
},
{
field
:
'issktext'
,
width
:
120
,
align
:
'center'
,
title
:
'是否试看'
},
...
...
@@ -168,14 +168,13 @@
elem
:
'#coursework'
,
page
:
true
,
limit
:
20
,
url
:
map_root
+
"course.course_work/index?&do=json"
,
where
:{
course_id
:
course_id
},
cols
:
[[
{
field
:
'id'
,
width
:
50
,
unresize
:
true
,
align
:
'center'
,
title
:
'ID'
,
sort
:
!
0
},
{
field
:
'title'
,
align
:
'center'
,
title
:
'作业标题'
},
{
field
:
'course_title'
,
align
:
'center'
,
title
:
'所属课程'
},
{
field
:
'title'
,
width
:
250
,
align
:
'center'
,
title
:
'作业标题'
},
{
field
:
'course_title'
,
align
:
'center'
,
width
:
250
,
title
:
'所属课程'
},
{
field
:
'username'
,
width
:
120
,
align
:
'center'
,
title
:
'发布者'
,
templet
:
'<div>{{d.user_info.username}}</div>'
},
{
field
:
'createtime'
,
width
:
160
,
align
:
'center'
,
title
:
'创建时间'
},
{
fixed
:
'right'
,
width
:
130
,
align
:
'center'
,
toolbar
:
'<div><a class="layui-btn layui-btn-xs" lay-event="workdetail">详情</a></div>'
,
title
:
'操作'
}
...
...
@@ -190,6 +189,10 @@
console
.
log
(
data
);
if
(
data
.
index
===
1
){
table
.
reloadData
(
'courseclasstwo'
);
}
else
if
(
data
.
index
===
2
){
table
.
reloadData
(
'courseclasscategory'
);
}
else
if
(
data
.
index
===
3
){
table
.
reloadData
(
'coursework'
);
}
});
...
...
@@ -199,16 +202,18 @@
if
(
obj
.
event
===
'clicktv'
){
// 在此处输入 layer 的任意代码
layer
.
open
({
type
:
1
,
// page 层类型
area
:
[
'
500px'
,
'45
0px'
],
area
:
[
'
95%'
,
'56
0px'
],
title
:
data
.
title
,
shade
:
0.6
,
// 遮罩透明度
shadeClose
:
true
,
// 点击遮罩区域,关闭弹层
maxmin
:
true
,
// 允许全屏最小化
anim
:
0
,
// 0-6 的动画形式,-1 不开启
content
:
'<div style="text-align: center;
"><video width="480
" controls autoplay>
\
n'
+
' <source src="'
+
data
.
tvfilepath
+
'" type="video/mp4">
\
n'
+
content
:
'<div style="text-align: center;
width: 100%; height: 500px; margin: 0px auto;" ><video width="100%" height="100%
" controls autoplay>
\
n'
+
' <source
width="100%" height="100%" style="object-fit: cover;"
src="'
+
data
.
tvfilepath
+
'" type="video/mp4">
\
n'
+
'</video></div>'
});
}
else
if
(
obj
.
event
===
'workdetail'
){
...
...
app/admin/view/course/course/index.html
View file @
9d77a40f
...
...
@@ -330,7 +330,7 @@
layer
.
open
({
type
:
2
,
area
:
[
'
9
00px'
,
'90%'
],
area
:
[
'
10
00px'
,
'90%'
],
title
:
"课程详情"
,
btn
:
[
'确定'
,
'关闭'
],
// fixed: false, //不固定
...
...
app/admin/view/course/course_class/index.html
View file @
9d77a40f
...
...
@@ -4,7 +4,7 @@
<div
class=
"layui-card"
>
<div
class=
"layui-card-header"
>
<form
class=
"layui-form render"
>
<form
class=
"layui-form render"
id=
"courseclass-form"
>
<input
type=
"hidden"
name=
"groupid"
id=
"courseclass-groupid"
value=
""
/>
<div
class=
"layui-form-item"
>
...
...
@@ -46,9 +46,9 @@
/*初始渲染*/
/*==============左树结构END==============*/
var
kw
=
$
(
'input[name=kw]'
).
val
();
var
kc
=
$
(
'input[name=kc]'
).
val
();
var
zj
=
$
(
'input[name=zj]'
).
val
();
var
kw
=
$
(
"#courseclass-form"
).
find
(
'input[name=kw]'
).
val
();
var
kc
=
$
(
"#courseclass-form"
).
find
(
'input[name=kc]'
).
val
();
var
zj
=
$
(
"#courseclass-form"
).
find
(
'input[name=zj]'
).
val
();
/*渲染数据*/
table
.
render
({
elem
:
'#courseclass'
,
...
...
@@ -87,16 +87,18 @@
var
id
=
data
.
id
;
if
(
obj
.
event
===
'clicktv'
){
// 在此处输入 layer 的任意代码
layer
.
open
({
type
:
1
,
// page 层类型
area
:
[
'50
0px'
,
'45
0px'
],
area
:
[
'50
%'
,
'56
0px'
],
title
:
data
.
title
,
shade
:
0.6
,
// 遮罩透明度
shadeClose
:
true
,
// 点击遮罩区域,关闭弹层
maxmin
:
true
,
// 允许全屏最小化
anim
:
0
,
// 0-6 的动画形式,-1 不开启
content
:
'<div style="text-align: center;
"><video width="480
" controls autoplay>
\
n'
+
' <source src="'
+
data
.
tvfilepath
+
'" type="video/mp4">
\
n'
+
content
:
'<div style="text-align: center;
width: 100%; height: 500px; margin: 0px auto;" ><video width="100%" height="100%
" controls autoplay>
\
n'
+
' <source
width="100%" height="100%" style="object-fit: cover;"
src="'
+
data
.
tvfilepath
+
'" type="video/mp4">
\
n'
+
'</video></div>'
});
}
else
if
(
obj
.
event
===
'del'
){
...
...
app/admin/view/course/course_comment/getcomment.html
0 → 100644
View file @
9d77a40f
{extend name="base/header" /}
{block name="body"}
<style>
.layui-table
.widthtd
{
width
:
120px
;}
</style>
<div
style=
" background: #fff;"
>
<!DOCTYPE html>
<html
lang=
"zh-CN"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<title>
评价与回复列表(带删除功能)
</title>
<style>
body
{
font-family
:
'Arial'
,
sans-serif
;
width
:
95%
;
margin
:
0
auto
;
padding
:
20px
;
background-color
:
#f5f5f5
;
}
.review-section
{
background-color
:
white
;
border-radius
:
8px
;
padding
:
0px
20px
;
margin-bottom
:
20px
;
box-shadow
:
0
2px
4px
rgba
(
0
,
0
,
0
,
0.1
);
}
.review
{
border-bottom
:
1px
solid
#eee
;
padding
:
15px
0
;
position
:
relative
;
}
.review
:last-child
{
border-bottom
:
none
;
}
.review-header
{
display
:
flex
;
align-items
:
center
;
margin-bottom
:
10px
;
}
.user-avatar
{
}
.user-avatar
img
{
width
:
40px
;
height
:
40px
;
border-radius
:
50%
;
margin-right
:
10px
;
background-color
:
#ddd
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
color
:
#666
;
font-weight
:
bold
;
}
.user-name
{
font-weight
:
bold
;
margin-right
:
10px
;
}
.review-date
{
color
:
#999
;
font-size
:
0.9em
;
}
.review-rating
{
color
:
#ffc107
;
margin
:
5px
0
;
}
.review-content
{
line-height
:
1.5
;
margin-bottom
:
10px
;
}
.action-buttons
{
display
:
flex
;
gap
:
10px
;
}
.reply-btn
,
.delete-btn
{
background
:
none
;
border
:
none
;
cursor
:
pointer
;
padding
:
0
;
font-size
:
0.9em
;
}
.reply-btn
{
color
:
#3498db
;
}
.delete-btn
{
color
:
#e74c3c
;
}
.reply-btn
:hover
,
.delete-btn
:hover
{
text-decoration
:
underline
;
}
.replies
{
margin-left
:
30px
;
margin-top
:
15px
;
border-left
:
2px
solid
#eee
;
padding-left
:
15px
;
}
.reply
{
padding
:
10px
0
;
position
:
relative
;
}
.reply-header
{
display
:
flex
;
align-items
:
center
;
margin-bottom
:
5px
;
}
.reply-user
{
font-weight
:
bold
;
margin-right
:
10px
;
}
.reply-date
{
color
:
#999
;
font-size
:
0.8em
;
}
.reply-content
{
font-size
:
0.9em
;
line-height
:
1.4
;
color
:
#555
;
}
.reply-form
{
margin-top
:
15px
;
display
:
none
;
}
.reply-form
textarea
{
width
:
100%
;
padding
:
10px
;
border
:
1px
solid
#ddd
;
border-radius
:
4px
;
resize
:
vertical
;
min-height
:
80px
;
margin-bottom
:
10px
;
}
.reply-form
button
{
background-color
:
#3498db
;
color
:
white
;
border
:
none
;
padding
:
8px
15px
;
border-radius
:
4px
;
cursor
:
pointer
;
}
.reply-form
button
:hover
{
background-color
:
#2980b9
;
}
.confirmation-dialog
{
display
:
none
;
position
:
fixed
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
background-color
:
rgba
(
0
,
0
,
0
,
0.5
);
justify-content
:
center
;
align-items
:
center
;
z-index
:
1000
;
}
.dialog-content
{
background-color
:
white
;
padding
:
20px
;
border-radius
:
8px
;
width
:
300px
;
text-align
:
center
;
}
.dialog-buttons
{
display
:
flex
;
justify-content
:
center
;
gap
:
10px
;
margin-top
:
20px
;
}
.dialog-buttons
button
{
padding
:
8px
15px
;
border
:
none
;
border-radius
:
4px
;
cursor
:
pointer
;
}
.confirm-btn
{
background-color
:
#e74c3c
;
color
:
white
;
}
.cancel-btn
{
background-color
:
#bdc3c7
;
}
</style>
</head>
<body>
<div
class=
"review-section"
>
<!-- 评价1 -->
<div
class=
"review"
data-review-id=
"1"
>
<div
class=
"review-header"
>
<div
class=
"user-avatar"
><img
src=
"{$info.user.headico.fileurl|default=''}"
></div>
<div
class=
"user-name"
>
{$info.user.username}
</div>
<div
class=
"review-date"
>
{$info.createtime}
</div>
</div>
<div
class=
"review-content"
>
{$info.content}
</div>
<!-- 回复列表 -->
<div
class=
"replies"
>
{if $info.replies}
{volist name="info.replies" id="data"}
<div
class=
"reply"
data-reply-id=
"1"
>
<div
class=
"reply-header"
>
<div
class=
"reply-user"
>
{$data.user.username}
</div>
<div
class=
"reply-date"
>
{$data.createtime}
</div>
</div>
<div
class=
"reply-content"
>
{$data.content}
</div>
<button
class=
"delete-btn"
data-id=
"{$data.id}"
style=
"position: absolute; right: 0; top: 10px;"
>
删除
</button>
</div>
{/volist}
{else /}
暂无数据。。。
{/if}
</div>
</div>
</div>
</body>
</html>
</div>
{/block}
{block name="script"}
<script
type=
"text/javascript"
>
layui
.
use
([
'buildItems'
,
'form'
],
function
()
{
var
form
=
layui
.
form
;
var
admin
=
layui
.
admin
;
$
(
".delete-btn"
).
click
(
function
(){
var
id
=
$
(
this
).
attr
(
"data-id"
);
var
obj
=
$
(
this
);
layer
.
confirm
(
'确定要删除所选记录吗?'
,
function
(){
admin
.
req
(
"/admin/course.course_comment/del"
,{
id
:
id
},
function
(
res
){
layer
.
msg
(
res
.
msg
,{
shade
:[
0.4
,
'#000'
],
time
:
1500
},
function
(){
if
(
res
.
code
==
1
)
obj
.
parents
(
".reply"
).
remove
();
});
},
'post'
,{
headersToken
:
true
});
});
});
});
var
callbackdata
=
function
()
{
var
data
=
$
(
".layui-form"
).
serialize
();
return
data
;
};
</script>
{/block}
\ No newline at end of file
app/admin/view/course/course_comment/index.html
0 → 100644
View file @
9d77a40f
<div
class=
"layui-fluid"
>
<div
class=
"layui-card"
>
<div
class=
"layui-card-header"
>
<form
class=
"layui-form render"
>
<input
type=
"hidden"
name=
"groupid"
id=
"coursecomment-groupid"
value=
""
/>
<div
class=
"layui-form-item"
>
<div
class=
"layui-inline"
style=
"width:250px;"
><input
type=
"text"
name=
"kc"
placeholder=
"课程名称关键词"
value=
"{php}echo urldecode(input('kc') ? input('kc'): '');{/php}"
autocomplete=
"off"
class=
"layui-input"
lay-affix=
"clear"
/></div>
<div
class=
"layui-inline"
style=
"width:250px;"
><input
type=
"text"
name=
"user"
placeholder=
"用户名,手机号"
value=
""
autocomplete=
"off"
class=
"layui-input"
lay-affix=
"clear"
/></div>
<div
class=
"layui-inline"
>
<div
class=
"layui-btn-group"
>
<button
class=
"layui-btn"
lay-submit
lay-filter=
"search-coursecomment"
><i
class=
"layui-icon layui-icon-search"
></i>
搜索
</button>
<a
class=
"layui-btn"
lay-submit
lay-filter=
"search-coursecomment-all"
onclick=
"$('#coursecomment-groupid').val('')"
><i
class=
"layui-icon layui-icon-light"
></i>
全部
</a>
<a
class=
"layui-btn"
id=
"coursecomment-del"
><i
class=
"layui-icon layui-icon-delete"
></i>
删除
</a>
</div>
</div>
</div>
</form>
</div>
<div
class=
"layui-card-body"
>
<div
class=
"layui-card-box"
>
<table
lay-filter=
"coursecomment"
id=
"coursecomment"
></table>
</div>
</div>
</div>
</div>
<!--JS部分-->
<script>
layui
.
use
([
'vinfo'
,
'buildItems'
],
function
(){
var
map_root
=
layui
.
cache
.
maps
;
var
app_root
=
map_root
+
'course.course_comment/'
;
var
layer
=
layui
.
layer
,
table
=
layui
.
table
,
form
=
layui
.
form
,
admin
=
layui
.
admin
;
/*初始渲染*/
/*==============左树结构END==============*/
var
kc
=
$
(
'input[name=kc]'
).
val
();
/*渲染数据*/
table
.
render
({
elem
:
'#coursecomment'
,
page
:
true
,
limit
:{
$limit
},
url
:
app_root
+
"index?&do=json"
,
where
:{
kc
:
kc
},
cols
:
[[
{
type
:
'checkbox'
,
fixed
:
'left'
},
{
field
:
'id'
,
width
:
50
,
unresize
:
true
,
align
:
'center'
,
title
:
'ID'
,
sort
:
!
0
},
{
field
:
'course_title'
,
align
:
'center'
,
title
:
'所属课程'
,
templet
:
'<div>{{d.course.title}}</div>'
},
{
field
:
'username'
,
width
:
120
,
align
:
'center'
,
title
:
'发布者'
,
templet
:
'<div>{{d.user.username}}</div>'
},
{
field
:
'content'
,
align
:
'center'
,
minWidth
:
500
,
title
:
'评价内容'
},
{
field
:
'likes_count'
,
align
:
'center'
,
width
:
100
,
title
:
'点赞数量'
},
{
field
:
'createtime'
,
width
:
120
,
align
:
'center'
,
title
:
'评价时间'
},
{
fixed
:
'right'
,
width
:
130
,
align
:
'center'
,
toolbar
:
'<div><a class="layui-btn layui-btn-xs" lay-event="clickpj">查看回复</a><a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a></div>'
,
title
:
'操作'
}
]],
done
:
function
(){
admin
.
vShow
(
$
(
'[lay-table-id="coursecomment"]'
));
}
});
/*快编监听*/
table
.
on
(
'edit(coursecomment)'
,
function
(
obj
){
admin
.
req
(
app_root
+
"editup"
,{
id
:
obj
.
data
.
id
,
av
:
obj
.
value
,
af
:
obj
.
field
},
function
(
res
){
layer
.
msg
(
res
.
msg
,{
shade
:[
0.4
,
'#000'
],
time
:
500
});
},
'post'
,{
headersToken
:
true
});
});
/**/
/*工具条监听*/
table
.
on
(
'tool(coursecomment)'
,
function
(
obj
){
var
data
=
obj
.
data
;
var
id
=
data
.
id
;
if
(
obj
.
event
===
'clickpj'
){
pingjiaOpen
(
id
);
}
else
if
(
obj
.
event
===
'del'
){
del
(
id
);
}
else
if
(
obj
.
event
===
'coursecomment-event-image'
){
var
src
=
$
(
this
).
attr
(
'src'
),
alt
=
$
(
this
).
attr
(
'alt'
);
layer
.
photos
({
photos
:{
data
:[{
alt
:
alt
,
src
:
src
}],
start
:
'0'
},
anim
:
5
,
shade
:[
0.4
,
'#000'
]});
}
});
/**/
/*删除*/
function
del
(
ids
){
layer
.
confirm
(
'确定要删除所选记录吗?'
,
function
(){
admin
.
req
(
app_root
+
"del"
,{
id
:
ids
},
function
(
res
){
layer
.
msg
(
res
.
msg
,{
shade
:[
0.4
,
'#000'
],
time
:
1500
},
function
(){
if
(
res
.
code
==
1
)
table
.
reloadData
(
'coursecomment'
);
});
},
'post'
,{
headersToken
:
true
});
});
}
/**/
/*顶部删除按钮*/
$
(
'#coursecomment-del'
).
on
(
'click'
,
function
(){
var
checkRows
=
table
.
checkStatus
(
'coursecomment'
).
data
;
if
(
checkRows
.
length
===
0
){
return
layer
.
msg
(
'请选择需删除的文章'
);}
var
ids
=
checkRows
.
map
(
function
(
d
){
return
d
.
id
;});
console
.
log
(
ids
);
del
(
ids
);
});
/**/
$
(
'#coursecomment-add'
).
on
(
'click'
,
function
(){
coursecommentOpen
();});
/**/
/*弹出窗*/
function
pingjiaOpen
(
id
=
''
,
type
=
''
){
layer
.
open
({
type
:
2
,
area
:
[
'900px'
,
'90%'
],
title
:
"评价回复"
,
btn
:
[
'确定'
,
'关闭'
],
// fixed: false, //不固定
content
:
'/admin/course.course_comment/getcomment?id='
+
id
,
yes
:
function
(
index
,
layero
){
layer
.
close
(
index
);
},
});
}
/**/
});
</script>
\ No newline at end of file
app/model/CourseComment.php
View file @
9d77a40f
...
...
@@ -102,4 +102,11 @@ class CourseComment extends Model
->
withTrashed
()
->
select
();
}
//关联课程
public
function
course
()
{
return
$this
->
belongsTo
(
ShCourse
::
class
,
'course_id'
,
'id'
)
->
field
(
'id,title'
);
}
}
\ 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