FinancialPaymentRecordsLists.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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\financial;
  15. use app\adminapi\lists\BaseAdminDataLists;
  16. use app\adminapi\logic\export\ExportLogic;
  17. use app\common\model\financial\FinancialPaymentRecords;
  18. use app\common\lists\ListsSearchInterface;
  19. /**
  20. * FinancialPaymentRecords列表
  21. * Class FinancialPaymentRecordsLists
  22. * @package app\adminapi\lists
  23. */
  24. class FinancialPaymentRecordsLists extends BaseAdminDataLists implements ListsSearchInterface
  25. {
  26. /**
  27. * @notes 设置搜索条件
  28. * @return \string[][]
  29. * @author likeadmin
  30. * @date 2024/12/02 11:55
  31. */
  32. public function setSearch(): array
  33. {
  34. return [
  35. '=' => ['export_conditions', 'batch_number', 'upload_status', 'payment_status'],
  36. ];
  37. }
  38. /**
  39. * @notes 获取列表
  40. * @return array
  41. * @throws \think\db\exception\DataNotFoundException
  42. * @throws \think\db\exception\DbException
  43. * @throws \think\db\exception\ModelNotFoundException
  44. * @author likeadmin
  45. * @date 2024/12/02 11:55
  46. */
  47. public function lists(): array
  48. {
  49. $lists = FinancialPaymentRecords::where($this->searchWhere)
  50. ->field(['id', 'export_conditions', 'batch_number', 'upload_status', 'payment_status'])
  51. ->limit($this->limitOffset, $this->limitLength)
  52. ->order(['id' => 'desc'])
  53. ->select()
  54. ->toArray();
  55. foreach ($lists as &$item) {
  56. $item['file_url'] = ExportLogic::detail(['id'=>$item['export_conditions']['infoExport_id']])['file_url'];
  57. $item['settlement_type'] = $item['export_conditions']['settlement_type'];
  58. $item['deadline_time'] = date('Y-m-d', $item['export_conditions']['deadline_time']-1);
  59. }
  60. return $lists;
  61. }
  62. /**
  63. * @notes 获取数量
  64. * @return int
  65. * @author likeadmin
  66. * @date 2024/12/02 11:55
  67. */
  68. public function count(): int
  69. {
  70. return FinancialPaymentRecords::where($this->searchWhere)->count();
  71. }
  72. }