liujiandao
2023-11-20 6a132d799ea1256a7f570a759af6165e0654cc5a
service/purchase/purchase.go
@@ -7,8 +7,8 @@
   "github.com/spf13/cast"
   "gorm.io/gorm"
   "srm/global"
   "srm/model/common/request"
   "srm/model/purchase"
   purchaserequest "srm/model/purchase/request"
   "srm/proto/qualityinspect"
   "srm/service/test"
)
@@ -123,7 +123,7 @@
//@param: info request.PageInfo
//@return: list interface{}, total int64, err error
func (slf *PurchaseService) GetPurchaseList(info request.PageInfo) (list interface{}, total int64, err error) {
func (slf *PurchaseService) GetPurchaseList(info purchaserequest.PurchaseSearch) (list interface{}, total int64, err error) {
   limit := info.PageSize
   offset := info.PageSize * (info.Page - 1)
   db := global.GVA_DB.Model(&purchase.Purchase{})
@@ -142,6 +142,9 @@
      }
   }
   if info.SupplierId != 0 {
      db = db.Where("supplier_id = ?", info.SupplierId)
   }
   err = db.Count(&total).Error
   if err != nil {
      return purchaseList, total, err