mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
改进Model类的时间类型转换
This commit is contained in:
@@ -137,7 +137,7 @@ class Controller
|
|||||||
* @param string|array $validate 验证器名或者验证规则数组
|
* @param string|array $validate 验证器名或者验证规则数组
|
||||||
* @param array $message 提示信息
|
* @param array $message 提示信息
|
||||||
* @param mixed $callback 回调方法(闭包)
|
* @param mixed $callback 回调方法(闭包)
|
||||||
* @return void
|
* @return true|string|array
|
||||||
*/
|
*/
|
||||||
public function validate($data, $validate, $message = [], $callback = null)
|
public function validate($data, $validate, $message = [], $callback = null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -874,7 +874,9 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
$value = (bool) $value;
|
$value = (bool) $value;
|
||||||
break;
|
break;
|
||||||
case 'datetime':
|
case 'datetime':
|
||||||
|
if (!is_numeric($value)) {
|
||||||
$value = strtotime($value);
|
$value = strtotime($value);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'object':
|
case 'object':
|
||||||
if (is_object($value)) {
|
if (is_object($value)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user