Commit 6251f866 authored by jiangkebao's avatar jiangkebao

Merge branch 'master' of git.huaperfect.com:hwq/micro

parents a099775c c7a765cd
...@@ -25,7 +25,7 @@ abstract class BaseRepository implements RepositoryInterface ...@@ -25,7 +25,7 @@ abstract class BaseRepository implements RepositoryInterface
/** /**
* @var ContainerInterface * @var ContainerInterface
*/ */
private $container; protected $container;
/** /**
* @var RequestInterface * @var RequestInterface
......
...@@ -10,4 +10,12 @@ namespace Meibuyu\Micro\Service\Interfaces; ...@@ -10,4 +10,12 @@ namespace Meibuyu\Micro\Service\Interfaces;
interface StoreServiceInterface interface StoreServiceInterface
{ {
/**
* 通过id列表获取仓库名称
* @param array $idList 仓库id的列表, 默认去重
* @param array $columns 仓库表的字段,默认显示全部
* @return array 默认keyBy('id')
*/
public function getByIdList(array $idList, array $columns = ['*']): array;
} }
...@@ -124,6 +124,9 @@ class ExcelImporter ...@@ -124,6 +124,9 @@ class ExcelImporter
public function checkRequire($requires, &$errorCount) public function checkRequire($requires, &$errorCount)
{ {
foreach ($requires as $k => $v) { foreach ($requires as $k => $v) {
if ($v == '0') {
continue;
}
if (!$v || $v === '') { if (!$v || $v === '') {
$this->setErrorMessage($k . "不能为空", $errorCount); $this->setErrorMessage($k . "不能为空", $errorCount);
return false; return false;
...@@ -141,7 +144,7 @@ class ExcelImporter ...@@ -141,7 +144,7 @@ class ExcelImporter
public function checkNumeric($data, &$errorCount) public function checkNumeric($data, &$errorCount)
{ {
foreach ($data as $k => $v) { foreach ($data as $k => $v) {
if (!$v || $v === '') { if (!$v || $v === '' || $v == '0') {
continue; continue;
} else { } else {
if (!is_numeric($v)) { if (!is_numeric($v)) {
......
...@@ -266,7 +266,7 @@ class Exporter ...@@ -266,7 +266,7 @@ class Exporter
* @param $pRange * @param $pRange
* @throws \PhpOffice\PhpSpreadsheet\Exception * @throws \PhpOffice\PhpSpreadsheet\Exception
*/ */
private function applyStyle($pRange) public function applyStyle($pRange)
{ {
$styleArray = [ $styleArray = [
'borders' => [ 'borders' => [
......
...@@ -451,6 +451,25 @@ if (!function_exists('putLog')) { ...@@ -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')) { if (!function_exists('empty_string_2_null')) {
/** /**
* 空字符串转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