23-01-2026

This commit is contained in:
Kevin Adametz 2026-01-23 17:35:23 +01:00
parent a939cd51ef
commit a8b395e20d
248 changed files with 29342 additions and 4805 deletions

View file

@ -40,26 +40,28 @@ class UserAboOrder extends Model
protected $casts = [
'user_abo_id' => 'int',
'shopping_order_id' => 'int',
'status' => 'int'
'status' => 'int',
'paid' => 'bool'
];
protected $fillable = [
'user_abo_id',
'user_id',
'shopping_order_id',
'status'
'status',
'paid'
];
public static $statusTypes = [
0 => 'abo_new',
1 => 'abo_new',
1 => 'abo_new',
2 => 'abo_okay',
3 => 'abo_hold',
4 => 'abo_cancel',
5 => 'abo_finish',
6 => 'abo_inactive',
7 => 'abo_grace'
];
];
public static $statusColors = [
0 => 'success',
@ -70,7 +72,7 @@ class UserAboOrder extends Model
5 => 'info',
6 => 'warning',
7 => 'danger'
];
];
@ -84,16 +86,18 @@ class UserAboOrder extends Model
return $this->belongsTo(UserAbo::class);
}
public function getStatusFormated(){
return '<span class="badge badge-pill badge-'.$this->getStatusColor().'">'.$this->getStatusType().'</span>';
public function getStatusFormated()
{
return '<span class="badge badge-pill badge-' . $this->getStatusColor() . '">' . $this->getStatusType() . '</span>';
}
public function getStatusType(){
return isset(self::$statusTypes[$this->status]) ? __('abo.'.self::$statusTypes[$this->status]) : "";
}
public function getStatusColor(){
return isset(self::$statusColors[$this->status]) ? self::$statusColors[$this->status] : "default";
}
public function getStatusType()
{
return isset(self::$statusTypes[$this->status]) ? __('abo.' . self::$statusTypes[$this->status]) : "";
}
public function getStatusColor()
{
return isset(self::$statusColors[$this->status]) ? self::$statusColors[$this->status] : "default";
}
}