修改接口类

This commit is contained in:
2020-10-20 17:34:42 +08:00
parent eaa683a4bb
commit b258e7ff63
3 changed files with 40 additions and 4 deletions
+3 -2
View File
@@ -260,9 +260,10 @@ function get_attach($id, $field = false, $is_list = false) {
} else {
$map[] = ['id', '=', $id];
$picture = \app\model\Attach::where($map)->find();
$picture['url'] = $basePath . $picture['url'];
if ($field == 'path') {
if (!empty($picture['url'])) {
$picture['path'] = $picture['url'] ? $basePath . $picture['url'] : $basePath . '/static/common/images/default.png';
if ($picture['path'] == '') {
$picture['path'] = $picture['url'] ? $picture['url'] : $basePath . '/static/common/images/default.png';
} else {
$picture['path'] = $picture['path'] ? $basePath . $picture['path'] : $basePath . '/static/common/images/default.png';
}