Просмотр исходного кода

Merge branch 'develop' into feature/app_dev

* develop:
  增加促销列表
abiao лет назад: 4
Родитель
Сommit
0eec1cdf75

+ 5 - 0
go/gopath/src/fohow.com/apps/controllers/promotion_controller/promotion_controller.go

@@ -1,6 +1,7 @@
 package promotion_controller
 
 import (
+	"fohow.com/apps/models/product_model"
 	"fohow.com/apps/models/promotion_model"
 )
 
@@ -21,6 +22,10 @@ func (self *PromotionController) GetList() {
 	promotionList := promotion_model.GetAllNoPatchPresents(wxUId)
 	for _, v := range promotionList {
 		v.SourceName = promotion_model.SOURCE_CN[v.Source]
+		product := product_model.GetProductById(v.SendProd, false)
+		if product != nil {
+			v.ProductName = product.Name
+		}
 	}
 
 	list := new(Result)

+ 14 - 13
go/gopath/src/fohow.com/apps/models/promotion_model/present.go

@@ -22,19 +22,20 @@ var SOURCE_CN = map[string]string{
 }
 
 type Present struct {
-	Id         int64     `orm:"column(id);pk"                                       json:"id"`             // int(11)
-	WxUId      int64     `orm:"column(wx_user_id)"                                  json:"wx_user_id"`     // int(11)
-	Price      int64     `orm:"column(price)"                                        json:"price"`         // int(11)
-	Total      int64     `orm:"column(total)"                                        json:"total"`         // int(11)
-	SendProd   int64     `orm:"column(send_prod1)"                                  json:"send_prod1"`     // int(11)
-	SendNums   int64     `orm:"column(send_nums1)"                                  json:"send_nums1"`     // int(11)
-	OrderId    string    `orm:"column(order_id);null"                                     json:"order_id"` // varchar(32)
-	Source     string    `orm:"column(source);null"                                     json:"source"`     // varchar(32)
-	Remark     string    `orm:"column(remark);null"                                     json:"remark"`     // varchar(32)
-	Status     bool      `orm:"column(status)"                         json:"-"`                           // int(11)
-	SourceName string    `orm:"-"                                                   json:"source_name"`    // varchar(255)
-	CreatedAt  time.Time `orm:"column(created_at);null;auto_now_add;type(datetime)" json:"created_at"`     // datetime
-	UpdatedAt  time.Time `orm:"column(updated_at);null;auto_now;type(datetime)"     json:"updated_at"`     // datetime
+	Id          int64     `orm:"column(id);pk"                                       json:"id"`             // int(11)
+	WxUId       int64     `orm:"column(wx_user_id)"                                  json:"wx_user_id"`     // int(11)
+	Price       int64     `orm:"column(price)"                                        json:"price"`         // int(11)
+	Total       int64     `orm:"column(total)"                                        json:"total"`         // int(11)
+	SendProd    int64     `orm:"column(send_prod1)"                                  json:"send_prod1"`     // int(11)
+	SendNums    int64     `orm:"column(send_nums1)"                                  json:"send_nums1"`     // int(11)
+	OrderId     string    `orm:"column(order_id);null"                                     json:"order_id"` // varchar(32)
+	Source      string    `orm:"column(source);null"                                     json:"source"`     // varchar(32)
+	Remark      string    `orm:"column(remark);null"                                     json:"remark"`     // varchar(32)
+	Status      bool      `orm:"column(status)"                         json:"-"`                           // int(11)
+	SourceName  string    `orm:"-"                                                   json:"source_name"`    // varchar(255)
+	ProductName string    `orm:"-"                                                   json:"product_name"`   // varchar(255)
+	CreatedAt   time.Time `orm:"column(created_at);null;auto_now_add;type(datetime)" json:"created_at"`     // datetime
+	UpdatedAt   time.Time `orm:"column(updated_at);null;auto_now;type(datetime)"     json:"updated_at"`     // datetime
 }
 
 func (self *Present) TableName() string {