Custom Price / Land / User Order Homeparty
This commit is contained in:
parent
d46824a4ac
commit
51d81d8ec6
55 changed files with 1951 additions and 681 deletions
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue