StoreOrderRefund.php 801 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. declare (strict_types = 1);
  3. namespace app\model\api;
  4. use think\Model;
  5. /**
  6. * @mixin \think\Model
  7. */
  8. class StoreOrderRefund extends Model
  9. {
  10. protected $name = 'store_order_refund';
  11. /**
  12. * 获取退款列表
  13. * @param array $where
  14. * @param int $page
  15. * @param int $pageSize
  16. * @return array
  17. */
  18. public function getList($where = [], $page = 1, $pageSize = 20)
  19. {
  20. $query = $this->where($where);
  21. $totalCount = $query->count();
  22. $list = $query
  23. ->order('id', 'desc')
  24. ->page($page, $pageSize)
  25. ->select()
  26. ->toArray();
  27. return [
  28. 'list' => $list,
  29. 'totalCount' => $totalCount,
  30. 'pageSize' => $pageSize,
  31. 'page' => $page
  32. ];
  33. }
  34. }