日常更新

This commit is contained in:
2019-09-29 21:19:30 +08:00
parent c29b8358be
commit 07faf60918
196 changed files with 1367 additions and 524 deletions

View File

@@ -249,14 +249,14 @@ function get_nav_url($url) {
*/
function get_cover($cover_id, $field = null) {
if (empty($cover_id)) {
return BASE_PATH . '/static/images/default.png';
return '/static/common/images/default.png';
}
$picture = db('Picture')->where(array('status' => 1, 'id' => $cover_id))->find();
$picture = \think\facade\Db::name('Picture')->where(array('status' => 1, 'id' => $cover_id))->find();
if ($field == 'path') {
if (!empty($picture['url'])) {
$picture['path'] = $picture['url'] ? BASE_PATH . $picture['url'] : BASE_PATH . '/static/images/default.png';
$picture['path'] = $picture['url'] ? $picture['url'] : '/static/common/images/default.png';
} else {
$picture['path'] = $picture['path'] ? BASE_PATH . $picture['path'] : BASE_PATH . '/static/images/default.png';
$picture['path'] = $picture['path'] ? $picture['path'] : '/static/common/images/default.png';
}
}
return empty($field) ? $picture : $picture[$field];