增加社区列表接口,任务相关接口修改

This commit is contained in:
lianghuanjie
2024-12-19 21:14:14 +08:00
parent 391a9d3481
commit a3c4adfa25
32 changed files with 1163 additions and 197 deletions

View File

@@ -21,6 +21,7 @@ const (
TASKTYPE_BIND_DISCORD = 7
TASKTYPE_JOIN_TELEGRAM = 8
TASKTYPE_DAILY_PAY = 9
TASKTYPE_INVITE_USER = 10
)
type (
@@ -38,7 +39,7 @@ type (
)
func (m *customNhTaskModel) FindTasksByCommunity(ctx context.Context, communityId uint) ([]*NhTask, error) {
query := fmt.Sprintf("select %s from %s where community_id = 0 or community_id = ?", nhTaskRows, m.table)
query := fmt.Sprintf("select %s from %s where `status` = 1 and community_id = ? order by `sort`", nhTaskRows, m.table)
var tasks []*NhTask
err := m.conn.QueryRowsCtx(ctx, &tasks, query, communityId)
if err != nil && !errors.Is(err, sqlx.ErrNotFound) {