|
|
@@ -155,6 +155,10 @@ func (self *ProductController) Get() {
|
|
|
if pd == nil {
|
|
|
self.ReturnError(403, apps.NoExist, "", nil)
|
|
|
}
|
|
|
+ //商品下架
|
|
|
+ if pd.Status == product_model.PRODUCT_STATUS_DOWN {
|
|
|
+ self.ReturnError(403, []string{apps.ProductOffSale[0], fmt.Sprintf("%s产品已经下架", pd.Name)}, "", nil)
|
|
|
+ }
|
|
|
|
|
|
pd.SoldCount = pd.SaleNums
|
|
|
if pd.Count > pd.SoldCount {
|
|
|
@@ -238,6 +242,12 @@ func (self *ProductController) GetPdDetail() {
|
|
|
if beginPd == nil {
|
|
|
self.ReturnError(403, apps.NoExist, "", nil)
|
|
|
}
|
|
|
+
|
|
|
+ //商品下架
|
|
|
+ if beginPd.Status == product_model.PRODUCT_STATUS_DOWN {
|
|
|
+ self.ReturnError(403, []string{apps.ProductOffSale[0], fmt.Sprintf("%s产品已经下架", beginPd.Name)}, "", nil)
|
|
|
+ }
|
|
|
+
|
|
|
pd := product_model.GetProductByIdAndSizeAndColor(beginPd.RelateProductId, sizeId, colorId, cache)
|
|
|
type Ret struct {
|
|
|
Product *product_model.Product `json:"product"`
|