You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.1 KiB
36 lines
1.1 KiB
package bully_reward_service
|
|
|
|
import (
|
|
"github.com/ouxuanserver/osmanthuswine/src/core"
|
|
"hudongzhuanjia/models"
|
|
)
|
|
|
|
type BullyListResult struct {
|
|
Id int `json:"id"`
|
|
Content string `json:"content"`
|
|
Status int `json:"status"`
|
|
Second int `json:"second"`
|
|
}
|
|
|
|
func GetBullyList(userId, bullyId int64) ([]*BullyListResult, error) {
|
|
list := make([]*BullyListResult, 0)
|
|
err := core.GetXormAuto().Table(new(models.BullyScreenHistory)).Select("id, content, status, second").
|
|
Where("is_delete=0 and user_id=? and bully_screen_server_id=? and status<> -1", userId, bullyId).
|
|
OrderBy("created_at desc").Find(&list)
|
|
return list, err
|
|
}
|
|
|
|
type RewardListResult struct {
|
|
Id int64 `json:"id"`
|
|
Content string `json:"content"`
|
|
Amount float64 `json:"amount"`
|
|
Status int `json:"status"`
|
|
}
|
|
|
|
func GetRewardList(userId, rewardId int64) ([]*RewardListResult, error) {
|
|
list := make([]*RewardListResult, 0)
|
|
err := core.GetXormAuto().Table(new(models.RewardHistory)).Select("id, content, amount, status").
|
|
Where("is_delete=0 and user_id=? and reward_server_id=? and status <> -1", userId, rewardId).
|
|
Desc("created_at").Find(&list)
|
|
return list, err
|
|
}
|