public function insertGetId(array $values, $sequence = null)
{
if ($this->needFlushCache()) {
// 清空表级缓存
$meta = $this->getMeta();
$meta->flush($this->db(), $this->model->table());
}
$id = parent::insertGetId($values, $sequence);
if ($this->needFlushCache()) {
$key = $this->buildRowCacheKey([$id])[$id];
$this->getCache()->del([$key]);
}
return $id;
}