模型代码:
use think\Model;
class TestModel extends Model
{
protected $autoWriteTimestamp = 'int';
protected $createTime = 'create_time';
protected $updateTime = 'update_time';
}
复现代码:
TestModel::where([
'name' => 'xxxx',
])->setInc('n', 1);
文档:
https://www.kancloud.cn/manua...
猜测 where
后可能走了 think\Db
的方法,而没有走 think\Model
请问如何做到这种场景下可以正常自动更新 update_time
呢?
请问是否解决了?