Updates to 03-2025
This commit is contained in:
parent
6167273a48
commit
9b54eb0512
348 changed files with 34535 additions and 5774 deletions
|
|
@ -51,7 +51,6 @@ use Illuminate\Database\Eloquent\Model;
|
|||
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrderMargin whereStatus($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrderMargin whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrderMargin whereUserId($value)
|
||||
* @mixin \Eloquent
|
||||
* @property \Illuminate\Support\Carbon|null $partner_commission_pending_to
|
||||
* @property bool|null $partner_commission_paid
|
||||
* @property-read User|null $m_sponsor
|
||||
|
|
@ -59,6 +58,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrderMargin wherePartnerCommissionPendingTo($value)
|
||||
* @property int|null $user_credit_id
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|ShoppingOrderMargin whereUserCreditId($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class ShoppingOrderMargin extends Model
|
||||
{
|
||||
|
|
@ -73,10 +73,13 @@ class ShoppingOrderMargin extends Model
|
|||
'from_payment_credit' => 'float',
|
||||
'm_sponsor_id' => 'int',
|
||||
'net_partner_commission' => 'float',
|
||||
'paid' => 'bool',
|
||||
'cancellation' => 'bool',
|
||||
'status' => 'int',
|
||||
'partner_commission_pending_to' => 'datetime',
|
||||
'order_paid' => 'bool', //ist die Bestellung bezahlt?
|
||||
'out_paid' => 'bool', //ist die Provision Marge ausgezahlt?
|
||||
'cancellation' => 'bool', //ist die Stornierung beantragt?
|
||||
'status' => 'int', //status der Bestellung
|
||||
'margin_pending_to' => 'datetime',
|
||||
'margin_paid' => 'bool',
|
||||
'partner_commission_pending_to' => 'datetime',
|
||||
'partner_commission_paid' => 'bool',
|
||||
'user_credit_id' => 'int',
|
||||
];
|
||||
|
|
@ -95,15 +98,29 @@ class ShoppingOrderMargin extends Model
|
|||
'm_sponsor_id',
|
||||
'net_partner_commission',
|
||||
'from',
|
||||
'paid',
|
||||
'order_paid',
|
||||
'out_paid',
|
||||
'cancellation',
|
||||
'status',
|
||||
'margin_pending_to',
|
||||
'margin_paid',
|
||||
'partner_commission_pending_to',
|
||||
'partner_commission_paid',
|
||||
'user_credit_id',
|
||||
'content'
|
||||
];
|
||||
|
||||
|
||||
public static $statusTypes = [
|
||||
0 => 'user order',
|
||||
1 => '',
|
||||
7 => 'from promotion',
|
||||
8 => 'from shop',
|
||||
9 => 'storniert'
|
||||
];
|
||||
|
||||
private $storedContent;
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
|
|
@ -131,4 +148,33 @@ class ShoppingOrderMargin extends Model
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getFormattedNetDiscount()
|
||||
{
|
||||
return formatNumber($this->attributes['net_discount']);
|
||||
}
|
||||
|
||||
public function getFormattedNetPartnerCommission()
|
||||
{
|
||||
return formatNumber($this->attributes['net_partner_commission']);
|
||||
}
|
||||
|
||||
public function getRestoreContent($key = false)
|
||||
{
|
||||
if(!$this->storedContent){
|
||||
$this->storedContent = unserialize($this->attributes['content']);
|
||||
}
|
||||
if (is_array($this->storedContent)) {
|
||||
switch ($key) {
|
||||
case 'items':
|
||||
return $this->storedContent['items'];
|
||||
break;
|
||||
case 'commission':
|
||||
return $this->storedContent['commission'];
|
||||
break;
|
||||
|
||||
}
|
||||
return $this->storedContent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue