Merge pull request '优化' (#660) from feature/testing_apply_top_promote into master

Reviewed-on: http://8.136.139.249:3000/wmtx/platform/pulls/660
master
廖金灵 3 years ago
commit 1ac11f2244

@ -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