|
@@ -1,65 +1,78 @@
|
|
|
package api
|
|
|
|
|
|
import (
|
|
|
+ "box-cost/db/model"
|
|
|
+ "box-cost/db/repo"
|
|
|
+
|
|
|
"github.com/gin-gonic/gin"
|
|
|
)
|
|
|
|
|
|
-func Printr(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
- // products := []*model.ProductBill{}
|
|
|
- // repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
|
|
|
- // CollectName: repo.CollectionBillProduct,
|
|
|
- // Query: repo.Map{"isAck": nil},
|
|
|
- // Project: []string{"isAck"},
|
|
|
- // }, &products)
|
|
|
- // fmt.Println(len(products))
|
|
|
+// func UpdateIsAckStatus(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
+// products := []*model.ProductBill{}
|
|
|
+// repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
|
|
|
+// CollectName: repo.CollectionBillProduct,
|
|
|
+// Query: repo.Map{"isAck": nil},
|
|
|
+// Project: []string{"isAck"},
|
|
|
+// }, &products)
|
|
|
+// fmt.Println(len(products))
|
|
|
+
|
|
|
+// for _, product := range products {
|
|
|
+// fmt.Println(product.Id.Hex())
|
|
|
+// fmt.Println(product.IsAck)
|
|
|
+// notAck := false
|
|
|
+// repo.RepoUpdateSetDocsProps(apictx.CreateRepoCtx(), &repo.DocFilterOptions{
|
|
|
+// CollectName: repo.CollectionBillProduct,
|
|
|
+// Query: repo.Map{"isAck": nil},
|
|
|
+// }, &model.ProductBill{IsAck: ¬Ack})
|
|
|
+// }
|
|
|
+// return products, nil
|
|
|
|
|
|
- // for _, product := range products {
|
|
|
- // fmt.Println(product.Id.Hex())
|
|
|
- // fmt.Println(product.IsAck)
|
|
|
- // notAck := false
|
|
|
- // repo.RepoUpdateSetDocsProps(apictx.CreateRepoCtx(), &repo.DocFilterOptions{
|
|
|
- // CollectName: repo.CollectionBillProduct,
|
|
|
- // Query: repo.Map{"isAck": nil},
|
|
|
- // }, &model.ProductBill{IsAck: ¬Ack})
|
|
|
- // }
|
|
|
- // return products, nil
|
|
|
+// produces := []*model.ProduceBill{}
|
|
|
+// repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
|
|
|
+// CollectName: repo.CollectionBillProduce,
|
|
|
+// Query: repo.Map{"isAck": nil},
|
|
|
+// Project: []string{"isAck"},
|
|
|
+// }, &produces)
|
|
|
|
|
|
- // produces := []*model.ProduceBill{}
|
|
|
- // repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
|
|
|
- // CollectName: repo.CollectionBillProduce,
|
|
|
- // Query: repo.Map{"isAck": nil},
|
|
|
- // Project: []string{"isAck"},
|
|
|
- // }, &produces)
|
|
|
+// for _, produce := range produces {
|
|
|
+// fmt.Println(produce.Id.Hex())
|
|
|
+// fmt.Println(produce.IsAck)
|
|
|
+// notAck := false
|
|
|
+// repo.RepoUpdateSetDocsProps(apictx.CreateRepoCtx(), &repo.DocFilterOptions{
|
|
|
+// CollectName: repo.CollectionBillProduce,
|
|
|
+// Query: repo.Map{"isAck": nil},
|
|
|
+// }, &model.ProduceBill{IsAck: ¬Ack})
|
|
|
+// }
|
|
|
+// return produces, nil
|
|
|
|
|
|
- // for _, produce := range produces {
|
|
|
- // fmt.Println(produce.Id.Hex())
|
|
|
- // fmt.Println(produce.IsAck)
|
|
|
- // notAck := false
|
|
|
- // repo.RepoUpdateSetDocsProps(apictx.CreateRepoCtx(), &repo.DocFilterOptions{
|
|
|
- // CollectName: repo.CollectionBillProduce,
|
|
|
- // Query: repo.Map{"isAck": nil},
|
|
|
- // }, &model.ProduceBill{IsAck: ¬Ack})
|
|
|
- // }
|
|
|
- // return produces, nil
|
|
|
+// purchases := []*model.PurchaseBill{}
|
|
|
+// repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
|
|
|
+// CollectName: repo.CollectionBillPurchase,
|
|
|
+// Query: repo.Map{"isAck": nil},
|
|
|
+// Project: []string{"isAck"},
|
|
|
+// }, &purchases)
|
|
|
|
|
|
- // purchases := []*model.PurchaseBill{}
|
|
|
- // repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
|
|
|
- // CollectName: repo.CollectionBillPurchase,
|
|
|
- // Query: repo.Map{"isAck": nil},
|
|
|
- // Project: []string{"isAck"},
|
|
|
- // }, &purchases)
|
|
|
+// for _, purchase := range purchases {
|
|
|
+// fmt.Println(purchase.Id.Hex())
|
|
|
+// fmt.Println(purchase.IsAck)
|
|
|
+// notAck := false
|
|
|
+// repo.RepoUpdateSetDocsProps(apictx.CreateRepoCtx(), &repo.DocFilterOptions{
|
|
|
+// CollectName: repo.CollectionBillPurchase,
|
|
|
+// Query: repo.Map{"isAck": nil},
|
|
|
+// }, &model.PurchaseBill{IsAck: ¬Ack})
|
|
|
+// }
|
|
|
+// return purchases, nil
|
|
|
|
|
|
- // for _, purchase := range purchases {
|
|
|
- // fmt.Println(purchase.Id.Hex())
|
|
|
- // fmt.Println(purchase.IsAck)
|
|
|
- // notAck := false
|
|
|
- // repo.RepoUpdateSetDocsProps(apictx.CreateRepoCtx(), &repo.DocFilterOptions{
|
|
|
- // CollectName: repo.CollectionBillPurchase,
|
|
|
- // Query: repo.Map{"isAck": nil},
|
|
|
- // }, &model.PurchaseBill{IsAck: ¬Ack})
|
|
|
- // }
|
|
|
- // return purchases, nil
|
|
|
+// return nil, nil
|
|
|
|
|
|
- return nil, nil
|
|
|
+// }
|
|
|
+
|
|
|
+func Printr(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
+ // 2023粽子礼盒稻香拾味定制款彩盒手提绳
|
|
|
+ // bill := model.ProductBill{}
|
|
|
+ // bill.Remark = ""
|
|
|
+ // fmt.Println(bill)
|
|
|
+ // !数据库报错,不能识别remark == ""
|
|
|
+ return repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionBillProduct, "6440dc82afe88127dda4a5ef", &model.ProductBill{Remark: ""})
|
|
|
|
|
|
}
|