|
@@ -212,6 +212,19 @@ func (self *ProductController) GetPdDetail() {
|
|
|
Product *product_model.Product `json:"product"`
|
|
Product *product_model.Product `json:"product"`
|
|
|
}
|
|
}
|
|
|
if pd != nil {
|
|
if pd != nil {
|
|
|
|
|
+ //获取颜色,规格名称
|
|
|
|
|
+ if sizeId > int64(0) {
|
|
|
|
|
+ prd_size := product_model.GetProductAttrValueById(sizeId)
|
|
|
|
|
+ if prd_size != nil {
|
|
|
|
|
+ pd.SizeName = prd_size.Name
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if colorId > int64(0) {
|
|
|
|
|
+ prd_color := product_model.GetProductAttrValueById(colorId)
|
|
|
|
|
+ if prd_color != nil {
|
|
|
|
|
+ pd.ColorName = prd_color.Name
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
pd.SoldCount = pd.SaleNums
|
|
pd.SoldCount = pd.SaleNums
|
|
|
if pd.Count > pd.SoldCount {
|
|
if pd.Count > pd.SoldCount {
|
|
|
pd.LeftCount = pd.Count - pd.SoldCount
|
|
pd.LeftCount = pd.Count - pd.SoldCount
|