Method |
Description |
|
__construct ( $conf ) |
|
|
__destruct ( ) |
析构函数 |
|
_and ( ) |
增加 and条件操作符 |
|
_or ( ) |
增加or条件操作符 |
|
affectedRows ( resource $handle, integer $type ) : integer |
返回INSERT,UPDATE 或 DELETE 查询所影响的记录行数。 |
|
avg ( string $field = '*', boolean | string $isMulti = false, boolean | string $useMaster = false ) : mixed |
获取 AVG(字段名或*) 的结果 |
|
buildSql ( null $offset = null, null $limit = null, boolean $isSelect = false ) : string | array |
构建sql |
|
callProcedure ( string $procedureName = '', array $bindParams = [], boolean | true $isSelect = true ) : array | integer |
调用存储过程
如 : callProcedure('user_check ?,? ', [1, 1], true) pdo |
|
chunk ( integer $num = 100, callable $func ) |
组块结果集 |
|
columns ( string | array $columns = '*' ) |
选择列 |
|
commit ( ) : boolean |
提交事务 |
|
conditionFactory ( string $column, array | integer | string $value, string $operator = '=' ) |
where 语句组装工厂 |
|
connect ( string $host, string $username, string $password, string $dbName, string $charset = 'utf8', string $engine = '', boolean $pConnect = false ) : mixed |
Db连接 |
|
count ( string $field = '*', boolean $isMulti = false, boolean | string $useMaster = false ) : mixed |
获取 COUNT(字段名或*) 的结果 |
|
decrement ( string $key, integer $val = 1, string $field = null, mixed $tablePrefix = null ) : boolean |
指定字段的值-1 |
|
delete ( string $key = '', boolean $and = true, mixed $tablePrefix = null ) : boolean |
根据key值删除数据 |
|
get ( string $key, boolean $and = true, boolean | string $useMaster = false, null | string $tablePrefix = null ) |
根据key取出数据 |
|
getAllTableStatus ( ) : array |
获取当前数据库中所有表的信息 |
|
getDbFields ( string $table, mixed $tablePrefix = null, integer $filter ) : mixed |
获取表字段 |
|
getOne ( boolean $useMaster = false ) : array | boolean |
获取一条数据 |
|
getOneValue ( string $column, boolean $useMaster = false ) : boolean | mixed |
获取一列 |
|
getPk ( string $table, string $tablePrefix = null ) : string |
获取表主键 |
|
getTables ( ) : array |
获取当前db所有表名 |
|
groupBy ( string $column ) |
分组 |
|
having ( string $column, string $operator = '=', string $value ) |
having语句 |
|
increment ( string $key, integer $val = 1, string $field = null, mixed $tablePrefix = null ) : boolean |
指定字段的值+1 |
|
insertId ( resource $link = null ) : integer |
获取上一INSERT的主键值 |
|
join ( string | array $table, string $on, mixed $tablePrefix = null ) |
join内联结 |
|
lBrackets ( ) |
where条件增加左括号 |
|
leftJoin ( string | array $table, string $on, mixed $tablePrefix = null ) |
leftJoin左联结 |
|
limit ( integer $offset, integer $limit = 10 ) |
LIMIT |
|
max ( string $field = '*', boolean | string $isMulti = false, boolean | string $useMaster = false ) : mixed |
获取 MAX(字段名或*) 的结果 |
|
min ( string $field = '*', boolean | string $isMulti = false, boolean | string $useMaster = false ) : mixed |
获取 MIN(字段名或*) 的结果 |
|
orderBy ( string $column, string $order = 'ASC' ) |
排序 |
|
paginate ( integer $limit, boolean $useMaster = false ) : array |
分页获取数据 |
|
plunk ( string $column, null $key = null, integer $limit = null, boolean $useMaster = false ) : array |
获取数据列值列表 |
|
rBrackets ( ) |
where条件增加右括号 |
|
rightJoin ( string | array $table, string $on, mixed $tablePrefix = null ) |
rightJoin右联结 |
|
rollBack ( boolean $rollBackTo = false ) : boolean |
回滚事务 |
|
savePoint ( string $pointName ) : boolean |
设置一个事务保存点 |
|
select ( integer $offset = null, integer $limit = null, boolean $useMaster = false ) : array |
获取多条数据 |
|
set ( string $table, array $data, mixed $tablePrefix = null ) : boolean | integer |
根据key 新增 一条数据 |
|
startTransAction ( ) : boolean |
开启事务 |
|
sum ( string $field = '*', boolean | string $isMulti = false, boolean | string $useMaster = false ) : mixed |
获取 SUM(字段名或*) 的结果 |
|
table ( string | array $table = '', mixed $tablePrefix = null ) |
定义操作的表 |
|
truncate ( string $tableName ) : boolean |
根据表名删除数据 |
|
union ( string | array $sql, boolean $all = false ) |
union联结 |
|
update ( string $key, array | null $data = null, boolean $and = true, mixed $tablePrefix = null ) : boolean |
根据key更新一条数据 |
|
version ( resource $link = null ) : string |
获取数据库 版本 |
|
where ( string | array $column, string | integer $value = '' ) |
where条件组装 相等 |
|
whereBetween ( string $column, string | integer | array $value, string | integer | null $value2 = null ) |
where条件组装 BETWEEN |
|
whereGt ( string $column, string | integer $value ) |
where条件组装 大于 |
|
whereGte ( string $column, string | integer $value ) |
where条件组装 大于等于 |
|
whereIn ( string $column, array $value ) |
where条件组装 in |
|
whereLike ( string $column, boolean $leftBlur = false, string | integer $value, boolean $rightBlur = false ) |
where条件组装 LIKE |
|
whereLt ( string $column, string | integer $value ) |
where条件组装 小于 |
|
whereLte ( string $column, string | integer $value ) |
where条件组装 小于等于 |
|
whereNot ( string $column, string | integer $value ) |
where条件组装 不等 |
|
whereNotBetween ( string $column, string | integer | array $value, string | integer | null $value2 = null ) |
where条件组装 NOT BETWEEN |
|
whereNotIn ( string $column, array $value ) |
where条件组装 not in |
|
whereNotLike ( string $column, boolean $leftBlur = false, string | integer $value, boolean $rightBlur = false ) |
where条件组装 LIKE |
|
whereNotNull ( string $column ) |
where条件组装 IS NOT NULL |
|
whereNull ( string $column ) |
where条件组装 IS NULL |
|
whereRegExp ( string $column, string | integer $value ) |
where条件组装 REGEXP |
|