| | |
| | | "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" |
| | | ) |
| | |
| | | //@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{}) |
| | |
| | | } |
| | | } |
| | | |
| | | if info.SupplierId != 0 { |
| | | db = db.Where("supplier_id = ?", info.SupplierId) |
| | | } |
| | | err = db.Count(&total).Error |
| | | if err != nil { |
| | | return purchaseList, total, err |