RefundLogLists.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | likeadmin快速开发前后端分离管理后台(PHP版)
  4. // +----------------------------------------------------------------------
  5. // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
  6. // | 开源版本可自由商用,可去除界面版权logo
  7. // | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
  8. // | github下载:https://github.com/likeshop-github/likeadmin
  9. // | 访问官网:https://www.likeadmin.cn
  10. // | likeadmin团队 版权所有 拥有最终解释权
  11. // +----------------------------------------------------------------------
  12. // | author: likeadminTeam
  13. // +----------------------------------------------------------------------
  14. namespace app\adminapi\lists\finance;
  15. use app\adminapi\lists\BaseAdminDataLists;
  16. use app\common\model\refund\RefundLog;
  17. /**
  18. * 退款日志列表
  19. * Class RefundLogLists
  20. * @package app\adminapi\lists\product
  21. */
  22. class RefundLogLists extends BaseAdminDataLists
  23. {
  24. /**
  25. * @notes 查询条件
  26. * @return array
  27. * @author 段誉
  28. * @date 2023/3/1 9:55
  29. */
  30. public function queryWhere()
  31. {
  32. $where[] = ['record_id', '=', $this->params['record_id'] ?? 0];
  33. return $where;
  34. }
  35. /**
  36. * @notes 获取列表
  37. * @return array
  38. * @throws \think\db\exception\DataNotFoundException
  39. * @throws \think\db\exception\DbException
  40. * @throws \think\db\exception\ModelNotFoundException
  41. * @author 段誉
  42. * @date 2023/3/1 9:56
  43. */
  44. public function lists(): array
  45. {
  46. $lists = (new RefundLog())
  47. ->order(['id' => 'desc'])
  48. ->where($this->queryWhere())
  49. ->limit($this->limitOffset, $this->limitLength)
  50. ->hidden(['refund_msg'])
  51. ->append(['handler', 'refund_status_text'])
  52. ->select()
  53. ->toArray();
  54. return $lists;
  55. }
  56. /**
  57. * @notes 获取数量
  58. * @return int
  59. * @author 段誉
  60. * @date 2023/3/1 9:56
  61. */
  62. public function count(): int
  63. {
  64. return (new RefundLog())
  65. ->where($this->queryWhere())
  66. ->count();
  67. }
  68. }