|
|
@@ -15,6 +15,14 @@ type EggFriendCircleBasicDb struct { |
|
|
|
Db *xorm.Engine |
|
|
|
} |
|
|
|
|
|
|
|
func (e EggFriendCircleBasicDb) EggFriendCircleBasicGet() (*model.EggFriendCircleBasic, error) { |
|
|
|
var m model.EggFriendCircleBasic |
|
|
|
_, err := e.Db.Where("id >= ?", 1).Get(&m) |
|
|
|
if err != nil { |
|
|
|
return nil, zhios_order_relate_logx.Error(err.Error()) |
|
|
|
} |
|
|
|
return &m, nil |
|
|
|
} |
|
|
|
func (e EggFriendCircleBasicDb) EggFriendCircleBasicGetOne() (*model.EggFriendCircleBasic, error) { |
|
|
|
var m model.EggFriendCircleBasic |
|
|
|
has, err := e.Db.Where("id >= ?", 1).Get(&m) |
|
|
@@ -30,7 +38,7 @@ func (e EggFriendCircleBasicDb) EggFriendCircleBasicGetOne() (*model.EggFriendCi |
|
|
|
func (e EggFriendCircleBasicDb) EggFriendCircleBasicInsert(m *model.EggFriendCircleBasic) (int, error) { |
|
|
|
_, err := e.Db.InsertOne(m) |
|
|
|
if err != nil { |
|
|
|
return 0, err |
|
|
|
return 0, zhios_order_relate_logx.Error(err.Error()) |
|
|
|
} |
|
|
|
return m.Id, nil |
|
|
|
} |
|
|
@@ -38,7 +46,7 @@ func (e EggFriendCircleBasicDb) EggFriendCircleBasicInsert(m *model.EggFriendCir |
|
|
|
func (e EggFriendCircleBasicDb) UpdateEggFriendCircleBasic(m *model.EggFriendCircleBasic, columns ...string) (int64, error) { |
|
|
|
affected, err := e.Db.Where("id =?", m.Id).Cols(columns...).Update(m) |
|
|
|
if err != nil { |
|
|
|
return 0, err |
|
|
|
return 0, zhios_order_relate_logx.Error(err.Error()) |
|
|
|
} |
|
|
|
return affected, nil |
|
|
|
} |