nft持有查询定时任务
This commit is contained in:
@@ -53,15 +53,35 @@ func (m *customNhPromoteBindModel) FindRequirePushUser(ctx context.Context, shar
|
||||
}
|
||||
|
||||
func (m *customNhPromoteBindModel) UpdatePushUser(ctx context.Context, id uint) error {
|
||||
update := fmt.Sprintf("update %s set `is_push_user` = 1 where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, update, id)
|
||||
return err
|
||||
update := fmt.Sprintf("update %s set `is_push_user` = 1 where `id` = ? and `is_push_user` = 0", m.table)
|
||||
result, err := m.conn.ExecCtx(ctx, update, id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
row, err := result.RowsAffected()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if row == 0 {
|
||||
return ErrNoRowUpdate
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *customNhPromoteBindModel) UpdatePushRole(ctx context.Context, id uint) error {
|
||||
update := fmt.Sprintf("update %s set `is_push_role` = 1 where `id` = ?", m.table)
|
||||
_, err := m.conn.ExecCtx(ctx, update, id)
|
||||
return err
|
||||
update := fmt.Sprintf("update %s set `is_push_role` = 1 where `id` = ? and `is_push_role` = 0", m.table)
|
||||
result, err := m.conn.ExecCtx(ctx, update, id)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
row, err := result.RowsAffected()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if row == 0 {
|
||||
return ErrNoRowUpdate
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *customNhPromoteBindModel) UserInviteCount(ctx context.Context, uid uint) (int64, error) {
|
||||
|
||||
Reference in New Issue
Block a user