This commit is contained in:
邓皓元 2019-04-22 09:46:26 +08:00
parent 814d1ff546
commit bad83f9fb2

View File

@ -306,11 +306,13 @@ class FlowPoolController extends Controller
foreach ($data as $row) { foreach ($data as $row) {
foreach (['month', 'pool_id', 'sim', 'mebibyte'] as $key) { foreach (['month', 'pool_id', 'sim', 'mebibyte'] as $key) {
if (!isset($row[$key])) { if (!isset($row[$key])) {
throw new InvalidArgumentException("字段{$row[$key]}不能为空"); throw new InvalidArgumentException("字段{$key}不能为空 #:{$row[$key]}");
} }
$row[$key] = trim($row[$key]);
if (!is_numeric($row[$key])) { if (!is_numeric($row[$key])) {
throw new InvalidArgumentException("字段{$row[$key]}必须为数字"); throw new InvalidArgumentException("字段{$key}必须为数字 #:{$row[$key]}");
} }
} }
} }