Initial commit

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-15 13:57:10 +08:00
co-authored by Claude Opus 5
commit 8679200f41
1897 changed files with 257900 additions and 0 deletions
+53
View File
@@ -0,0 +1,53 @@
package prdcthsomod
import (
"time"
"go.mongodb.org/mongo-driver/bson"
)
type M = bson.M
// PayVipTotalAmountByCreatedTime 购买VIP的总金额
func PayVipTotalAmountByCreatedTime(start time.Time, end time.Time) (int64, error) {
filter := M{
"createdAt": M{
"$gte": start,
"$lt": end,
},
"productType": VIP,
}
list := make([]struct {
Amount int64 `bson:"amount"`
}, 0)
if err := coll(nil).Find(&list, filter); err != nil {
return 0, err
}
var totalAmount int64
for _, v := range list {
totalAmount += v.Amount
}
return totalAmount, nil
}
// PayVipUIDSByCreatedTime 购买VIP的用户UID
func PayVipUIDSByCreatedTime(start time.Time, end time.Time) ([]uint64, error) {
filter := M{
"createdAt": M{
"$gte": start,
"$lt": end,
},
"productType": VIP,
}
list := make([]struct {
UID uint64 `bson:"uid"`
}, 0)
if err := coll(nil).Find(&list, filter); err != nil {
return nil, err
}
uidList := make([]uint64, len(list))
for i, v := range list {
uidList[i] = v.UID
}
return uidList, nil
}