切换导航条
此项目
正在载入...
登录
潘浩文
/
scoreshop
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
潘浩文
6 years ago
提交
91159e2c9a68411749c2baae3b7e4878721c0acc
1 个父辈
e804e85c
1 个管道 的构建
通过
耗费 0 秒
1
变更
3
构建
1
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
60 行增加
和
50 行删除
app/portal/controller/PrizeController.php
public/themes/simpleboot3/portal/active/active_detail.html
public/themes/simpleboot3/portal/prize/prize_detail.html
app/portal/controller/PrizeController.php
查看文件 @
91159e2
...
...
@@ -73,40 +73,9 @@ class PrizeController extends WeChatBaseController
$this
->
assign
(
'list'
,
$data
);
return
$this
->
fetch
(
'active_detail'
);
}
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
[
'create_time'
]
=
time
();
$param
[
'status'
]
=
2
;
$param
[
'users_id'
]
=
$re
[
'id'
];
$result
=
Db
::
name
(
'comment'
)
->
where
([
'users_id'
=>
$param
[
'users_id'
],
'status'
=>
2
,
'cid'
=>
$param
[
'cid'
]])
->
find
();
if
(
$result
){
return
2
;
}
$re1
=
Db
::
name
(
'comment'
)
->
insert
(
$param
);
$re2
=
Db
::
name
(
'active'
)
->
where
(
'id'
,
$param
[
'cid'
])
->
setInc
(
'comment'
,
1
);
if
(
$re1
&&
$re2
)
{
$url
=
url
(
'portal/active/activeDetail'
,
array
(
'id'
=>
$param
[
'cid'
]));
return
$url
;
}
else
{
return
0
;
}
}
//点赞ajax接口
public
function
like
(){
$re
=
$this
->
checkUser
();
$param
=
$this
->
request
->
param
();
$like
=
new
LikeService
();
return
$like
->
like
(
$param
[
'id'
],
2
,
$re
[
'id'
]);
}
...
...
@@ -173,6 +142,41 @@ class PrizeController extends WeChatBaseController
$this
->
assign
(
'list'
,
$data
);
return
$this
->
fetch
(
'prize_detail'
);
}
//点赞ajax接口
public
function
like
(){
$re
=
$this
->
checkUser
();
$param
=
$this
->
request
->
param
();
$like
=
new
LikeService
();
return
$like
->
like
(
$param
[
'id'
],
3
,
$re
[
'id'
]);
}
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
[
'create_time'
]
=
time
();
$param
[
'status'
]
=
3
;
$param
[
'users_id'
]
=
$re
[
'id'
];
$result
=
Db
::
name
(
'comment'
)
->
where
([
'users_id'
=>
$param
[
'users_id'
],
'status'
=>
3
,
'cid'
=>
$param
[
'cid'
]])
->
find
();
if
(
$result
){
return
2
;
}
$re1
=
Db
::
name
(
'comment'
)
->
insert
(
$param
);
$re2
=
Db
::
name
(
'prize'
)
->
where
(
'id'
,
$param
[
'cid'
])
->
setInc
(
'comment'
,
1
);
if
(
$re1
&&
$re2
)
{
$url
=
url
(
'portal/prize/prizeDetail'
,
array
(
'id'
=>
$param
[
'cid'
]));
return
$url
;
}
else
{
return
0
;
}
}
...
...
public/themes/simpleboot3/portal/active/active_detail.html
查看文件 @
91159e2
...
...
@@ -287,10 +287,6 @@
})
//评论留言
$
(
".comment"
).
click
(
function
(){
window
.
location
.
href
=
'writeevalute.html'
})
//点赞
$
(
".praise"
).
click
(
function
(){
$
.
ajax
({
...
...
public/themes/simpleboot3/portal/prize/prize_detail.html
查看文件 @
91159e2
...
...
@@ -401,22 +401,32 @@
}
})
//评论留言
$
(
".comment"
).
click
(
function
(){
window
.
location
.
href
=
'writeevalute.html'
})
//立即兑换
$
(
".right_now"
).
click
(
function
(){
window
.
location
.
href
=
'uploadticket.html'
})
//点赞
$
(
".discuss"
).
click
(
function
(){
window
.
event
.
stopPropagation
();
var
num
=
$
(
".commentnum"
).
html
();
num
++
;
$
(
".commentnum"
).
html
(
num
)
$
(
".praise"
).
click
(
function
(){
$
.
ajax
({
url
:
"{:url('portal/prize/like')}"
,
type
:
"post"
,
data
:
{
id
:
"{$list.id}"
,
},
success
:
function
(
data
)
{
if
(
data
==
1
){
alert
(
'点赞成功'
)
window
.
event
.
stopPropagation
();
var
num
=
$
(
".commentnum"
).
html
();
num
++
;
$
(
".commentnum"
).
html
(
num
)
}
else
if
(
data
==
2
){
alert
(
'取消点赞成功'
)
window
.
event
.
stopPropagation
();
var
num
=
$
(
".commentnum"
).
html
();
num
--
;
$
(
".commentnum"
).
html
(
num
)
}
}
})
})
</script>
</body>
...
...
请
注册
或
登录
后发表评论