waybill_logistics.go 715 B

1234567891011121314151617181920212223242526272829303132
  1. package service
  2. import (
  3. "cold-delivery/app/admin/model"
  4. "cold-delivery/app/admin/service/dto"
  5. cDto "cold-delivery/common/dto"
  6. "cold-delivery/common/global"
  7. "gogs.baozhida.cn/zoie/OAuth-core/service"
  8. )
  9. type WaybillLogistics struct {
  10. service.Service
  11. }
  12. // GetPage 获取WaybillLogistics列表
  13. func (e *WaybillLogistics) GetPage(c *dto.WaybillLogisticsGetPageReq, list *[]model.WaybillLogistics, count *int64) error {
  14. var err error
  15. var data model.WaybillLogistics
  16. err = e.Orm.Model(&data).
  17. Scopes(
  18. cDto.MakeCondition(c.GetNeedSearch()),
  19. ).
  20. Preload("CoolerBox").
  21. Find(list).
  22. Count(count).Error
  23. if err != nil {
  24. e.Log.Errorf("db error: %s", err)
  25. return global.GetFailedErr
  26. }
  27. return nil
  28. }