trim key
This commit is contained in:
parent
814d1ff546
commit
bad83f9fb2
@ -306,11 +306,13 @@ class FlowPoolController extends Controller
|
||||
foreach ($data as $row) {
|
||||
foreach (['month', 'pool_id', 'sim', 'mebibyte'] as $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])) {
|
||||
throw new InvalidArgumentException("字段{$row[$key]}必须为数字");
|
||||
throw new InvalidArgumentException("字段{$key}必须为数字 #:{$row[$key]}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user