新增订单待支付与支付确认后端流程

This commit is contained in:
yml
2026-05-24 16:29:47 +08:00
parent 5e422bfa40
commit c4cfe6dd79
15 changed files with 368 additions and 66 deletions
@@ -361,7 +361,7 @@ func (r *Repository) Offline(ownerID uint64, listingID uint64) error {
func (r *Repository) ListPublic() ([]ListingDTO, error) {
var rows []listingRow
err := r.baseQuery().
Where("l.status = ? AND l.review_status = ?", "published", "approved").
Where("l.status = ? AND l.review_status = ? AND l.in_transaction = ?", "published", "approved", false).
Order("l.published_at DESC, l.id DESC").
Limit(100).
Scan(&rows).Error
@@ -384,7 +384,7 @@ func (r *Repository) ListMine(ownerID uint64) ([]ListingDTO, error) {
}
func (r *Repository) FindPublic(id uint64) (*ListingDTO, error) {
dto, err := r.findDTO("l.id = ? AND l.status = ? AND l.review_status = ?", id, "published", "approved")
dto, err := r.findDTO("l.id = ? AND l.status = ? AND l.review_status = ? AND l.in_transaction = ?", id, "published", "approved", false)
if err != nil {
return nil, err
}
@@ -400,7 +400,7 @@ func (r *Repository) FindPublicScreenshotKey(id uint64, index int) (string, erro
if index < 0 {
return "", gorm.ErrRecordNotFound
}
dto, err := r.findDTO("l.id = ? AND l.status = ? AND l.review_status = ?", id, "published", "approved")
dto, err := r.findDTO("l.id = ? AND l.status = ? AND l.review_status = ? AND l.in_transaction = ?", id, "published", "approved", false)
if err != nil {
return "", err
}