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
0cd0f550
Commit
0cd0f550
authored
Jun 05, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
43986753
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
apps/exams/Lib/Model/ExamsPaperModel.class.php
+1
-0
apps/news/Lib/Model/TopicsModel.class.php
+19
-3
No files found.
apps/exams/Lib/Model/ExamsPaperModel.class.php
View file @
0cd0f550
...
...
@@ -73,6 +73,7 @@ class ExamsPaperModel extends Model
$data
[
$key
][
'exams_module_title'
]
=
$this
->
getModuleTitleAttr
(
$v
[
'exams_module_id'
]);
$data
[
$key
][
'level_title'
]
=
$this
->
getLevelTitle
(
$v
[
'level'
]);
$data
[
$key
][
'is_buy'
]
=
$this
->
isBuy
(
$v
[
'exams_paper_id'
],
$this
->
mid
);
$data
[
$key
][
'attach'
]
=
''
;
if
(
$data
[
$key
][
'is_buy'
]
||
$v
[
'price'
]
==
0
)
{
$data
[
$key
][
'attach'
]
=
$this
->
getAttachPathByAttachId
(
$v
[
'attachment'
]);
}
...
...
apps/news/Lib/Model/TopicsModel.class.php
View file @
0cd0f550
...
...
@@ -35,6 +35,18 @@ class TopicsModel extends Model
{
return
$this
->
add
(
$data
);
}
protected
function
getAttachPathByAttachId
(
$attachid
)
{
if
(
empty
(
$attachid
))
{
return
''
;
}
if
(
$attachInfo
=
model
(
'Attach'
)
->
getAttachById
(
$attachid
))
{
return
'/data/upload/'
.
$attachInfo
[
'save_path'
]
.
$attachInfo
[
'save_name'
];
}
else
{
return
''
;
}
}
/**
* 获取资讯
* @param boolean $with_plat_form 传入机构时是否同时显示平台资讯
...
...
@@ -61,9 +73,13 @@ class TopicsModel extends Model
}
else
if
(
$type
==
4
)
{
//排序
$orders
=
'`re_sort` DESC'
;
}
var_dump
(
getAttachPathByAttachId
(
91
));
die
;
return
$this
->
where
(
$map
)
->
order
(
$orders
)
->
findPage
(
10
);
$results
=
$this
->
where
(
$map
)
->
order
(
$orders
)
->
findPage
(
10
);
foreach
(
$results
[
'data'
]
as
$key
=>
$result
)
{
if
(
$result
[
'image'
])
{
$results
[
'data'
][
$key
][
'cover'
]
=
$this
->
getAttachPathByAttachId
(
$result
[
'image'
]);
}
}
return
$results
;
}
public
function
setTj
(
$id
)
...
...
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