Commit c7a765cd authored by fuyunnan's avatar fuyunnan

添加仓库服务和添加路由转化函数

parent 07c9648b
......@@ -10,4 +10,12 @@ namespace Meibuyu\Micro\Service\Interfaces;
interface StoreServiceInterface
{
/**
* 通过id列表获取仓库名称
* @param array $idList 仓库id的列表, 默认去重
* @param array $columns 仓库表的字段,默认显示全部
* @return array 默认keyBy('id')
*/
public function getByIdList(array $idList, array $columns = ['*']): array;
}
......@@ -451,6 +451,25 @@ if (!function_exists('putLog')) {
}
if (!function_exists('http_to_server_url')) {
/**
* description:将前端的绝对路径转化为服务端相对路径
* author: fuyunnan
* @param string $path 需要转化的路径
* @return string
* @throws
* Date: 2020/6/24
*/
function http_to_server_url($path)
{
$path =ltrim(parse_url($path,PHP_URL_PATH),'/');
return 'public/'.$path;
}
}
if (!function_exists('empty_string_2_null')) {
/**
* 空字符串转NULL
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment