One Hat Cyber Team
Your IP :
3.133.142.101
Server IP :
192.145.235.60
Server :
Linux ngx365.inmotionhosting.com 5.14.0-427.33.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 30 09:45:56 EDT 2024 x86_64
Server Software :
Apache
PHP Version :
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
centos12
/
public_html
/
centosuit
/
app
/
Models
/
Edit File:
Promotion.php
<?php namespace App\Models; use App\Traits\HasCompany; class Promotion extends BaseModel { use HasCompany; public function employee() { return $this->belongsTo(User::class); } public function currentDesignation() { return $this->belongsTo(Designation::class, 'current_designation_id'); } public function previousDesignation() { return $this->belongsTo(Designation::class, 'previous_designation_id'); } public function currentDepartment() { return $this->belongsTo(Team::class, 'current_department_id'); } public function previousDepartment() { return $this->belongsTo(Team::class, 'previous_department_id'); } public static function employeePromotions($userId) { return self::where('employee_id', $userId) ->whereNotNull('current_designation_id') ->whereNotNull('previous_designation_id') ->whereColumn('current_designation_id', '!=', 'previous_designation_id') ->with(['employee', 'currentDesignation', 'previousDesignation']) ->get(); } }
Simpan