12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace App\Models;
- use Illuminate\Database\Eloquent\Model;
- class HrBind extends Model
- {
- protected $table = 'hr_binds';
- public function oneMember()
- {
- return $this->belongsTo(Member::class, 'member_id');
- }
- public function oneCompany()
- {
- return $this->belongsTo(Company::class, 'company_id');
- }
- public function memberInfo()
- {
- return $this->hasOne(Member::class, 'id', 'member_id');
- }
- public function companyInfo()
- {
- return $this->hasOne(Company::class, 'id', 'company_id');
- }
- public function getBindedAtAttribute($value)
- {
- return date('Y-m-d H:i', $value);
- }
- }
|