特朗普头像任务
This commit is contained in:
@@ -53,6 +53,8 @@ type (
|
||||
UpdatedAt time.Time `db:"updated_at"` // 修改时间
|
||||
Param string `db:"param"` // 备用参数,如果是邀请任务,可以填邀请的人数
|
||||
Sort int `db:"sort"` // 数字越小越靠前
|
||||
PropertyId string `db:"property_id"` // 道具ID
|
||||
RewardType int8 `db:"reward_type"` // 奖励类型:0=积分,1=道具,2=castile
|
||||
}
|
||||
)
|
||||
|
||||
@@ -84,14 +86,14 @@ func (m *defaultNhTaskModel) FindOne(ctx context.Context, id uint) (*NhTask, err
|
||||
}
|
||||
|
||||
func (m *defaultNhTaskModel) Insert(ctx context.Context, data *NhTask) (sql.Result, error) {
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, nhTaskRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.CommunityId, data.Title, data.SubTitle, data.Description, data.Points, data.ButtonText, data.Type, data.Url, data.Status, data.StartAt, data.EndAt, data.Param, data.Sort)
|
||||
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, nhTaskRowsExpectAutoSet)
|
||||
ret, err := m.conn.ExecCtx(ctx, query, data.CommunityId, data.Title, data.SubTitle, data.Description, data.Points, data.ButtonText, data.Type, data.Url, data.Status, data.StartAt, data.EndAt, data.Param, data.Sort, data.PropertyId, data.RewardType)
|
||||
return ret, err
|
||||
}
|
||||
|
||||
func (m *defaultNhTaskModel) Update(ctx context.Context, data *NhTask) error {
|
||||
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, nhTaskRowsWithPlaceHolder)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.CommunityId, data.Title, data.SubTitle, data.Description, data.Points, data.ButtonText, data.Type, data.Url, data.Status, data.StartAt, data.EndAt, data.Param, data.Sort, data.Id)
|
||||
_, err := m.conn.ExecCtx(ctx, query, data.CommunityId, data.Title, data.SubTitle, data.Description, data.Points, data.ButtonText, data.Type, data.Url, data.Status, data.StartAt, data.EndAt, data.Param, data.Sort, data.PropertyId, data.RewardType, data.Id)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user