RetentionMoneyLogLists.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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\master_worker;
  15. use app\adminapi\lists\BaseAdminDataLists;
  16. use app\common\lists\ListsSearchInterface;
  17. use app\common\model\master_worker\MasterWorkerRetentionMoneyLog;
  18. /**
  19. * 账记流水列表
  20. * Class AccountLogLists
  21. * @package app\adminapi\lists\finance
  22. */
  23. class RetentionMoneyLogLists extends BaseAdminDataLists implements ListsSearchInterface
  24. {
  25. /**
  26. * @notes 搜索条件
  27. * @return array
  28. * @author 段誉
  29. * @date 2023/2/24 15:26
  30. */
  31. public function setSearch(): array
  32. {
  33. return [
  34. '=' => ['worker_id','action'],
  35. ];
  36. }
  37. /**
  38. * @notes 搜索条件
  39. * @author 段誉
  40. * @date 2023/2/24 15:26
  41. */
  42. public function queryWhere()
  43. {
  44. $where = [];
  45. return $where;
  46. }
  47. /**
  48. * @notes 获取列表
  49. * @return array
  50. * @author 段誉
  51. * @date 2023/2/24 15:31
  52. */
  53. public function lists(): array
  54. {
  55. $lists = MasterWorkerRetentionMoneyLog::alias('al')
  56. ->where($this->searchWhere)
  57. ->where($this->queryWhere())
  58. ->append(['action_text'])
  59. ->limit($this->limitOffset, $this->limitLength)
  60. ->select()
  61. ->toArray();
  62. return $lists;
  63. }
  64. /**
  65. * @notes 获取数量
  66. * @return int
  67. * @author 段誉
  68. * @date 2023/2/24 15:36
  69. */
  70. public function count(): int
  71. {
  72. return MasterWorkerRetentionMoneyLog::where($this->queryWhere())
  73. ->where($this->searchWhere)
  74. ->count();
  75. }
  76. }