[Clien Portal] Alarm Center - Service Monitoring
This commit is contained in:
@@ -394,22 +394,22 @@ class Member extends Model
|
||||
// );
|
||||
// }
|
||||
|
||||
protected function corporateLogo(): Attribute
|
||||
{
|
||||
$avatar = null;
|
||||
// protected function corporateLogo(): Attribute
|
||||
// {
|
||||
// $avatar = null;
|
||||
|
||||
if ($this->relationLoaded('currentPolicy')) {
|
||||
$corporateId = $this->currentPolicy->corporate->id;
|
||||
$avatar = File::where(['type' => 'avatar', 'fileable_id' => $corporateId])
|
||||
->orderBy('id', 'desc')
|
||||
->first();
|
||||
}
|
||||
// if ($this->relationLoaded('currentPolicy')) {
|
||||
// $corporateId = $this->currentPolicy->corporate->id;
|
||||
// $avatar = File::where(['type' => 'avatar', 'fileable_id' => $corporateId])
|
||||
// ->orderBy('id', 'desc')
|
||||
// ->first();
|
||||
// }
|
||||
|
||||
$path = $avatar ? $_ENV['LMS_APP_STORAGE'] . $avatar->path : '';
|
||||
// $path = $avatar ? $_ENV['LMS_APP_STORAGE'] . $avatar->path : '';
|
||||
|
||||
return Attribute::make(
|
||||
get: fn () => $path
|
||||
);
|
||||
}
|
||||
// return Attribute::make(
|
||||
// get: fn () => $path
|
||||
// );
|
||||
// }
|
||||
/* -------------------------------------------------------------------------- */
|
||||
}
|
||||
|
||||
@@ -241,11 +241,6 @@ class RequestLog extends Model
|
||||
return $this->belongsTo(Service::class, 'service_code', 'code');
|
||||
}
|
||||
|
||||
public function requestLogBenefit()
|
||||
{
|
||||
return $this->hasOne(RequestLogBenefit::class, 'request_log_id');
|
||||
}
|
||||
|
||||
public function requestLogBenefits()
|
||||
{
|
||||
return $this->hasMany(RequestLogBenefit::class, 'request_log_id');
|
||||
|
||||
@@ -31,6 +31,6 @@ class RequestLogBenefit extends Model
|
||||
|
||||
public function requestLog()
|
||||
{
|
||||
return $this->belongsTo(RequestLog::class, 'aa');
|
||||
return $this->belongsTo(RequestLog::class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
@@ -18,4 +19,13 @@ class RequestLogDailyMonitoring extends Model
|
||||
{
|
||||
return $this->hasMany(RequestLogMedicalPlan::class);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
protected function code(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn ($value, $attributes) => 'RE-' . str_pad($attributes['id'], 3, '0', STR_PAD_LEFT),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ class RequestLogMedicalPlan extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'request_log_medical_plan';
|
||||
|
||||
public function requestLogDailyMonitoring()
|
||||
{
|
||||
return $this->belongsTo(RequestLogDailyMonitoring::class);
|
||||
|
||||
Reference in New Issue
Block a user