Merge branch 'master' of https://github.com/xxjwxc/gormt
This commit is contained in:
@@ -276,7 +276,7 @@ func (obj *_AccountMgr) GetBatchFromName(names []string) (results []*Account, er
|
||||
|
||||
//////////////////////////primary index case ////////////////////////////////////////////
|
||||
|
||||
// FetchByPrimaryKey primay or index 获取唯一内容
|
||||
// FetchByPrimaryKey primary or index 获取唯一内容
|
||||
func (obj *_AccountMgr) FetchByPrimaryKey(id int) (result Account, err error) {
|
||||
err = obj.DB.WithContext(obj.ctx).Table(obj.GetTableName()).Where("`id` = ?", id).Find(&result).Error
|
||||
if err == nil && obj.isRelated {
|
||||
@@ -290,7 +290,7 @@ func (obj *_AccountMgr) FetchByPrimaryKey(id int) (result Account, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// FetchUniqueIndexByAccount primay or index 获取唯一内容
|
||||
// FetchUniqueIndexByAccount primary or index 获取唯一内容
|
||||
func (obj *_AccountMgr) FetchUniqueIndexByAccount(accountID int, userID int) (result Account, err error) {
|
||||
err = obj.DB.WithContext(obj.ctx).Table(obj.GetTableName()).Where("`account_id` = ? AND `user_id` = ?", accountID, userID).Find(&result).Error
|
||||
if err == nil && obj.isRelated {
|
||||
|
||||
@@ -148,7 +148,7 @@ func (obj *_UserMgr) GetBatchFromJob(jobs []int) (results []*User, err error) {
|
||||
|
||||
//////////////////////////primary index case ////////////////////////////////////////////
|
||||
|
||||
// FetchByPrimaryKey primay or index 获取唯一内容
|
||||
// FetchByPrimaryKey primary or index 获取唯一内容
|
||||
func (obj *_UserMgr) FetchByPrimaryKey(userID int) (result User, err error) {
|
||||
err = obj.DB.WithContext(obj.ctx).Table(obj.GetTableName()).Where("`user_id` = ?", userID).Find(&result).Error
|
||||
|
||||
|
||||
Reference in New Issue
Block a user