胡轶钦 6 anni fa
parent
commit
2723965638

+ 5
- 2
controllers/marketing/marketing.go Vedi File

23
 func (c *MarketingController) GetMarketingList() {
23
 func (c *MarketingController) GetMarketingList() {
24
 	page, _ := c.GetInt("page")
24
 	page, _ := c.GetInt("page")
25
 	pageSize, _ := c.GetInt("pageSize")
25
 	pageSize, _ := c.GetInt("pageSize")
26
-	cases := c.Context.Get("cases").([]model.SysUserCase)
27
-	caseIDs := c.GetCaseIDs(cases)
26
+	caseIDs := c.GetString("caseid")
27
+	if caseIDs == "" {
28
+		cases := c.Context.Get("cases").([]model.SysUserCase)
29
+		caseIDs = c.GetCaseIDs(cases)
30
+	}
28
 	marketings, err := c.serv.GetMarketingList(caseIDs, page, pageSize)
31
 	marketings, err := c.serv.GetMarketingList(caseIDs, page, pageSize)
29
 	if err != nil {
32
 	if err != nil {
30
 		c.ResponseError(err)
33
 		c.ResponseError(err)

+ 2
- 1
models/flashbuy/flashbuy.go Vedi File

63
 	if flashBuyStatus != "" {
63
 	if flashBuyStatus != "" {
64
 		sql += ` and a.flash_buy_status ='` + flashBuyStatus + `'`
64
 		sql += ` and a.flash_buy_status ='` + flashBuyStatus + `'`
65
 	}
65
 	}
66
-	sql += ` order by a.start_date desc limit ` + strconv.Itoa(page-1) + `, ` + strconv.Itoa(pageSize)
66
+	sql += ` order by a.create_date desc limit ` + strconv.Itoa(page-1) + `, ` + strconv.Itoa(pageSize)
67
 	err := m.db.Sql(sql).Find(&flashBuy)
67
 	err := m.db.Sql(sql).Find(&flashBuy)
68
 	return flashBuy, err
68
 	return flashBuy, err
69
 }
69
 }
101
 func (m *FlashbuyDAO) AddNewFlashBuy(flashbuy model.TaFlashBuy) (*model.TaFlashBuy, error) {
101
 func (m *FlashbuyDAO) AddNewFlashBuy(flashbuy model.TaFlashBuy) (*model.TaFlashBuy, error) {
102
 	flashbuy.FlashBuyId = utils.GetGUID()
102
 	flashbuy.FlashBuyId = utils.GetGUID()
103
 	flashbuy.Status = models.STATUS_NORMAL
103
 	flashbuy.Status = models.STATUS_NORMAL
104
+	flashbuy.CreateDate = time.Now()
104
 	_, err := m.db.Insert(flashbuy)
105
 	_, err := m.db.Insert(flashbuy)
105
 	return &flashbuy, err
106
 	return &flashbuy, err
106
 }
107
 }

+ 1
- 0
models/model/ta_flash_buy.go Vedi File

22
 	FlashBuyInfo         string    `xorm:"TEXT"`
22
 	FlashBuyInfo         string    `xorm:"TEXT"`
23
 	CaseId               string    `xorm:"VARCHAR(64)"`
23
 	CaseId               string    `xorm:"VARCHAR(64)"`
24
 	OrgId                string    `xorm:"VARCHAR(64)"`
24
 	OrgId                string    `xorm:"VARCHAR(64)"`
25
+	CreateDate           time.Time `xorm:"DATETIME"`
25
 }
26
 }

+ 3
- 0
service/customer/customer.go Vedi File

216
 		if cs == nil || cs.Status == models.STATUS_DEL {
216
 		if cs == nil || cs.Status == models.STATUS_DEL {
217
 			return nil, errors.New("系统无该推荐案场")
217
 			return nil, errors.New("系统无该推荐案场")
218
 		}
218
 		}
219
+		if cs.Status == 0 {
220
+			return nil, errors.New("该案场暂未开放")
221
+		}
219
 
222
 
220
 		newCust.OrgId = cs.OrgId
223
 		newCust.OrgId = cs.OrgId
221
 		newCust.RecommendCase = cs.CaseId
224
 		newCust.RecommendCase = cs.CaseId