| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace app\workerapi\lists;
- use app\common\model\works\ServiceWork;
- use app\common\model\works\ServiceWorkAllocateWorkerLog;
- class ServiceWorkGrabOrderLogLists extends BaseWorkerDataLists
- {
- /**
- * 获取列表 - 15天内
- * @return array
- * @author liugc <466014217@qq.com>
- * @date 2025/5/8 9:16
- */
- public function lists(): array
- {
- return ServiceWorkAllocateWorkerLog::alias("a")
- ->join("service_work b","a.work_id = b.id AND a.master_worker_id = b.master_worker_id")
- ->where('a.type',3)
- ->where('a.create_time','>',(time()-15*86400))
- ->where('a.master_worker_id',$this->userId)
- ->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'])
- ->append(['b.work_status_text','b.service_status_text'])
- ->limit($this->limitOffset, $this->limitLength)
- ->order(['b.appointment_time' => 'asc'])
- ->select()
- ->toArray();
- }
- /**
- * 获取数量
- * @return int
- * @author liugc <466014217@qq.com>
- * @date 2025/5/8 9:16
- */
- public function count(): int
- {
- return ServiceWorkAllocateWorkerLog::alias("a")
- ->join("service_work b","a.work_id = b.id AND a.master_worker_id = b.master_worker_id")
- ->where('a.type',3)
- ->where('a.create_time','>',(time()-15*86400))
- ->where('a.master_worker_id',$this->userId)->count();
- }
- }
|