| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace app\workerapi\lists;
- 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
- {
- $list = 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'])
- ->limit($this->limitOffset, $this->limitLength)
- ->order(['b.appointment_time' => 'asc'])
- ->select()
- ->toArray();
- foreach ($list as &$item) {
- $item['work_status_text'] = (new \app\common\model\works\ServiceWork)->getWorkStatusTextAttr('',$item);
- $item['service_status_text'] = (new \app\common\model\works\ServiceWork)->getServiceStatusTextAttr('',$item);
- $item['appointment_time'] = (new \app\common\model\works\ServiceWork)->getAppointmentTimeAttr('',$item);
- }
- return $list;
- }
- /**
- * 获取数量
- * @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();
- }
- }
|