|
|
@@ -179,6 +179,35 @@ func (Tradeordercoupon) TableName() string {
|
|
|
return "TRADE_ORDERCOUPON"
|
|
|
}
|
|
|
|
|
|
+// Hiscouponhold 优惠卷持仓历史表
|
|
|
+type Hiscouponhold struct {
|
|
|
+ Couponholdid int64 `json:"couponholdid" xorm:"'COUPONHOLDID'" binding:"required"` //
|
|
|
+ Giveapplyid int64 `json:"giveapplyid" xorm:"'GIVEAPPLYID'"` //
|
|
|
+ Accountid int64 `json:"accountid" xorm:"'ACCOUNTID'"` //
|
|
|
+ Coupontypeid int32 `json:"coupontypeid" xorm:"'COUPONTYPEID'"` //
|
|
|
+ Couponcategroy int32 `json:"couponcategroy" xorm:"'COUPONCATEGROY'"` //
|
|
|
+ Conditionvalue float64 `json:"conditionvalue" xorm:"'CONDITIONVALUE'"` //
|
|
|
+ Couponvalue float64 `json:"couponvalue" xorm:"'COUPONVALUE'"` //
|
|
|
+ Limitedflag int32 `json:"limitedflag" xorm:"'LIMITEDFLAG'"` //
|
|
|
+ Limitedgoodsids string `json:"limitedgoodsids" xorm:"'LIMITEDGOODSIDS'"` //
|
|
|
+ Isgeneral int32 `json:"isgeneral" xorm:"'ISGENERAL'"` //
|
|
|
+ Userscope string `json:"userscope" xorm:"'USERSCOPE'"` //
|
|
|
+ Userid int64 `json:"userid" xorm:"'USERID'"` //
|
|
|
+ Qty int64 `json:"qty" xorm:"'QTY'"` //
|
|
|
+ Startdate time.Time `json:"startdate" xorm:"'STARTDATE'"` //
|
|
|
+ Holdstatus int32 `json:"holdstatus" xorm:"'HOLDSTATUS'"` //
|
|
|
+ Enddate time.Time `json:"enddate" xorm:"'ENDDATE'"` //
|
|
|
+ Createtime time.Time `json:"createtime" xorm:"'CREATETIME'"` //
|
|
|
+ Histradedate string `json:"histradedate" xorm:"'HISTRADEDATE'" binding:"required"` //
|
|
|
+ Isvaliddata int32 `json:"isvaliddata" xorm:"'ISVALIDDATA'"` //
|
|
|
+ Oriqty int64 `json:"oriqty" xorm:"'ORIQTY'"` //
|
|
|
+}
|
|
|
+
|
|
|
+// TableName is HIS_COUPONHOLD
|
|
|
+func (Hiscouponhold) TableName() string {
|
|
|
+ return "HIS_COUPONHOLD"
|
|
|
+}
|
|
|
+
|
|
|
// HsbyTopGoods 热卖商品(二级市场挂牌点选)
|
|
|
type HsbyTopGoods struct {
|
|
|
Goodsid int64 `json:"goodsid" xorm:"'GOODSID'" binding:"required"` // 商品ID(自增ID SEQ_GOODS)
|
|
|
@@ -1853,6 +1882,19 @@ func GetMyCouponHolds(accountIDs string, holdStatus string) ([]MyCouponHold, err
|
|
|
return nil, err
|
|
|
}
|
|
|
|
|
|
+ // 如果指定查询已过期的优惠卷,则还需要查询历史表
|
|
|
+ if holdStatus == "4" {
|
|
|
+ myHisCouponHolds := make([]MyCouponHold, 0)
|
|
|
+ if err := engine.Table("HIS_COUPONHOLD CH").
|
|
|
+ Select(`to_char(CH.COUPONHOLDID) COUPONHOLDIDSTR, to_char(CH.COUPONTYPEID) COUPONTYPEIDSTR, CH.*, CT.COUPONNAME`).
|
|
|
+ Join("INNER", "COUPONTYPE CT", "CT.COUPONTYPEID = CH.COUPONTYPEID").
|
|
|
+ Where(fmt.Sprintf("CH.ISVALIDDATA = 1 and CH.ACCOUNTID in (%s)", accountIDs)).
|
|
|
+ Find(&myHisCouponHolds); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ myCouponHolds = append(myCouponHolds, myHisCouponHolds...)
|
|
|
+ }
|
|
|
+
|
|
|
return myCouponHolds, nil
|
|
|
}
|
|
|
|