Selaa lähdekoodia

product commend manage

abiao 4 vuotta sitten
vanhempi
commit
a405252b17

+ 1 - 0
go/gopath/src/fohow.com/apps/controllers/product_controller/product_controller.go

@@ -379,6 +379,7 @@ func (self *ProductController) GetProductsCommends() {
 			name := string([]rune(wxUser.Nickname)[:1])
 			cd.NickName = fmt.Sprintf("%s*", name)
 		}
+		cd.CreateTime = cd.CreatedAt.Unix()
 	}
 	self.Data["json"] = &Ret{List: list, ListCount: count}
 	self.ServeJSON()

+ 14 - 13
go/gopath/src/fohow.com/apps/models/product_model/product_commend.go

@@ -15,19 +15,20 @@ const (
 )
 
 type ProductCommend struct {
-	Id        int64     `orm:"column(id);pk"           json:"id"`                            // int(11)
-	NickName  string    `orm:"-"                       json:"nick_name"`                     // varchar(20)
-	Head      string    `orm:"-"                      json:"head"`                           // varchar(20)
-	WxUserId  int64     `orm:"column(wx_user_id);null" json:"-"`                             // int(11)
-	ProductId int64     `orm:"column(product_id);null" json:"-"`                             // int(11)
-	OrderId   string    `orm:"column(order_id);"       json:"-"`                             // varchar(20)
-	Detail    string    `orm:"column(detail);"         json:"detail"`                        // varchar(20)
-	IsEnable  bool      `orm:"column(is_enable);null"  json:"-"`                             // tinyint(1)
-	IsTop     bool      `orm:"column(is_top);null"     json:"-"`                             // tinyint(1)
-	Score     int64     `orm:"column(score);null"      json:"score"`                         // int(11)
-	Recommend int64     `orm:"column(recommend);null" json:"-"`                              // int(11)
-	CreatedAt time.Time `orm:"column(created_at);null;auto_now_add;type(datetime)" json:"-"` // datetime
-	UpdatedAt time.Time `orm:"column(updated_at);null;auto_now;type(datetime)"     json:"-"` // datetime
+	Id         int64     `orm:"column(id);pk"          json:"id"`                             // int(11)
+	NickName   string    `orm:"-"                      json:"nick_name"`                      // varchar(20)
+	Head       string    `orm:"-"                      json:"head"`                           // varchar(20)
+	CreateTime int64     `orm:"-"                      json:"create_time"`                    // varchar(20)
+	WxUserId   int64     `orm:"column(wx_user_id);null" json:"-"`                             // int(11)
+	ProductId  int64     `orm:"column(product_id);null" json:"-"`                             // int(11)
+	OrderId    string    `orm:"column(order_id);"       json:"-"`                             // varchar(20)
+	Detail     string    `orm:"column(detail);"         json:"detail"`                        // varchar(20)
+	IsEnable   bool      `orm:"column(is_enable);null"  json:"-"`                             // tinyint(1)
+	IsTop      bool      `orm:"column(is_top);null"     json:"-"`                             // tinyint(1)
+	Score      int64     `orm:"column(score);null"      json:"score"`                         // int(11)
+	Recommend  int64     `orm:"column(recommend);null" json:"-"`                              // int(11)
+	CreatedAt  time.Time `orm:"column(created_at);null;auto_now_add;type(datetime)" json:"-"` // datetime
+	UpdatedAt  time.Time `orm:"column(updated_at);null;auto_now;type(datetime)"     json:"-"` // datetime
 }
 
 func (self *ProductCommend) TableName() string {