Custom Price / Land / User Order Homeparty

This commit is contained in:
Kevin Adametz 2021-08-20 18:22:21 +02:00
parent d46824a4ac
commit 51d81d8ec6
55 changed files with 1951 additions and 681 deletions

View file

@ -46,12 +46,14 @@ class PaymentMethod extends Model
'pos' => 'int',
'active' => 'bool',
'default' => 'bool',
'show_on' => 'array',
];
protected $fillable = [
'name',
'short',
'show_at',
'show_on',
'pos',
'default',
'active'
@ -67,10 +69,30 @@ class PaymentMethod extends Model
9 => 'überall',
];
public static $showONs = [
1 => 'KundenShop',
2 => 'BeraterShop',
3 => 'Auszeitparty',
4 => 'Registrierung Berater',
5 => 'Mitgliedschaft Berater',
//6 => 'Onboarding Berater',
10 => 'überall',
];
public function getShowAtType(){
return isset(self::$showATs[$this->show_at]) ? self::$showATs[$this->show_at] : '-';
}
public function getShowOnTypes(){
$ret = [];
if($this->show_on){
foreach($this->show_on as $show){
$ret[] = isset(self::$showONs[$show]) ? self::$showONs[$show] : '-';
}
}
return $ret;
}
public static function getDefaultAsArray($short=false){
return PaymentMethod::where('active', true)->where('default', true)->pluck('id');
}