|
@@ -10,7 +10,7 @@ namespace App\Models;
|
|
|
|
|
|
class ServicePack extends BaseModel
|
|
class ServicePack extends BaseModel
|
|
{
|
|
{
|
|
- protected $appends = ['label_texts', 'service_pack_protocol'];
|
|
|
|
|
|
+ protected $appends = ['label_texts', 'service_pack_protocol', 'service_agreement_protocol'];
|
|
protected $table = 'service_packs';
|
|
protected $table = 'service_packs';
|
|
protected $casts = [
|
|
protected $casts = [
|
|
'label' => 'json',
|
|
'label' => 'json',
|
|
@@ -29,7 +29,7 @@ class ServicePack extends BaseModel
|
|
|
|
|
|
return $data;
|
|
return $data;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public function systemconfig(){
|
|
public function systemconfig(){
|
|
return $this->hasOne(SystemConfig::class,'id','agreement_id');
|
|
return $this->hasOne(SystemConfig::class,'id','agreement_id');
|
|
}
|
|
}
|
|
@@ -44,11 +44,23 @@ class ServicePack extends BaseModel
|
|
return $data;
|
|
return $data;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function getServiceAgreementProtocolAttribute()
|
|
|
|
+ {
|
|
|
|
+ $data = '';
|
|
|
|
+ if (!empty($this->service_agreement_id)) {
|
|
|
|
+ $data = ServiceAgreement::where('id', $this->service_agreement_id)->value('content');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return $data;
|
|
|
|
+ }
|
|
|
|
+
|
|
public function insuranceagreement()
|
|
public function insuranceagreement()
|
|
{
|
|
{
|
|
return $this->hasOne(InsuranceAgreement::class,'id','agreement_id');
|
|
return $this->hasOne(InsuranceAgreement::class,'id','agreement_id');
|
|
}
|
|
}
|
|
- public function serviceagreement(){
|
|
|
|
|
|
+
|
|
|
|
+ public function serviceagreement()
|
|
|
|
+ {
|
|
return $this->hasOne(ServiceAgreement::class,'id','service_agreement_id');
|
|
return $this->hasOne(ServiceAgreement::class,'id','service_agreement_id');
|
|
}
|
|
}
|
|
}
|
|
}
|