切换导航条
此项目
正在载入...
登录
潘浩文
/
scoreshop
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
潘浩文
6 years ago
提交
399be7c97827aa509a62030345a4ba8f068f5ae8
1 个父辈
31793f40
1 个管道 的构建
通过
耗费 0 秒
1
变更
3
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
97 行增加
和
6 行删除
app/portal/controller/BrandController.php
public/themes/admin_simpleboot3/portal/admin_brand/index.html
public/themes/simpleboot3/portal/brand/comment.html
app/portal/controller/BrandController.php
查看文件 @
399be7c
...
...
@@ -70,7 +70,7 @@ class BrandController extends WeChatBaseController
$where
[
'b.name'
]
=
[
'like'
,
'%'
.
$param
[
'search'
]
.
'%'
];
}
if
(
!
empty
(
$param
[
'order'
])){
$order
[
'b.like'
]
=
'desc'
;
$order
[
'b.
do
like'
]
=
'desc'
;
}
else
{
$order
[
'b.create_time'
]
=
'desc'
;
}
...
...
@@ -144,16 +144,23 @@ class BrandController extends WeChatBaseController
//品牌评论页面
public
function
comment
(){
$this
->
checkUser
();
$id
=
$this
->
request
->
param
(
'id'
);
$this
->
assign
(
'id'
,
$id
);
return
$this
->
fetch
();
}
public
function
commentPost
(){
$re
=
$this
->
checkUser
();
$param
=
$this
->
request
->
param
();
$param
[
'users_id'
]
=
session
(
'wechat_user'
)[
'users_id'
];
Db
::
name
(
'comment'
)
->
insert
(
$param
);
Db
::
name
(
'brand'
)
->
where
(
'id'
,
$param
[
'cid'
])
->
setInc
(
'comment'
,
1
);
$this
->
redirect
(
'portal/brand/brandComment'
,[
'id'
=>
$param
[
'cid'
]]);
$param
[
'users_id'
]
=
$re
[
'id'
];
$re1
=
Db
::
name
(
'comment'
)
->
insert
(
$param
);
$re2
=
Db
::
name
(
'brand'
)
->
where
(
'id'
,
$param
[
'cid'
])
->
setInc
(
'comment'
,
1
);
if
(
$re1
&&
$re2
)
{
$url
=
url
(
'portal/brand/brandComment'
,
array
(
'id'
=>
$param
[
'cid'
]));
return
$url
;
}
else
{
return
0
;
}
}
//点赞ajax接口
public
function
like
(){
...
...
public/themes/admin_simpleboot3/portal/admin_brand/index.html
查看文件 @
399be7c
...
...
@@ -53,7 +53,7 @@
<td>
{$vo.bc1name}
</td>
<td>
{$vo.bc2name}
</td>
<td>
{$vo.address}
</td>
<td>
{$vo.like}
</td>
<td>
{$vo.
do
like}
</td>
<td>
{$vo.comment}
</td>
<td>
{:date('Y-m-d H:i',$vo['create_time'])}
</td>
<td>
...
...
public/themes/simpleboot3/portal/brand/comment.html
0 → 100644
查看文件 @
399be7c
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"
/>
<link
rel=
"stylesheet"
href=
"__TMPL__/public/assets/css/base.css"
>
<script
type=
"text/javascript"
src=
"__TMPL__/public/assets/js/base.js"
></script>
<title>
写评价
</title>
<style>
body
,
html
{
background
:
#fff
;
}
.evalute
{
width
:
6.86rem
;
margin
:
0
auto
;
height
:
3.6rem
;
background
:
#F7F8FA
;
margin-top
:
0.35rem
;
border-radius
:
0.1rem
;
}
.write
{
width
:
6.86rem
;
margin
:
0
auto
;
height
:
3.6rem
;
background
:
#F7F8FA
;
margin-top
:
0.35rem
;
border-radius
:
0.1rem
;
border
:
none
;
outline
:
none
;
padding-left
:
0.31rem
;
color
:
#999999
;
font-size
:
0.33rem
;
}
.footer
{
width
:
6.86rem
;
text-align
:
center
;
height
:
0.88rem
;
line-height
:
0.88rem
;
position
:
fixed
;
bottom
:
0.55rem
;
left
:
0
;
right
:
0
;
margin
:
0
auto
;
background
:
#CA277B
;
border-radius
:
0.44rem
;
color
:
#fff
;
font-size
:
0.32rem
;
}
</style>
</head>
<body>
<div
class=
"container"
>
<div
class=
"evalute"
>
<textarea
name=
""
id=
"comment"
cols=
"30"
rows=
"10"
class=
"write"
placeholder=
"请写下您的评价"
></textarea>
</div>
</div>
<div
class=
"footer"
>
发表
</div>
<script>
$
(
".footer"
).
click
(
function
(){
var
comment
=
$
(
"#comment"
).
val
()
// alert("{$list.id}")
$
.
ajax
({
url
:
"{:url('portal/brand/commentPost')}"
,
type
:
"post"
,
data
:
{
cid
:
"{$id}"
,
comment
:
comment
,
},
success
:
function
(
data
)
{
if
(
data
!=
0
){
alert
(
'评论成功'
)
window
.
location
.
href
=
data
;
}
else
if
(
data
==
2
){
alert
(
'评论失败'
)
return
false
;
}
}
})
})
</script>
</body>
</html>
...
...
请
注册
或
登录
后发表评论