DouyinRefundOrderLists.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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\external;
  15. use app\adminapi\lists\BaseAdminDataLists;
  16. use app\common\lists\ListsSearchInterface;
  17. use app\common\model\external\DouyinRefundOrder;
  18. /**
  19. * DouyinRefundOrder列表
  20. * Class DouyinRefundOrderLists
  21. * @package app\adminapi\lists
  22. */
  23. class DouyinRefundOrderLists extends BaseAdminDataLists implements ListsSearchInterface
  24. {
  25. /**
  26. * @notes 设置搜索条件
  27. * @return \string[][]
  28. * @author likeadmin
  29. * @date 2025/05/23 13:40
  30. */
  31. public function setSearch(): array
  32. {
  33. return [
  34. '=' => ['user_id','refund_number', 'refund_status'],
  35. ];
  36. }
  37. public function queryWhere(): array
  38. {
  39. $where = [];
  40. /*if(isset($this->params['create_time_range']) && !empty($this->params['create_time_range'][0]) && !empty($this->params['create_time_range'][1])){
  41. $time = [strtotime($this->params['create_time_range'][0]), strtotime($this->params['create_time_range'][1])+86400-1];
  42. $where[] = ['create_time', 'between', $time];
  43. }*/
  44. return $where;
  45. }
  46. /**
  47. * @notes 获取列表
  48. * @return array
  49. * @throws \think\db\exception\DataNotFoundException
  50. * @throws \think\db\exception\DbException
  51. * @throws \think\db\exception\ModelNotFoundException
  52. * @author likeadmin
  53. * @date 2025/05/23 13:40
  54. */
  55. public function lists(): array
  56. {
  57. return DouyinRefundOrder::where($this->searchWhere)->where($this->queryWhere())
  58. ->field(['*'])
  59. ->append(['refund_status_text'])
  60. ->limit($this->limitOffset, $this->limitLength)
  61. ->order(['id' => 'desc'])
  62. ->select()
  63. ->toArray();
  64. }
  65. /**
  66. * @notes 获取数量
  67. * @return int
  68. * @author likeadmin
  69. * @date 2025/05/23 13:40
  70. */
  71. public function count(): int
  72. {
  73. return DouyinRefundOrder::where($this->searchWhere)->where($this->queryWhere())->count();
  74. }
  75. }