完善套餐与账单接口 & 完善支付数据保存,记录实付价格并关联优惠券

This commit is contained in:
2026-03-26 14:39:19 +08:00
parent 5ffa151f58
commit 75ad12efb3
23 changed files with 706 additions and 613 deletions

30
web/globals/orm/timez.go Normal file
View File

@@ -0,0 +1,30 @@
package orm
import (
"fmt"
"time"
)
type DateTime struct {
time.Time
}
func (dt *DateTime) Scan(value any) error {
switch v := value.(type) {
case time.Time:
dt.Time = v
case string:
t, err := time.Parse(time.RFC3339, v)
if err != nil {
return err
}
dt.Time = t
default:
return fmt.Errorf("unsupported type: %T", value)
}
return nil
}
func (dt DateTime) Value() (any, error) {
return dt.Time.Format(time.RFC3339), nil
}