animeic 2 years ago
parent
commit
b5085829b9
1 changed files with 3 additions and 0 deletions
  1. 3 0
      3dshow-supplier/api/product.go

+ 3 - 0
3dshow-supplier/api/product.go

@@ -68,6 +68,9 @@ func ProductAdd(c *gin.Context, apictx *ApiSession) (interface{}, error) {
 	if form.Status == 0 {
 	if form.Status == 0 {
 		form.Status = -1
 		form.Status = -1
 	}
 	}
+	if form.Status == 1 {
+		form.OnsaleTime = time.Now()
+	}
 
 
 	result, err := repo.RepoAddDoc(apictx.CreateRepoCtx(), repo.CollectionProduct, &form)
 	result, err := repo.RepoAddDoc(apictx.CreateRepoCtx(), repo.CollectionProduct, &form)
 	return result, err
 	return result, err