TP6 添加数据save的同时,使用cache更新缓存时不能自动添加时间戳

浏览:348 发布日期:2022/05/20 分类:ThinkPHP6专区 关键字: cache 查询缓存
public function add(array $data)
{
if (self::checkExist($data['name'])) {
$this->error = '产品分类已存在';
return false;
}
$this->transaction(function () use ($data) {
$this->save('category_list')->save($data);
});
return true;
}
这种情况下,create_time字段不会自动写入。
最佳答案
评论( 相关
后面还有条评论,点击查看>>