|
@@ -16,23 +16,23 @@ type EggEnergyUserWatchRecordsDb struct { |
|
|
Db *xorm.Engine |
|
|
Db *xorm.Engine |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func (e EggEnergyUserWatchRecordsDb) EggEnergyUserWatchRecordsInsert(OneCirclesUserWatchRecords *model.EggEnergyUserWatchRecords) (int64, error) { |
|
|
|
|
|
_, err := e.Db.InsertOne(OneCirclesUserWatchRecords) |
|
|
|
|
|
|
|
|
func (e EggEnergyUserWatchRecordsDb) EggEnergyUserWatchRecordsInsert(userWatchRecords *model.EggEnergyUserWatchRecords) (int64, error) { |
|
|
|
|
|
_, err := e.Db.InsertOne(userWatchRecords) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return 0, err |
|
|
return 0, err |
|
|
} |
|
|
} |
|
|
return OneCirclesUserWatchRecords.Id, nil |
|
|
|
|
|
|
|
|
return userWatchRecords.Id, nil |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
func (e EggEnergyUserWatchRecordsDb) EggEnergyUserWatchRecordsUpdate(id interface{}, OneCirclesUserWatchRecords *model.EggEnergyUserWatchRecords, forceColums ...string) (int64, error) { |
|
|
|
|
|
|
|
|
func (e EggEnergyUserWatchRecordsDb) EggEnergyUserWatchRecordsUpdate(id interface{}, userWatchRecords *model.EggEnergyUserWatchRecords, forceColums ...string) (int64, error) { |
|
|
var ( |
|
|
var ( |
|
|
affected int64 |
|
|
affected int64 |
|
|
err error |
|
|
err error |
|
|
) |
|
|
) |
|
|
if forceColums != nil { |
|
|
if forceColums != nil { |
|
|
affected, err = e.Db.Where("id=?", id).Cols(forceColums...).Update(OneCirclesUserWatchRecords) |
|
|
|
|
|
|
|
|
affected, err = e.Db.Where("id=?", id).Cols(forceColums...).Update(userWatchRecords) |
|
|
} else { |
|
|
} else { |
|
|
affected, err = e.Db.Where("id=?", id).Update(OneCirclesUserWatchRecords) |
|
|
|
|
|
|
|
|
affected, err = e.Db.Where("id=?", id).Update(userWatchRecords) |
|
|
} |
|
|
} |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return 0, err |
|
|
return 0, err |
|
|