mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/unity.git
synced 2026-08-19 04:13:58 +00:00
contract obligation contract dependency generate
This commit is contained in:
@@ -15,7 +15,8 @@ class ContractTemplateObligation extends Model
|
||||
'hash_id',
|
||||
'contract_template_list',
|
||||
'contract_template_obligation_dependency_list',
|
||||
'depend_contract_template_obligation_dependency_list'
|
||||
'depend_contract_template_obligation_dependency_list',
|
||||
'contract_template_obligation_contract_template_dependency_list'
|
||||
];
|
||||
|
||||
public function contract_template()
|
||||
@@ -33,6 +34,11 @@ class ContractTemplateObligation extends Model
|
||||
return $this->hasMany('App\Models\ContractTemplateObligationDependency', 'depend_contract_template_obligation_id');
|
||||
}
|
||||
|
||||
public function contract_template_obligation_contract_template_dependency()
|
||||
{
|
||||
return $this->hasMany('App\Models\ContractTemplateObligationContractTemplateDependency', 'contract_template_obligation_id');
|
||||
}
|
||||
|
||||
public function getHashIdAttribute()
|
||||
{
|
||||
return Hasher::encode('contract_template_obligations', $this->id);
|
||||
@@ -46,17 +52,24 @@ class ContractTemplateObligation extends Model
|
||||
public function getContractTemplateObligationDependencyListAttribute()
|
||||
{
|
||||
return $this->contract_template_obligation_dependency()
|
||||
->where('status', config('constants.contract_template_obligation.status.active'))
|
||||
->where('status', config('constants.contract_template_obligation_dependency.status.active'))
|
||||
->get()->makeHidden(['contract_template_obligation_list', 'depend_contract_template_obligation_list']);
|
||||
}
|
||||
|
||||
public function getDependContractTemplateObligationDependencyListAttribute()
|
||||
{
|
||||
return $this->depend_contract_template_obligation_dependency()
|
||||
->where('status', config('constants.contract_template_obligation.status.active'))
|
||||
->where('status', config('constants.contract_template_obligation_dependency.status.active'))
|
||||
->get()->makeHidden(['contract_template_obligation_list', 'depend_contract_template_obligation_list']);
|
||||
}
|
||||
|
||||
public function getContractTemplateObligationContractTemplateDependencyListAttribute()
|
||||
{
|
||||
return $this->contract_template_obligation_dependency()
|
||||
->where('status', config('constants.contract_template_obligation_contract_template_dependency.status.active'))
|
||||
->get()->makeHidden(['contract_template_obligation_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