protected function parseDateTime($value, $key, $options = [], $bindName = null, $bindType = null)
{
// 获取时间字段类型
$type = $this->query->getFieldsType($options);
if (isset($type[$key])) {
$info = $type[$key];
}
if (isset($info)) {
$value = strtotime($value) ?: $value;
if (preg_match('/(datetime|timestamp)/is', $info)) {
// 日期及时间戳类型
$value = date('Y-m-d H:i:s', $value);
} elseif (preg_match('/(date)/is', $info)) {
// 日期及时间戳类型
$value = date('Y-m-d', $value);
}
}
$bindName = $bindName ?: $key;
$this->query->bind($bindName, $value, $bindType);
return ':' . $bindName;
}