This commit is contained in:
xman 2025-04-28 16:50:53 +08:00
parent 3fb6925a8f
commit d4aea44afc
2 changed files with 9 additions and 3 deletions

View File

@ -126,8 +126,6 @@ class Worker extends Backend
if(trim($arr[1])){
$filter['end_time'] = trim($arr[1]);
}
}
//派单表
@ -139,7 +137,7 @@ class Worker extends Backend
[$where, $sort, $order, $offset, $limit] = $this->buildparams();
$list = $this->model->alias('fa_worker')
->with(['area'])
->with(['area','items'])
->field([
'fa_worker.*',
'IFNULL(a.dispatch_count, 0) AS dispatch_count',

View File

@ -62,4 +62,12 @@ class Worker extends BaseModel
}
// 定义通过中间表与 roles 表的一对多关系
public function items()
{
return $this->hasManyThrough(Item::class, WorkerItem::class, 'worker_id', 'item_id', 'id', 'id');
}
}