item.go 412 B

12345678910111213141516
  1. package material
  2. import (
  3. "zhiyuan/models"
  4. "zhiyuan/pkg/app"
  5. "zhiyuan/pkg/db"
  6. )
  7. var MatItem models.MatItem
  8. func GetItemList(where map[string]interface{}, fields []string, page app.Page, retVal interface{}) ([]*models.MatItem, error) {
  9. if page.PageNum > 0 && page.PageSize > 0 {
  10. where["_limit"] = db.GetOffset(uint(page.PageNum), uint(page.PageSize))
  11. }
  12. return MatItem.GetMulti(where, fields, retVal)
  13. }