|
|
@@ -20,6 +20,7 @@ type ProductCommend struct {
|
|
|
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)
|
|
|
@@ -33,12 +34,13 @@ func (self *ProductCommend) TableName() string {
|
|
|
return product_commends_tablename
|
|
|
}
|
|
|
|
|
|
-func (self *ProductCommend) Create(wxUId, pId, score int64, detail string) (item *ProductCommend) {
|
|
|
+func (self *ProductCommend) Create(wxUId, pId, score int64, detail, orderId string) (item *ProductCommend) {
|
|
|
item = &ProductCommend{
|
|
|
ProductId: pId,
|
|
|
WxUserId: wxUId,
|
|
|
Detail: detail,
|
|
|
Score: score,
|
|
|
+ OrderId: orderId,
|
|
|
IsEnable: true,
|
|
|
}
|
|
|
id, err := orm.NewOrm().Insert(item)
|