print.go 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. package api
  2. import (
  3. "box-cost/db/model"
  4. "box-cost/db/repo"
  5. "github.com/gin-gonic/gin"
  6. )
  7. // func UpdateIsAckStatus(c *gin.Context, apictx *ApiSession) (interface{}, error) {
  8. // products := []*model.ProductBill{}
  9. // repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
  10. // CollectName: repo.CollectionBillProduct,
  11. // Query: repo.Map{"isAck": nil},
  12. // Project: []string{"isAck"},
  13. // }, &products)
  14. // fmt.Println(len(products))
  15. // for _, product := range products {
  16. // fmt.Println(product.Id.Hex())
  17. // fmt.Println(product.IsAck)
  18. // notAck := false
  19. // repo.RepoUpdateSetDocsProps(apictx.CreateRepoCtx(), &repo.DocFilterOptions{
  20. // CollectName: repo.CollectionBillProduct,
  21. // Query: repo.Map{"isAck": nil},
  22. // }, &model.ProductBill{IsAck: &notAck})
  23. // }
  24. // return products, nil
  25. // produces := []*model.ProduceBill{}
  26. // repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
  27. // CollectName: repo.CollectionBillProduce,
  28. // Query: repo.Map{"isAck": nil},
  29. // Project: []string{"isAck"},
  30. // }, &produces)
  31. // for _, produce := range produces {
  32. // fmt.Println(produce.Id.Hex())
  33. // fmt.Println(produce.IsAck)
  34. // notAck := false
  35. // repo.RepoUpdateSetDocsProps(apictx.CreateRepoCtx(), &repo.DocFilterOptions{
  36. // CollectName: repo.CollectionBillProduce,
  37. // Query: repo.Map{"isAck": nil},
  38. // }, &model.ProduceBill{IsAck: &notAck})
  39. // }
  40. // return produces, nil
  41. // purchases := []*model.PurchaseBill{}
  42. // repo.RepoDocsSearch(apictx.CreateRepoCtx(), &repo.PageSearchOptions{
  43. // CollectName: repo.CollectionBillPurchase,
  44. // Query: repo.Map{"isAck": nil},
  45. // Project: []string{"isAck"},
  46. // }, &purchases)
  47. // for _, purchase := range purchases {
  48. // fmt.Println(purchase.Id.Hex())
  49. // fmt.Println(purchase.IsAck)
  50. // notAck := false
  51. // repo.RepoUpdateSetDocsProps(apictx.CreateRepoCtx(), &repo.DocFilterOptions{
  52. // CollectName: repo.CollectionBillPurchase,
  53. // Query: repo.Map{"isAck": nil},
  54. // }, &model.PurchaseBill{IsAck: &notAck})
  55. // }
  56. // return purchases, nil
  57. // return nil, nil
  58. // }
  59. func Printr(c *gin.Context, apictx *ApiSession) (interface{}, error) {
  60. // 2023粽子礼盒稻香拾味定制款彩盒手提绳
  61. // bill := model.ProductBill{}
  62. // bill.Remark = ""
  63. // fmt.Println(bill)
  64. // !数据库报错,不能识别remark == ""
  65. return repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionBillProduct, "6440dc82afe88127dda4a5ef", &model.ProductBill{Remark: ""})
  66. }
  67. // ? 测试供应商备注
  68. // {{boxcost}}/bill/produce/download?id=6444d14db2a7c8eae4240579