think-orm
think-orm copied to clipboard
Think ORM——the PHP Database&ORM Framework
修复 v2.0.32 之后 Db::connect('mongo')->table('watch_logger')->execute($bulk) 提示 method not exist 方法不存在的bug
``` public function files() { return $this->belongsToMany(Fileinfo::class, RoomFile::class, 'fileid', 'serial'); } $query->field('serial,roomname,starttime,endtime') ->with([ 'files' => function (\think\model\Relation $query) { $query->withField(['fileid','filename']); } ]) ``` 依然还是查询了所有字段 > SELECT `fileinfo`.*,`pivot`.`serial` AS `pivot__serial`,`pivot`.`fileid` AS...
Trying to access array offset on value of type null 6.0版本在 PHP7.4报错的问题,我看代码已经进行了修复,但是还没有发布新版本,所以安装的还是未修改前的。 请尽快发布一下 think-orm 新版本吧 https://github.com/top-think/think-orm/commit/7e043f2742ece2561478c215832bb85e8caf13f6
常驻内存环境下容易导致内存泄漏。
批量更新,直接更新都有问题,拿不到模型对象的原始数据origin
hasWhere查询始终会对关联模型表加表前缀,即使关联模型定义了不带表前缀的$table属性也一样
早点支持phpstrom代码提示啊
``` User::hasWhere('profile',[['true_name','=','thinkphp']])->withCount('article')->xxx ``` 如果再使用了hasWhere后,查询语句默认使用的`User`作为数据表别名,但`withCount`中,使用的是`$this->parent->getTable()`即`user`作为数据表别名,所有会导致查询时报1054的错误。 如果要修复的话,改动可能比较大,还是官方来改吧
``` $file = \app\common\mongo\FileInfo::where('fileid',$fileId)->find(); $file['update_time'] = date('Y-m-d H:m:s'); $file->save(); ``` 报错了 ``` topthink/think-orm/db/connector/Mongo.php line 383 Transaction numbers are only allowed on a replica set member or mongos ``` 我的mongo版本是3.6,就一个mongo库 请问遇到这问题该怎么解决呢
before_select事件返回的一定是数组,因为Event类的diaptch,没有加once参数,方法返回的一定是数组. 而执行事件使用的是 `if (!$resultSet) ` 判断结果一定是false,导致真正的查询没有调用 `$resultSet = $this->db->trigger('before_select', $query); if (!$resultSet) { // 执行查询操作 $resultSet = $this->pdoQuery($query, function ($query) { return $this->builder->select($query); }); }`