增加日期和时间查询方法 datetime

This commit is contained in:
thinkphp
2016-06-13 16:27:59 +08:00
parent 101bfb3f83
commit a9cfe2a801
2 changed files with 51 additions and 6 deletions

View File

@@ -1227,6 +1227,20 @@ class Query
return $this;
}
/**
* 查询日期或者时间
* @access public
* @param string $field 日期字段名
* @param string $op 比较运算 > < between not between
* @param string|array $range 比较范围
* @return $this
*/
public function datetime($field, $op, $range = [])
{
$this->where($field, strtolower($op) . ' time', $range);
return $this;
}
/**
* 获取数据表信息
* @access public