Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eduline
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冷斌
eduline
Commits
1fa66dcf
Commit
1fa66dcf
authored
Jun 07, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
0745dcad
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
3 deletions
+27
-3
apps/exams/Lib/Action/IndexAction.class.php
+25
-1
apps/exams/Tpl/default/Index/examsroom_w3g.html
+1
-1
apps/home/Tpl/default/Home/exams_w3g.html
+1
-1
No files found.
apps/exams/Lib/Action/IndexAction.class.php
View file @
1fa66dcf
...
@@ -335,7 +335,7 @@ class IndexAction extends Action
...
@@ -335,7 +335,7 @@ class IndexAction extends Action
}
}
// 是否收藏
// 是否收藏
$paper
[
'iscollect'
]
=
D
(
'ZyCollection'
,
'classroom'
)
->
isCollect
(
$paper_id
,
'exams_
question
'
,
intval
(
$this
->
mid
));
$paper
[
'iscollect'
]
=
D
(
'ZyCollection'
,
'classroom'
)
->
isCollect
(
$paper_id
,
'exams_
paper
'
,
intval
(
$this
->
mid
));
$this
->
assign
(
'paper'
,
$paper
);
$this
->
assign
(
'paper'
,
$paper
);
// 是否练习模式
// 是否练习模式
...
@@ -647,6 +647,30 @@ class IndexAction extends Action
...
@@ -647,6 +647,30 @@ class IndexAction extends Action
}
}
public
function
collect2
()
{
if
(
$_POST
)
{
$action
=
(
$_POST
[
'action'
]
==
'1'
)
?
1
:
0
;
$data
[
'uid'
]
=
intval
(
$this
->
mid
);
$data
[
'source_id'
]
=
intval
(
$_POST
[
'source_id'
]);
$data
[
'source_table_name'
]
=
'exams_paper'
;
// 收藏
$mod
=
D
(
'ZyCollection'
,
'classroom'
);
if
(
$action
===
1
)
{
$data
[
'ctime'
]
=
time
();
if
(
$mod
->
addcollection
(
$data
))
{
echo
json_encode
([
'status'
=>
1
,
'data'
=>
[
'info'
=>
'收藏成功'
]]);
exit
;
}
}
else
{
if
(
$mod
->
delcollection
(
$data
[
'source_id'
],
$data
[
'source_table_name'
],
$data
[
'uid'
]))
{
echo
json_encode
([
'status'
=>
1
,
'data'
=>
[
'info'
=>
'取消收藏成功'
]]);
exit
;
}
}
echo
json_encode
([
'status'
=>
0
,
'message'
=>
$mod
->
getError
()]);
exit
;
}
}
/**
/**
* 查看试题详情
* 查看试题详情
* @Author MartinSun<syh@sunyonghong.com>
* @Author MartinSun<syh@sunyonghong.com>
...
...
apps/exams/Tpl/default/Index/examsroom_w3g.html
View file @
1fa66dcf
...
@@ -271,7 +271,7 @@
...
@@ -271,7 +271,7 @@
$
.
ajax
({
$
.
ajax
({
type
:
'POST'
,
type
:
'POST'
,
url
:
"{:U('exams/Index/collect')}"
,
url
:
"{:U('exams/Index/collect
2
')}"
,
data
:
{
data
:
{
action
:
isCollect
,
action
:
isCollect
,
source_id
:
"{$paper.exams_paper_id}"
,
source_id
:
"{$paper.exams_paper_id}"
,
...
...
apps/home/Tpl/default/Home/exams_w3g.html
View file @
1fa66dcf
...
@@ -417,7 +417,7 @@
...
@@ -417,7 +417,7 @@
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
.
status
==
1
)
{
if
(
res
.
status
==
1
)
{
let
array
=
res
.
data
.
data
.
length
>
0
?
res
.
data
.
data
:
[]
let
array
=
res
.
data
.
data
.
length
>
0
?
res
.
data
.
data
:
[]
that
.
download
=
[].
concat
(
array
.
map
(
r
=>
{
that
.
myCollect
=
[].
concat
(
array
.
map
(
r
=>
{
return
{
return
{
id
:
r
.
exams_paper_id
,
id
:
r
.
exams_paper_id
,
title
:
r
.
exams_paper_title
,
title
:
r
.
exams_paper_title
,
...
...
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