|
|
@@ -0,0 +1,40 @@ |
|
|
|
package implement |
|
|
|
|
|
|
|
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" |
|
|
|
"xorm.io/xorm" |
|
|
|
) |
|
|
|
|
|
|
|
func NewImGroupBatchSendMessageRecordsDb(engine *xorm.Engine) dao.ImGroupBatchSendMessageRecordsDao { |
|
|
|
return &ImGroupBatchSendMessageRecordsDb{Db: engine} |
|
|
|
} |
|
|
|
|
|
|
|
type ImGroupBatchSendMessageRecordsDb struct { |
|
|
|
Db *xorm.Engine |
|
|
|
} |
|
|
|
|
|
|
|
func (i ImGroupBatchSendMessageRecordsDb) ImGroupBatchSendMessageRecordsInsert(m *model.ImGroupBatchSendMessageRecords) (int, error) { |
|
|
|
_, err := i.Db.InsertOne(m) |
|
|
|
if err != nil { |
|
|
|
return 0, zhios_order_relate_logx.Error(err) |
|
|
|
} |
|
|
|
return m.Id, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (i ImGroupBatchSendMessageRecordsDb) ImGroupBatchSendMessageRecordsUpdate(id interface{}, m *model.ImGroupBatchSendMessageRecords, forceColums ...string) (int64, error) { |
|
|
|
var ( |
|
|
|
affected int64 |
|
|
|
err error |
|
|
|
) |
|
|
|
if forceColums != nil { |
|
|
|
affected, err = i.Db.Where("id=?", id).MustCols(forceColums...).Update(m) |
|
|
|
} else { |
|
|
|
affected, err = i.Db.Where("id=?", id).Update(m) |
|
|
|
} |
|
|
|
if err != nil { |
|
|
|
return 0, zhios_order_relate_logx.Error(err) |
|
|
|
} |
|
|
|
return affected, nil |
|
|
|
} |