master
elf 3 years ago
parent 0b36e03a2f
commit aaf5d74952

@ -64,7 +64,7 @@ class CoinPayOrderModel extends Model{
->where("id = '".$id."'") ->where("id = '".$id."'")
->find(); ->find();
if(!empty($info['voucher_img'])){ if(!empty($info['voucher_img'])){
$info['voucher_img'] = get_cover($info['voucher_img'])['path']; $info['voucher_img'] = get_local_cover($info['voucher_img'])['path'];
} }
return $info; return $info;

@ -1053,6 +1053,36 @@ function get_cover($cover_id, $field = null, $root = 1, $flag = true)
} }
function get_local_cover($cover_id, $field = null, $root = 1, $flag = true)
{
if (empty($cover_id)) {
return "";
}
$picture = M('Picture')->where(array('status' => 1))->getById($cover_id);
if ($field == 'path') {
if (!empty($picture['url']) && get_tool_status('qiniu_storage') == 1) {
$picture['path'] = $picture['url'];
} else {
if ($picture['water'] && MODULE_NAME != 'Admin' && $flag && (C('watermark.status') == 1)) {
$rp = realpath(dirname(__FILE__) . '/../../../');
if (is_file($rp . $picture['water'])) {
$field = 'water';
}
} else {
if ($root == 1) {
$picture['path'] = __ROOT__ . $picture['path'];
}
}
}
}
return empty($field) ? $picture : $picture[$field];
}
function get_file($cover_id, $field = null) function get_file($cover_id, $field = null)
{ {

Loading…
Cancel
Save