mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
改进Model类一处大小写字段的识别错误
This commit is contained in:
@@ -260,7 +260,7 @@ class Model
|
||||
// 检查非数据字段
|
||||
if (!empty($fields)) {
|
||||
foreach ($data as $key => $val) {
|
||||
if (!in_array(strtolower($key), $fields, true)) {
|
||||
if (!in_array($key, $fields, true)) {
|
||||
if (Config::get('db_fields_strict')) {
|
||||
throw new Exception(' fields not exists :[ ' . $key . ' ]');
|
||||
}
|
||||
@@ -1259,7 +1259,7 @@ class Model
|
||||
$range = is_array($rule) ? $rule : explode(',', $rule);
|
||||
$result = 'in' == $type ? in_array($value, $range) : !in_array($value, $range);
|
||||
break;
|
||||
case 'between':// 验证是否在某个范围
|
||||
case 'between': // 验证是否在某个范围
|
||||
case 'notbetween': // 验证是否不在某个范围
|
||||
if (is_string($rule)) {
|
||||
$rule = explode(',', $rule);
|
||||
|
||||
@@ -73,7 +73,9 @@ class routeTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$this->assertEquals(['type' => 'module', 'module' => ['hello', null, null]], Route::parseUrl('hello'));
|
||||
$this->assertEquals(['type' => 'module', 'module' => ['index', 'hello', null]], Route::parseUrl('index/hello'));
|
||||
$this->assertEquals(['type' => 'module', 'module' => ['index', 'hello', null]], Route::parseUrl('index/hello?name=thinkphp'));
|
||||
$this->assertEquals(['type' => 'module', 'module' => ['index', 'user', 'hello']], Route::parseUrl('index/user/hello'));
|
||||
$this->assertEquals(['type' => 'module', 'module' => ['index', 'user', 'hello']], Route::parseUrl('index/user/hello/name/thinkphp'));
|
||||
$this->assertEquals(['type' => 'module', 'module' => ['index', 'index', 'hello']], Route::parseUrl('index-index-hello', '-'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user