diff --git a/domain/model/cp_m/anniversary.go b/domain/model/cp_m/anniversary.go index e930fbacc442448713e2aff4dd834fe84f62c92d..e48d66c3508ebf173fadce59e014ae7baeeb21d0 100644 --- a/domain/model/cp_m/anniversary.go +++ b/domain/model/cp_m/anniversary.go @@ -3,6 +3,7 @@ package cp_m import ( "git.hilo.cn/hilo-common/domain" "git.hilo.cn/hilo-common/resource/mysql" + "hilo-user/_const/enum/cp_e" "time" ) @@ -10,12 +11,14 @@ import ( type CpAnniversary struct { mysql.Entity CpId mysql.ID + Type cp_e.AnniversaryItemType UserId1 mysql.ID UserId2 mysql.ID Content string Timestamp int64 IsRemind bool Reminded mysql.YesNo + Sort int } // 添加cp纪念日 @@ -52,7 +55,7 @@ func GetAllCpAnniversary(model *domain.Model, userId mysql.ID) []CpAnniversary { if !exists { return res } - if err := model.DB().Model(CpAnniversary{}).Where("cp_id = ?", relation.ID).Order("`timestamp` DESC,id DESC").Find(&res).Error; err != nil { + if err := model.DB().Model(CpAnniversary{}).Where("cp_id = ?", relation.ID).Order("`sort` DESC,updated_time DESC").Find(&res).Error; err != nil { model.Log.Errorf("GetAllCpAnniversary fail:%v", err) } return res