课程讨论
  • wxvirus
    ```go func (t *UserGetterImpl) GetUserList() (users []*UserModel.UserEntityImpl) { sqlMapper := t.userMapper.GetUserList() dbs.Orm.Raw(sqlMapper.Sql, sqlMapper.Args...).Find(&users) return } ``` `sqlMapper.Args...`这个要加3个点
  • 鲁米
    func (*UserMapper) GetUserList() *SqlMapper { return Mapper(squirrel.Select("user_id", "user_name").From("user"). //Where("user_id=?", 1). OrderBy("user_id desc").Limit(10).ToSql()) } 小坑: args 不写的话, result 是nil,要么在 UserGetter里不传sqlMapper.Args,则显示全部数据