|
|
@@ -126,6 +126,32 @@ func (Couponposition) TableName() string {
|
|
|
return "COUPONPOSITION"
|
|
|
}
|
|
|
|
|
|
+// Couponhold 优惠券持仓表 - 导历史(不清当前表) - 每一个数量一条记录
|
|
|
+type Couponhold struct {
|
|
|
+ Couponholdid int64 `json:"couponholdid" xorm:"'COUPONHOLDID'" binding:"required"` // 优惠券持仓ID(229+Unix秒时间戳(10位)+xxxxxx)
|
|
|
+ Giveapplyid int64 `json:"giveapplyid" xorm:"'GIVEAPPLYID'"` // 发放申请ID(SEQ_COUPONGIVEAPPLY)
|
|
|
+ Accountid int64 `json:"accountid" xorm:"'ACCOUNTID'"` // 资金账户ID
|
|
|
+ Coupontypeid int32 `json:"coupontypeid" xorm:"'COUPONTYPEID'"` // 优惠券类型ID - SEQ_COUPONTYPE
|
|
|
+ Couponcategroy int32 `json:"couponcategroy" xorm:"'COUPONCATEGROY'"` // 种类 - 1:现金券 2:折扣券 3:折扣券(单个商品)
|
|
|
+ Conditionvalue float64 `json:"conditionvalue" xorm:"'CONDITIONVALUE'"` // 条件阈值(可为0)
|
|
|
+ Couponvalue float64 `json:"couponvalue" xorm:"'COUPONVALUE'"` // 面值[1:现金券 - 抵扣值 2:折扣券-折扣值]
|
|
|
+ Limitedflag int32 `json:"limitedflag" xorm:"'LIMITEDFLAG'"` // 是否指定商品 - 0:不限 1:限制
|
|
|
+ Limitedgoodsids string `json:"limitedgoodsids" xorm:"'LIMITEDGOODSIDS'"` // 指定商品IDs[逗号分隔]
|
|
|
+ Isgeneral int32 `json:"isgeneral" xorm:"'ISGENERAL'"` // 是否通用券 - 0:否 1:是
|
|
|
+ Userscope string `json:"userscope" xorm:"'USERSCOPE'"` // 卖家范围(用户ID,逗号分隔) [IsGeneral =0时使用]
|
|
|
+ Userid int64 `json:"userid" xorm:"'USERID'"` // 用户ID
|
|
|
+ Qty int64 `json:"qty" xorm:"'QTY'"` // 数量(按1平铺)
|
|
|
+ Startdate time.Time `json:"startdate" xorm:"'STARTDATE'"` // 开始日期
|
|
|
+ Holdstatus int32 `json:"holdstatus" xorm:"'HOLDSTATUS'"` // 持仓状态 - 1:未生效 2:已生效 3:已使用 4:已过期
|
|
|
+ Enddate time.Time `json:"enddate" xorm:"'ENDDATE'"` // 结束日期
|
|
|
+ Createtime time.Time `json:"createtime" xorm:"'CREATETIME'"` // 创建时间
|
|
|
+}
|
|
|
+
|
|
|
+// TableName is COUPONHOLD
|
|
|
+func (Couponhold) TableName() string {
|
|
|
+ return "COUPONHOLD"
|
|
|
+}
|
|
|
+
|
|
|
// HsbyTopGoods 热卖商品(二级市场挂牌点选)
|
|
|
type HsbyTopGoods struct {
|
|
|
Goodsid int64 `json:"goodsid" xorm:"'GOODSID'" binding:"required"` // 商品ID(自增ID SEQ_GOODS)
|
|
|
@@ -1641,3 +1667,15 @@ func GetMyCoupons(accountIDs string, goodsID, sellUserID int) ([]MyCoupon, error
|
|
|
|
|
|
return myCoupons, nil
|
|
|
}
|
|
|
+
|
|
|
+// GetMyCouponHolds 获取优惠卷明细
|
|
|
+func GetMyCouponHolds(accountIDs string) ([]Couponhold, error) {
|
|
|
+ engine := db.GetEngine()
|
|
|
+
|
|
|
+ myCouponHolds := make([]Couponhold, 0)
|
|
|
+ if err := engine.Where(fmt.Sprintf("ACCOUNTID in (%s)", accountIDs)).Find(&myCouponHolds); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ return myCouponHolds, nil
|
|
|
+}
|