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