mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-10 17:42:50 +00:00
上传公共方法
This commit is contained in:
parent
be295236f2
commit
b7dd341b43
@ -177,4 +177,20 @@ if (!function_exists('sys_data')) {
|
||||
{
|
||||
return app('sysGroupData')->getData($name);
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('set_file_url')) {
|
||||
/**
|
||||
* 设置附加路径
|
||||
* @param $url
|
||||
* @return bool
|
||||
*/
|
||||
function set_file_url($image, $siteUrl = '')
|
||||
{
|
||||
if (!strlen(trim($siteUrl))) $siteUrl = sys_config('site_url');
|
||||
$domainTop = substr($image, 0, 4);
|
||||
if ($domainTop == 'http') return $image;
|
||||
$image = str_replace('\\', '/', $image);
|
||||
return $siteUrl . $image;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user