This commit is contained in:
mobin
2026-04-08 07:22:13 +00:00
parent 2adb741dac
commit a6b5f27343
30300 changed files with 134406 additions and 1504 deletions
+6 -3
View File
@@ -32,6 +32,8 @@ class User extends Authenticatable
'user_name',
'is_admin',
'plain_id',
'break',
'req_counts',
];
@@ -62,14 +64,14 @@ class User extends Authenticatable
'task_id', // ستون جدول واسط که به جدول tasks اشاره می‌کنه
'plain_id', // ستون جدول users که ستون جدول واسط بهش اشاره می‌کنه (local key)
'task_id' // ستون جدول tasks که ستون جدول واسط بهش اشاره می‌کنه (related key)
);
)->withPivot(['id', 'started_at','ended_at','duration',]);
}
public function attendances()
{
return $this->hasMany(Attendance::class, 'user_identity', 'user_name')
->select('id', 'user_identity', 'entered_at', 'exited_at', 'duration','requested')
->select('id', 'user_identity', 'entered_at', 'exited_at', 'duration','requested', 'distance', 'distance_exit')
->orderBy('entered_at', 'desc');
@@ -79,7 +81,8 @@ class User extends Authenticatable
return $this->hasManyThrough(AttendanceBreak::class,Attendance::class,'user_identity','attendance_id',
'user_name', // local key در users
'id' // local key در attendances
);
)->orderBy('entered_at', 'desc');
}