mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-19 12:24:01 +00:00
clone contract UI
This commit is contained in:
@@ -15,7 +15,8 @@ class ContractObligation extends Model
|
||||
'hash_id',
|
||||
'contract_list',
|
||||
'contract_obligation_dependency_list',
|
||||
'depend_contract_obligation_dependency_list'
|
||||
'depend_contract_obligation_dependency_list',
|
||||
'contract_entity_list'
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
@@ -37,6 +38,11 @@ class ContractObligation extends Model
|
||||
return $this->hasMany('App\Models\ContractObligationDependency', 'depend_contract_obligation_id');
|
||||
}
|
||||
|
||||
public function contract_entity()
|
||||
{
|
||||
return $this->belongsTo('App\Models\ContractEntity', 'contract_entity_id');
|
||||
}
|
||||
|
||||
public function getHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('contract_obligations', $this->id);
|
||||
@@ -61,6 +67,11 @@ class ContractObligation extends Model
|
||||
->get()->makeHidden(['contract_obligation_list', 'depend_contract_obligation_list']);
|
||||
}
|
||||
|
||||
public function getContractEntityListAttribute()
|
||||
{
|
||||
return $this->contract_entity()->get()->makeHidden(['contract_list']);
|
||||
}
|
||||
|
||||
public function getUpdatedAtAttribute($date)
|
||||
{
|
||||
return $date ? Carbon::parse($date)->timezone('Asia/Kuala_Lumpur')->format('Y-m-d') : '';
|
||||
|
||||
Reference in New Issue
Block a user