|
|
@@ -4,6 +4,7 @@ import ( |
|
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao" |
|
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" |
|
|
|
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx" |
|
|
|
"fmt" |
|
|
|
"reflect" |
|
|
|
"xorm.io/xorm" |
|
|
|
) |
|
|
@@ -65,3 +66,12 @@ func (u UserTagDb) UserTagInsert(userTag *model.UserTag) (int, error) { |
|
|
|
} |
|
|
|
return userTag.Id, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (u UserTagDb) UserTagGetOneByParams(params map[string]interface{}) (*model.UserTag, error) { |
|
|
|
var m model.UserTag |
|
|
|
var query = fmt.Sprintf("%s = ?", params["key"]) |
|
|
|
if has, err := u.Db.Where(query, params["value"]).Get(&m); err != nil || has == false { |
|
|
|
return nil, zhios_order_relate_logx.Error(err) |
|
|
|
} |
|
|
|
return &m, nil |
|
|
|
} |