We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用版本:
{ "topthink/think-orm": "^3.0" }
争议代码位置: src/db/concern/WhereQuery.php:parseArrayWhereItems#504
当以此代码作为查询条件时:
$where = [ 'time' => [ '$gte' => 1703508340 * 1000000000, '$lt' => (1703508340 + 1) * 1000000000, ], 'ip' => [ '$in' => [ '123.123.123.123', '1.1.1.1', '2.2.2.2', ] ] ]; (new UserLoginLog())->where($where)->field('_id')->failException()->find();
实际的查询条件为:
db.user_login_log .find({ $and: [ { time: { $in: { $gte: 1703508340000000000, $lt: 1703508341000000000 }, }, }, { time: { $in: { $in: ["123.123.123.123", "1.1.1.1", "2.2.2.2"] }, }, }, ], }) .limit(1);
咨询: 是否有一个方法,可以像ThinkPHP 3.2.3时的MongoModel中的写法,将以上的查询条件直接进行 json_encode操作呢?
json_encode
The text was updated successfully, but these errors were encountered:
当前找到的解决方法是将array强转成object,这个办法是否是推荐写法?如果是可以加到文档中吗?
$where = [ 'time' => (object) [ '$gte' => 1703508340 * 1000000000, '$lt' => (1703508340 + 1) * 1000000000, ], 'ip' => [ '$in' => (object) [ '123.123.123.123', '1.1.1.1', '2.2.2.2', ] ] ];
Sorry, something went wrong.
No branches or pull requests
使用版本:
争议代码位置:
src/db/concern/WhereQuery.php:parseArrayWhereItems#504
当以此代码作为查询条件时:
实际的查询条件为:
咨询:
是否有一个方法,可以像ThinkPHP 3.2.3时的MongoModel中的写法,将以上的查询条件直接进行
json_encode
操作呢?The text was updated successfully, but these errors were encountered: