Skip to content

Commit 64638a5

Browse files
committed
some update ...
1 parent 52229f6 commit 64638a5

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ public function get(string $key, $default = null)
560560
`trim` | 去除首尾空白字符,支持数组。 | `['username', 'min', 4, 'filter' => 'trim'],`
561561
`lowercase` | 字符串转换为小写 | `['description', 'min', 4, 'filter' => 'lowercase'],`
562562
`uppercase` | 字符串转换为大写 | `['title', 'min', 4, 'filter' => 'uppercase'],`
563-
`strToTime` | 字符串日期转换时间戳 | `['pulishedAt', 'number', 'filter' => 'strToTime'],`
563+
`timestamp/strToTime` | 字符串日期转换时间戳 | `['pulishedAt', 'number', 'filter' => 'strToTime'],`
564564
`abs` | 返回绝对值 | `['field', 'int', 'filter' => 'abs'],`
565565
`url` | URL 过滤,移除所有不符合 URL 的字符 | `['field', 'url', 'filter' => 'url'],`
566566
`email` | email 过滤,移除所有不符合 email 的字符 | `['field', 'email', 'filter' => 'email'],`

examples/PageRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function rules()
2626
];
2727
}
2828

29-
public function attrTrans()
29+
public function translates()
3030
{
3131
return [
3232
'userId' => '用户Id',

src/Filter/FilterList.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,16 @@ public static function uppercase($var)
138138
return Helper::strToUpper($var);
139139
}
140140

141+
/**
142+
* string to time
143+
* @param string $var
144+
* @return int
145+
*/
146+
public static function timestamp($var)
147+
{
148+
return self::strToTime($var);
149+
}
150+
141151
/**
142152
* string to time
143153
* @param string $var

src/ValidationTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ trait ValidationTrait
5050
* used rules at current scene
5151
* @var array
5252
*/
53-
private $_usedRules = [];
53+
protected $_usedRules = [];
5454

5555
/** @var bool */
5656
private $_validated = false;

0 commit comments

Comments
 (0)