|
|
@@ -49,7 +49,9 @@ func (self *ProductController) Latest() {
|
|
|
if pd.Count > pd.SoldCount {
|
|
|
pd.LeftCount = pd.Count - pd.SoldCount
|
|
|
}
|
|
|
- pd.SoldCount = pd.SoldCount + pd.VirtualSoldCount
|
|
|
+ //pd.SoldCount = pd.SoldCount + pd.VirtualSoldCount
|
|
|
+ pd.SoldCount = product_model.GetProductCountByRelateId(pd.RelateProductId, true)
|
|
|
+
|
|
|
if pd.SeckilShowPrice > 0 {
|
|
|
now := time.Now()
|
|
|
pd.SeckillStartAt = pd.SeckillStart.Unix()
|
|
|
@@ -144,7 +146,9 @@ func (self *ProductController) Get() {
|
|
|
if pd.Count > pd.SoldCount {
|
|
|
pd.LeftCount = pd.Count - pd.SoldCount
|
|
|
}
|
|
|
- pd.SoldCount = pd.SoldCount + pd.VirtualSoldCount
|
|
|
+ //pd.SoldCount = pd.SoldCount + pd.VirtualSoldCount
|
|
|
+ pd.SoldCount = product_model.GetProductCountByRelateId(pd.RelateProductId, true)
|
|
|
+
|
|
|
pd.Cover = product_model.GetCoverByPId(pId, cache)
|
|
|
pd.Album = product_model.GetPicturesByPIdAndPType(pId, product_model.PIC_TYPE_ALBUM, cache)
|
|
|
pd.ShareImg = self.GetCdnFullImgUrl(pd.ShareImg)
|
|
|
@@ -229,7 +233,9 @@ func (self *ProductController) GetPdDetail() {
|
|
|
if pd.Count > pd.SoldCount {
|
|
|
pd.LeftCount = pd.Count - pd.SoldCount
|
|
|
}
|
|
|
- pd.SoldCount = pd.SoldCount + pd.VirtualSoldCount
|
|
|
+ //pd.SoldCount = pd.SoldCount + pd.VirtualSoldCount
|
|
|
+ pd.SoldCount = product_model.GetProductCountByRelateId(pd.RelateProductId, true)
|
|
|
+
|
|
|
pd.Cover = product_model.GetCoverByPId(pd.Id, cache)
|
|
|
pd.Album = product_model.GetPicturesByPIdAndPType(pd.Id, product_model.PIC_TYPE_ALBUM, cache)
|
|
|
pd.ShareImg = self.GetCdnFullImgUrl(pd.ShareImg)
|
|
|
@@ -318,7 +324,9 @@ func (self *ProductController) GetProductsByCat() {
|
|
|
if pd.Count > pd.SoldCount {
|
|
|
pd.LeftCount = pd.Count - pd.SoldCount
|
|
|
}
|
|
|
- pd.SoldCount = pd.SoldCount + pd.VirtualSoldCount
|
|
|
+ //pd.SoldCount = pd.SoldCount + pd.VirtualSoldCount
|
|
|
+ pd.SoldCount = product_model.GetProductCountByRelateId(pd.RelateProductId, true)
|
|
|
+
|
|
|
if pd.SeckilShowPrice > 0 {
|
|
|
now := time.Now()
|
|
|
pd.SeckillStartAt = pd.SeckillStart.Unix()
|