oss_think / think-orm
think orm ,somethings update
v2.0.60
2022-06-09 05:55 UTC
Requires
- php: >=7.1.0
- ext-json: *
- ext-pdo: *
- oss_think/think-helper: ^3.1
- psr/log: ~1.0
- psr/simple-cache: ^1.0
Requires (Dev)
- phpunit/phpunit: ^7|^8|^9.5
- 2.0.x-dev
- v2.0.60
- v2.0.59
- v2.0.58
- v2.0.57
- v2.0.56
- v2.0.55
- v2.0.53
- v2.0.52
- v2.0.51
- v2.0.50
- v2.0.45
- v2.0.44
- v2.0.43
- v2.0.42
- v2.0.41
- v2.0.40
- v2.0.39
- v2.0.38
- v2.0.37
- v2.0.36
- v2.0.35
- v2.0.34
- v2.0.33
- v2.0.32
- v2.0.31
- v2.0.30
- v2.0.29
- v2.0.28
- v2.0.27
- v2.0.26
- v2.0.25
- v2.0.24
- v2.0.23
- v2.0.22
- v2.0.21
- v2.0.20
- v2.0.19
- v2.0.18
- v2.0.17
- v2.0.16
- v2.0.15
- v2.0.14
- v2.0.13
- v2.0.12
- v2.0.11
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.2.17
- v1.2.16
- v1.2.15
- v1.2.14
- v1.2.13
- v1.2.12
- v1.2.11
- v1.2.10
- v1.2.9
- v1.2.8
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2
- v1.1
- v1.0
- v0.9
- v0.8
- v0.7
- 0.6
- 0.5
- 0.4
- 0.3
- 0.2
- 0.1
- dev-master
This package is auto-updated.
Last update: 2024-11-09 11:31:07 UTC
README
基于PHP7.1+ 和PDO实现的ORM,支持多数据库,2.0版本主要特性包括:
- 基于PDO和PHP强类型实现
- 支持原生查询和查询构造器
- 自动参数绑定和预查询
- 简洁易用的查询功能
- 强大灵活的模型用法
- 支持预载入关联查询和延迟关联查询
- 支持多数据库及动态切换
- 支持
MongoDb
- 支持分布式及事务
- 支持断点重连
- 支持
JSON
查询 - 支持数据库日志
- 支持
PSR-16
缓存及PSR-3
日志规范
安装
composer require oss_think/think-orm
##升级
composer update oss_think/think-orm
文档
详细参考 ThinkORM开发指南
案例
public function test_sql(){
$where["((key_1&key_2)|(key_9))|(key_3&key_4)|((key_5&key_6)&(key_7&key_8))&(key_10)"] = array(
array(
array(
array("like","%jack%",array("1","2")),
array("like","%key2%")
),
array(
array("eq","key_9")
)
),
array(
array("like","%key_3%"),
array("like","%key_4%")
),
array(
array(
array("like","key_5"),
array("like","key_6")
),
array(
array("like","key_7"),
array("gt",8)
)
),
array(
array("between",array("1",1000))
)
);
$where["_op"] = "OR";//默认是 AND
$where["status"] = 1;
$data = Db::name("help_goods_son")
->whereCreate($where)
->fetchSql(true)
->select();
p($data);
出来的效果如
SELECT * FROM `gyx_help_goods_son` WHERE ( ( ( key_1 LIKE '%jack%'AND key_2 LIKE '%key2%') OR ( key_9 = 'key_9') ) OR ( key_3 LIKE '%key_3%'AND key_4 LIKE '%key_4%') OR ( ( key_5 LIKE 'key_5'AND key_6 LIKE 'key_6') AND ( key_7 LIKE 'key_7'AND key_8 > '8') ) AND ( (key_10 BETWEEN '1' AND '1000' )) ) OR ( status = '1' )