feat: update ui

This commit is contained in:
yanghao05
2025-04-25 21:57:06 +08:00
parent 6e253ae11d
commit 82c112b1eb
3 changed files with 37 additions and 16 deletions

View File

@@ -2,6 +2,7 @@ package models
import (
"context"
"errors"
"time"
"quyun/app/requests"
@@ -9,6 +10,7 @@ import (
"quyun/database/schemas/public/table"
. "github.com/go-jet/jet/v2/postgres"
"github.com/go-jet/jet/v2/qrm"
"github.com/samber/lo"
"github.com/sirupsen/logrus"
)
@@ -299,6 +301,9 @@ func (m *usersModel) HasBought(ctx context.Context, userID, postID int64) (bool,
var userPost model.UserPosts
if err := stmt.QueryContext(ctx, db, &userPost); err != nil {
if errors.Is(err, qrm.ErrNoRows) {
return false, nil
}
m.log.Errorf("error querying user post: %v", err)
return false, err
}