Comments (4)
如果没有任何的查询条件 并且也没有调用order方法的话 ,find查询不会返回任何结果。
from think-orm.
如果没有任何的查询条件 并且也没有调用order方法的话 ,find查询不会返回任何结果。
@big-dream
我其实是为了M::field('SUM(
money) as money, SUM(
debt_money) as debt_money')->find()
, 使用sum()
方法需要查询多次。
from think-orm.
可以增加条件->whereRaw('1=1')
from think-orm.
@big-dream 学到了,但是还是希望TP能是一个优雅的框架 😀 ,其实即使不传条件,模型本身还附加了 delete_time=0
的条件,我加上 where('1=1')
确实find可以查到数据了
from think-orm.
Related Issues (20)
- 采用数组方式配置分布式的数据库参数的时候,报Array to string conversion错误 HOT 1
- 查询oracle的数据库里面有字段是CLOB类型,如何正确获取数据
- v3.0.15 在高并发环境下使用模型缓存查询报错
- 3.0.15中修复json字段导致无法过滤非法字段 HOT 2
- [特性] 提供模型字段类型转换的统一接口 HOT 1
- [BUG] 使用PGSQL 查询数据库时,使用函数 Find 返回数据始终为NULL HOT 1
- $receiver->where('email_id', $id)->delete();怎么也不能删除#issuecomment-2252198289 HOT 6
- ThinkORM 3.0.18 版本重大bug scope查询都失效了 HOT 4
- Db::raw 不支持传递参数绑定数据
- 插入数据时,出现:Illegal offset type报错 HOT 10
- formatDateTime处理'datetime_format' => '\\app\\common\\util\\ModelDateTime'的问题
- 我如何遍历模型的所有数据包括with的数据 HOT 6
- [特性] ORM考虑对`Enum` 的提供支持 HOT 2
- ORM 对于 `bigint`+无符号 支持需要修正 HOT 1
- 当前仓库的覆盖率报告缺少`Token`工作不正常
- v3.0.22使用defaultSoftDelete属性来时提示定义相同的属性 HOT 2
- $data = EmailReceiver::with('sender')->field('read_time,title')->select(); 又出现n+1问题
- 查询范围 HOT 1
- withSearch搜索器,在查询条件字段值为0时,withSearch方法中直接过滤掉了条件,导致查询结果异常。 HOT 9
- Non-static method think\Model::withAttr() cannot be called statically HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from think-orm.