ServiceWorkGrabOrderLists.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace app\workerapi\lists;
  3. use app\common\model\works\ServiceWork;
  4. class ServiceWorkGrabOrderLists extends BaseWorkerDataLists
  5. {
  6. /**
  7. * 获取列表
  8. * @return array
  9. * @author liugc <466014217@qq.com>
  10. * @date 2025/5/8 9:16
  11. */
  12. public function lists(): array
  13. {
  14. return ServiceWork::where('appointment_time','>',time())
  15. ->where(['work_status'=>0,'service_status'=>0,'work_pay_status'=>1,'master_worker_id'=>0])
  16. ->field(['id', 'work_sn', 'address', 'title', 'work_status', 'service_status','work_pay_status', 'appointment_time','receive_time','base_service_fee','service_fee'])
  17. ->append(['work_status_text','service_status_text'])
  18. ->limit($this->limitOffset, $this->limitLength)
  19. ->order(['appointment_time' => 'asc'])
  20. ->select()
  21. ->toArray();
  22. }
  23. /**
  24. * 获取数量
  25. * @return int
  26. * @author liugc <466014217@qq.com>
  27. * @date 2025/5/8 9:16
  28. */
  29. public function count(): int
  30. {
  31. return ServiceWork::where('appointment_time','>',time())->where(['work_status'=>0,'service_status'=>0,'work_pay_status'=>1,'master_worker_id'=>0])->count();
  32. }
  33. }