PHPackages                             oss\_think/think-orm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. oss\_think/think-orm

ActiveLibrary[Database &amp; ORM](/categories/database)

oss\_think/think-orm
====================

think orm ,somethings update

v2.0.60(3y ago)07362Apache-2.0PHPPHP &gt;=7.1.0

Since Oct 27Pushed 3y agoCompare

[ Source](https://github.com/cosmosjack/think-orm)[ Packagist](https://packagist.org/packages/oss_think/think-orm)[ RSS](/packages/oss-think-think-orm/feed)WikiDiscussions 2.0 Synced 1mo ago

READMEChangelogDependencies (4)Versions (87)Used By (2)

ThinkORM
========

[](#thinkorm)

基于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开发指南](https://www.kancloud.cn/manual/think-orm/content)

案例
--

[](#案例)

```
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' )

```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 79.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Total

86

Last Release

1439d ago

Major Versions

v0.9 → v1.02018-01-05

v1.2.17 → v2.0.02019-02-16

PHP version history (2 changes)0.1PHP &gt;=5.6.0

v2.0.0PHP &gt;=7.1.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/15810268?v=4)[夜未央](/maintainers/cosmosjack)[@cosmosjack](https://github.com/cosmosjack)

---

Top Contributors

[![liu21st](https://avatars.githubusercontent.com/u/1111670?v=4)](https://github.com/liu21st "liu21st (343 commits)")[![NHZEX](https://avatars.githubusercontent.com/u/14545600?v=4)](https://github.com/NHZEX "NHZEX (20 commits)")[![yunwuxin](https://avatars.githubusercontent.com/u/2168125?v=4)](https://github.com/yunwuxin "yunwuxin (17 commits)")[![cosmosjack](https://avatars.githubusercontent.com/u/15810268?v=4)](https://github.com/cosmosjack "cosmosjack (14 commits)")[![big-dream](https://avatars.githubusercontent.com/u/9215157?v=4)](https://github.com/big-dream "big-dream (5 commits)")[![4352570](https://avatars.githubusercontent.com/u/51403503?v=4)](https://github.com/4352570 "4352570 (3 commits)")[![9007967](https://avatars.githubusercontent.com/u/33853639?v=4)](https://github.com/9007967 "9007967 (2 commits)")[![liuqiantech](https://avatars.githubusercontent.com/u/42691767?v=4)](https://github.com/liuqiantech "liuqiantech (2 commits)")[![season886](https://avatars.githubusercontent.com/u/18523125?v=4)](https://github.com/season886 "season886 (2 commits)")[![Tinywan](https://avatars.githubusercontent.com/u/14959876?v=4)](https://github.com/Tinywan "Tinywan (2 commits)")[![evalor](https://avatars.githubusercontent.com/u/26944445?v=4)](https://github.com/evalor "evalor (2 commits)")[![iakihsoug](https://avatars.githubusercontent.com/u/5564630?v=4)](https://github.com/iakihsoug "iakihsoug (1 commits)")[![Junjunya1995](https://avatars.githubusercontent.com/u/24283128?v=4)](https://github.com/Junjunya1995 "Junjunya1995 (1 commits)")[![klinson](https://avatars.githubusercontent.com/u/41332835?v=4)](https://github.com/klinson "klinson (1 commits)")[![laterz](https://avatars.githubusercontent.com/u/14816803?v=4)](https://github.com/laterz "laterz (1 commits)")[![chasonma](https://avatars.githubusercontent.com/u/7687043?v=4)](https://github.com/chasonma "chasonma (1 commits)")[![liuqiandev](https://avatars.githubusercontent.com/u/50485460?v=4)](https://github.com/liuqiandev "liuqiandev (1 commits)")[![willove](https://avatars.githubusercontent.com/u/5616317?v=4)](https://github.com/willove "willove (1 commits)")[![Alex-Yuen](https://avatars.githubusercontent.com/u/5312648?v=4)](https://github.com/Alex-Yuen "Alex-Yuen (1 commits)")[![pppscn](https://avatars.githubusercontent.com/u/5105854?v=4)](https://github.com/pppscn "pppscn (1 commits)")

---

Tags

databaseorm

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/oss-think-think-orm/health.svg)

```
[![Health](https://phpackages.com/badges/oss-think-think-orm/health.svg)](https://phpackages.com/packages/oss-think-think-orm)
```

###  Alternatives

[topthink/think-orm

the PHP Database&amp;ORM Framework

4542.0M218](/packages/topthink-think-orm)[cycle/database

DBAL, schema introspection, migration and pagination

64690.9k31](/packages/cycle-database)[tommyknocker/pdo-database-class

Framework-agnostic PHP database library with unified API for MySQL, MariaDB, PostgreSQL, SQLite, MSSQL, and Oracle. Query Builder, caching, sharding, window functions, CTEs, JSON, migrations, ActiveRecord, CLI tools, AI-powered analysis. Zero external dependencies.

845.7k](/packages/tommyknocker-pdo-database-class)[perplorm/perpl

Perpl is an improved and still maintained fork of Propel2, an open-source Object-Relational Mapping (ORM) for PHP.

203.7k](/packages/perplorm-perpl)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
