diff --git a/Application/Admin/Model/CoinPayOrderModel.class.php b/Application/Admin/Model/CoinPayOrderModel.class.php index b5bd300cb..ecfdbfcab 100644 --- a/Application/Admin/Model/CoinPayOrderModel.class.php +++ b/Application/Admin/Model/CoinPayOrderModel.class.php @@ -64,7 +64,7 @@ class CoinPayOrderModel extends Model{ ->where("id = '".$id."'") ->find(); 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; diff --git a/Application/Common/Common/function.php b/Application/Common/Common/function.php index 2567e25e8..b97ca1f90 100644 --- a/Application/Common/Common/function.php +++ b/Application/Common/Common/function.php @@ -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) {