MasterWorkerRetentionMoneyLogLists.php 877 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * @author 林海涛
  4. * @date 2024/7/28 上午11:30
  5. */
  6. namespace app\workerapi\lists;
  7. use app\common\model\master_worker\MasterWorkerRetentionMoneyLog;
  8. class MasterWorkerRetentionMoneyLogLists extends BaseWorkerDataLists
  9. {
  10. public function queryWhere()
  11. {
  12. $where = [];
  13. $where[] = ['worker_id', '=', $this->userId];
  14. return $where;
  15. }
  16. public function lists(): array
  17. {
  18. return MasterWorkerRetentionMoneyLog::where($this->searchWhere)
  19. ->where($this->queryWhere())
  20. ->append(['action_text'])
  21. ->field(['id', 'action','amount','remark','create_time','update_time'])
  22. ->order(['id' => 'dsc'])
  23. ->select()
  24. ->toArray();
  25. }
  26. public function count(): int
  27. {
  28. return MasterWorkerRetentionMoneyLog::where($this->queryWhere())->count();
  29. }
  30. }