23-01-2026
This commit is contained in:
parent
a939cd51ef
commit
a8b395e20d
248 changed files with 29342 additions and 4805 deletions
|
|
@ -69,7 +69,25 @@ class UserLevel extends Model
|
|||
protected $table = 'user_levels';
|
||||
|
||||
protected $fillable = [
|
||||
'next_id', 'name', 'margin', 'margin_shop', 'qual_kp', 'qual_pp', 'growth_bonus', 'pr_line_1', 'pr_line_2', 'pr_line_3', 'pr_line_4', 'pr_line_5', 'pr_line_6', 'pr_line_7', 'pr_line_8', 'paylines', 'pos', 'active', 'default',
|
||||
'next_id',
|
||||
'name',
|
||||
'margin',
|
||||
'margin_shop',
|
||||
'qual_kp',
|
||||
'qual_pp',
|
||||
'growth_bonus',
|
||||
'pr_line_1',
|
||||
'pr_line_2',
|
||||
'pr_line_3',
|
||||
'pr_line_4',
|
||||
'pr_line_5',
|
||||
'pr_line_6',
|
||||
'pr_line_7',
|
||||
'pr_line_8',
|
||||
'paylines',
|
||||
'pos',
|
||||
'active',
|
||||
'default',
|
||||
];
|
||||
|
||||
|
||||
|
|
@ -83,15 +101,16 @@ class UserLevel extends Model
|
|||
return $this->hasMany(TransUserLevel::class, 'user_level_id');
|
||||
}
|
||||
|
||||
public function getNextUserLevels(){
|
||||
public function getNextUserLevels()
|
||||
{
|
||||
//$ret = [0=>'Keinen'];
|
||||
$ret = UserLevel::where('active', true)->where('id', '!=', $this->id)->orderBy('pos', 'asc')->get()->pluck('name', 'id')->toArray();
|
||||
return [0 => '-> Keinen Karriere Level'] + $ret;
|
||||
}
|
||||
|
||||
public function setPosAttribute($value){
|
||||
public function setPosAttribute($value)
|
||||
{
|
||||
$this->attributes['pos'] = is_numeric($value) ? $value : null;
|
||||
|
||||
}
|
||||
|
||||
public function setGrowthBonusAttribute($value)
|
||||
|
|
@ -100,7 +119,7 @@ class UserLevel extends Model
|
|||
}
|
||||
public function getFormattedGrowthBonus()
|
||||
{
|
||||
return isset($this->attributes['growth_bonus']) ? Util::formatNumber($this->attributes['growth_bonus'],1) : "";
|
||||
return isset($this->attributes['growth_bonus']) ? Util::formatNumber($this->attributes['growth_bonus'], 2) : "";
|
||||
}
|
||||
|
||||
public function getFormattedMargin()
|
||||
|
|
@ -112,7 +131,7 @@ class UserLevel extends Model
|
|||
{
|
||||
return isset($this->attributes['margin_shop']) ? Util::formatNumber($this->attributes['margin_shop'], 1) : "";
|
||||
}
|
||||
|
||||
|
||||
public function getLang($key)
|
||||
{
|
||||
$lang = \App::getLocale();
|
||||
|
|
@ -125,9 +144,7 @@ class UserLevel extends Model
|
|||
|
||||
public function getTrans($key, $lang)
|
||||
{
|
||||
$trans = $this->translations->where('language','=', $lang)->where('key', $key)->first();
|
||||
$trans = $this->translations->where('language', '=', $lang)->where('key', $key)->first();
|
||||
return $trans ? $trans->value : '';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue