@@ -64,6 +64,7 @@ class WorkerAccountLogLists extends BaseAdminDataLists implements ListsSearchInt
{
$field = 'u.nickname,u.account,u.sn,u.avatar,u.mobile,al.action,al.change_amount,al.left_amount,al.change_type,al.work_sn,al.create_time';
$lists = MasterWorkerAccountLog::alias('al')
+ ->with(['serviceWork'])
->join('master_worker u', 'u.id = al.worker_id')
->field($field)
->where($this->searchWhere)
@@ -3,6 +3,7 @@ namespace app\common\model\master_worker;
use app\common\model\BaseModel;
use app\common\model\MasterWorkerRegister;
+use app\common\model\works\ServiceWork;
use think\model\concern\SoftDelete;
/**
@@ -25,4 +26,8 @@ class MasterWorkerAccountLog extends BaseModel
return $this->hasOne(MasterWorker::class, 'id', 'worker_id');
}
+ public function serviceWork()
+ {
+ return $this->hasOne(ServiceWork::class, 'work_sn', 'work_sn');
+ }