|
|
@@ -208,6 +208,28 @@ func (Hiscouponhold) TableName() string {
|
|
|
return "HIS_COUPONHOLD"
|
|
|
}
|
|
|
|
|
|
+// Clientfixedadconfig 终端固定广告配置 - 通用功能
|
|
|
+type Clientfixedadconfig struct {
|
|
|
+ Adtype int32 `json:"adtype" xorm:"'ADTYPE'" binding:"required"` // 广告位类型 - 1:新品抢购(HSBY)
|
|
|
+ Adsort int32 `json:"adsort" xorm:"'ADSORT'" binding:"required"` // 排序
|
|
|
+ Imagepath string `json:"imagepath" xorm:"'IMAGEPATH'"` // 图片
|
|
|
+ Recsize string `json:"recsize" xorm:"'RECSIZE'"` // 推荐尺寸
|
|
|
+ Title string `json:"title" xorm:"'TITLE'"` // 标题
|
|
|
+ Urltype int32 `json:"urltype" xorm:"'URLTYPE'"` // 链接类型 - 1:直接地址 2:商品ID
|
|
|
+ Urlcontent string `json:"urlcontent" xorm:"'URLCONTENT'"` // 链接(地址或商品ID)
|
|
|
+ Isshow int32 `json:"isshow" xorm:"'ISSHOW'"` // 是否展示 - 0:不展示 1:展示
|
|
|
+ Createdate time.Time `json:"createdate" xorm:"'CREATEDATE'"` // 创建时间
|
|
|
+ Creatorid int64 `json:"creatorid" xorm:"'CREATORID'"` // 创建人
|
|
|
+ Updatedate time.Time `json:"updatedate" xorm:"'UPDATEDATE'"` // 更新时间
|
|
|
+ Modifierid int64 `json:"modifierid" xorm:"'MODIFIERID'"` // 操作人
|
|
|
+ Areauserid int64 `json:"areauserid" xorm:"'AREAUSERID'"` // 所属机构ID
|
|
|
+}
|
|
|
+
|
|
|
+// TableName is CLIENT_FIXEDADCONFIG
|
|
|
+func (Clientfixedadconfig) TableName() string {
|
|
|
+ return "CLIENT_FIXEDADCONFIG"
|
|
|
+}
|
|
|
+
|
|
|
// HsbyTopGoods 热卖商品(二级市场挂牌点选)
|
|
|
type HsbyTopGoods struct {
|
|
|
Goodsid int64 `json:"goodsid" xorm:"'GOODSID'" binding:"required"` // 商品ID(自增ID SEQ_GOODS)
|
|
|
@@ -1021,7 +1043,7 @@ func GetHsbySellMyTradeDetails(accountIDs string) ([]HsbySellMyDetail, error) {
|
|
|
marketIDs := "" // 我的闲置-发布中: 二级市场卖方向成交单(包括历史成交单)
|
|
|
// 默认取 TradeMode = 16
|
|
|
for _, v := range markets {
|
|
|
- if v.Trademode == 16 {
|
|
|
+ if v.Trademode == 16 || v.Trademode == 70 {
|
|
|
if len(marketIDs) == 0 {
|
|
|
marketIDs = strconv.Itoa(int(v.Marketid))
|
|
|
} else {
|
|
|
@@ -1248,7 +1270,7 @@ func GetHsbyBuyMyTradeDetails(accountIDs string) ([]HsbyBuyMyTradeDetail, error)
|
|
|
marketIDs := "" // 我的订单包括一二级市场卖方向成交单(包括历史成交单)
|
|
|
// 默认取 TradeMode = 16
|
|
|
for _, v := range markets {
|
|
|
- if v.Trademode == 16 || v.Trademode == 71 {
|
|
|
+ if v.Trademode == 16 || v.Trademode == 71 || v.Trademode == 70 {
|
|
|
if len(marketIDs) == 0 {
|
|
|
marketIDs = strconv.Itoa(int(v.Marketid))
|
|
|
} else {
|
|
|
@@ -1538,6 +1560,27 @@ type HsbyMarketGoods struct {
|
|
|
func GetHsbyMarketGoodses(marketIDs string, accountID, categoryID int, goodsIDs string, couponTypeID int) ([]HsbyMarketGoods, error) {
|
|
|
engine := db.GetEngine()
|
|
|
|
|
|
+ // 新需求:当账号登录后传入accountID时,只显示此账户所属会员下面的商城商品(注意会员账号的所属会员就是自己)
|
|
|
+ // 获取accountID对应账户的所属会员UserID
|
|
|
+ var memberUserIDs []string
|
|
|
+ if err := engine.Table("USERACCOUNT U").
|
|
|
+ Select("to_char(U.MEMBERUSERID) MEMBERUSERID").
|
|
|
+ Join("INNER", "TAACCOUNT TA", "TA.RELATEDUSERID = U.USERID").
|
|
|
+ Where("TA.ACCOUNTID = ?", accountID).
|
|
|
+ Find(&memberUserIDs); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取此会员下所有的资金账户
|
|
|
+ var memberAccountIDs []string
|
|
|
+ if err := engine.Table("TAACCOUNT").
|
|
|
+ Select("to_char(ACCOUNTID) ACCOUNTID").
|
|
|
+ Where(fmt.Sprintf("RELATEDUSERID in (%s)", strings.Join(memberUserIDs, ","))).
|
|
|
+ Find(&memberAccountIDs); err != nil {
|
|
|
+ fmt.Println(err.Error())
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+
|
|
|
// 获取优惠卷类型信息
|
|
|
var couponType Coupontype
|
|
|
if _, err := engine.Where("ISVALID = 1 and COUPONTYPEID = ?", couponTypeID).Get(&couponType); err != nil {
|
|
|
@@ -1560,7 +1603,8 @@ func GetHsbyMarketGoodses(marketIDs string, accountID, categoryID int, goodsIDs
|
|
|
Join("LEFT", "TAACCOUNT TA", "TA.ACCOUNTID = T.ACCOUNTID").
|
|
|
Join("LEFT", "USERINFO U", "U.USERID = TA.RELATEDUSERID").
|
|
|
Where(fmt.Sprintf("T.MARKETID in (%s)", marketIDs)).
|
|
|
- And("T.ORDERSTATUS in (3,7) and T.BUYORSELL = 1 and (T.ORDERQTY - T.TRADEQTY - T.CANCELQTY) > 0")
|
|
|
+ And("T.ORDERSTATUS in (3,7) and T.BUYORSELL = 1 and (T.ORDERQTY - T.TRADEQTY - T.CANCELQTY) > 0").
|
|
|
+ And(fmt.Sprintf("T.ACCOUNTID in (%s)", strings.Join(memberAccountIDs, ",")))
|
|
|
if categoryID != 0 {
|
|
|
session = session.And("GX.CATEGORYID = ?", categoryID)
|
|
|
}
|
|
|
@@ -1936,3 +1980,15 @@ func GetMyUsedCoupon(accountIDs string) ([]MyUsedCoupon, error) {
|
|
|
|
|
|
return myUsedCoupons, nil
|
|
|
}
|
|
|
+
|
|
|
+// GetClientFixedADConfigs 获取终端固定广告配置
|
|
|
+func GetClientFixedADConfigs() ([]Clientfixedadconfig, error) {
|
|
|
+ engine := db.GetEngine()
|
|
|
+
|
|
|
+ clientFixedADConfigs := make([]Clientfixedadconfig, 0)
|
|
|
+ if err := engine.Where("ISSHOW = 1").Find(&clientFixedADConfigs); err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ return clientFixedADConfigs, nil
|
|
|
+}
|