mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-09 16:12:49 +08:00
格式测试文件代码
This commit is contained in:
@@ -1682,7 +1682,7 @@ class Model
|
||||
} else {
|
||||
$this->_join($join, $condition); // 兼容原来的join写法
|
||||
}
|
||||
} elseif (in_array(strtoupper($condition), array('INNER', 'LEFT', 'RIGHT', 'ALL'))) {
|
||||
} elseif (in_array(strtoupper($condition), ['INNER', 'LEFT', 'RIGHT', 'ALL'])) {
|
||||
$this->_join($join, $condition); // 兼容原来的join写法
|
||||
} else {
|
||||
$prefix = $this->tablePrefix;
|
||||
|
||||
@@ -60,7 +60,9 @@ class modelTest extends \PHPUnit_Framework_TestCase
|
||||
],
|
||||
'user' => [
|
||||
['username', [&$this, 'checkName'], '用户名长度为5到15个字符', 'callback', 'username'],
|
||||
['username', function ($value, $data) {return 'admin' == $value ? '此用户名已被使用' : true;}],
|
||||
['username', function ($value, $data) {
|
||||
return 'admin' == $value ? '此用户名已被使用' : true;
|
||||
}],
|
||||
'nickname' => ['require', '请填昵称'],
|
||||
'password' => ['[\w-]{6,15}', '密码长度为6到15个字符'],
|
||||
'repassword' => ['password', '两次密码不一到致', 'confirm'],
|
||||
@@ -382,7 +384,8 @@ EOF;
|
||||
$data = [
|
||||
'1' => 'test',
|
||||
'2' => 'test2',
|
||||
]; $this->assertEquals($data, $result);
|
||||
];
|
||||
$this->assertEquals($data, $result);
|
||||
|
||||
$time = $user_model->where(['status' => 1])->cache('user_create_time')->getField('create_time');
|
||||
$ids = $user_model->where(['status' => 1])->cache('user_id')->getField('id', true);
|
||||
|
||||
Reference in New Issue
Block a user