douyiyang6317 2019-08-28 09:53
浏览 909
已采纳

GORM Database.First(&tableStruct,id)没有delete_at IS NULL

When tableStruct have gorm.Model inside, how to get first record by id without gorm automatically adding deleted_at IS NULL? Is there such function?

  • 写回答

2条回答 默认 最新

  • drbae3964 2019-08-28 10:23
    关注

    You can use a raw query

    db.Raw("SELECT * FROM table LIMIT 1").Scan(&variable)
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?