ServiceWorkGrabOrderLogLists.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. namespace app\workerapi\lists;
  3. use app\common\model\works\ServiceWork;
  4. use app\common\model\works\ServiceWorkAllocateWorkerLog;
  5. class ServiceWorkGrabOrderLogLists extends BaseWorkerDataLists
  6. {
  7. /**
  8. * 获取列表 - 15天内
  9. * @return array
  10. * @author liugc <466014217@qq.com>
  11. * @date 2025/5/8 9:16
  12. */
  13. public function lists(): array
  14. {
  15. return ServiceWorkAllocateWorkerLog::alias("a")
  16. ->join("service_work b","a.work_id = b.id AND a.master_worker_id = b.master_worker_id")
  17. ->where('a.type',3)
  18. ->where('a.create_time','>',(time()-15*86400))
  19. ->where('a.master_worker_id',$this->userId)
  20. ->field(['a.opera_log','b.id', 'b.work_sn', 'b.address', 'b.title', 'b.work_status', 'b.service_status','b.work_pay_status', 'b.appointment_time','b.receive_time','b.base_service_fee','b.service_fee'])
  21. ->append(['b.work_status_text','b.service_status_text'])
  22. ->limit($this->limitOffset, $this->limitLength)
  23. ->order(['b.appointment_time' => 'asc'])
  24. ->select()
  25. ->toArray();
  26. }
  27. /**
  28. * 获取数量
  29. * @return int
  30. * @author liugc <466014217@qq.com>
  31. * @date 2025/5/8 9:16
  32. */
  33. public function count(): int
  34. {
  35. return ServiceWorkAllocateWorkerLog::alias("a")
  36. ->join("service_work b","a.work_id = b.id AND a.master_worker_id = b.master_worker_id")
  37. ->where('a.type',3)
  38. ->where('a.create_time','>',(time()-15*86400))
  39. ->where('a.master_worker_id',$this->userId)->count();
  40. }
  41. }