last changes since 6-2023
This commit is contained in:
parent
0341c9c189
commit
04d677d37a
142 changed files with 7895 additions and 2855 deletions
|
|
@ -25,7 +25,7 @@ class UserPaymentCredits
|
|||
->where('user_businesses.month', '=', $this->month)
|
||||
->where('user_businesses.year', '=', $this->year)
|
||||
->where(function($q) {
|
||||
return $q->where('user_businesses.commission_team_total', '>', 0)
|
||||
return $q->where('user_businesses.commission_pp_total', '>', 0)
|
||||
->orWhere('user_businesses.commission_shop_sales', '>', 0);
|
||||
})
|
||||
->get();
|
||||
|
|
@ -46,17 +46,28 @@ class UserPaymentCredits
|
|||
]);
|
||||
}
|
||||
}
|
||||
if($userBusiness->commission_team_total > 0){
|
||||
if($userBusiness->commission_pp_total > 0){
|
||||
if($this->hasNotUserCreditItem($userBusiness, 2)){
|
||||
UserCreditItem::create([
|
||||
'user_id' => $userBusiness->user_id,
|
||||
'user_business_id' => $userBusiness->id,
|
||||
'credit' => $userBusiness->commission_team_total,
|
||||
'message' => 'Provision Team '.$date,
|
||||
'credit' => $userBusiness->commission_pp_total,
|
||||
'message' => 'Provision Payline '.$date,
|
||||
'status' => 2,
|
||||
]);
|
||||
}
|
||||
}
|
||||
if($userBusiness->commission_growth_total > 0){
|
||||
if($this->hasNotUserCreditItem($userBusiness, 5)){
|
||||
UserCreditItem::create([
|
||||
'user_id' => $userBusiness->user_id,
|
||||
'user_business_id' => $userBusiness->id,
|
||||
'credit' => $userBusiness->commission_growth_total,
|
||||
'message' => 'Provision Wachstumsbonus '.$date,
|
||||
'status' => 5,
|
||||
]);
|
||||
}
|
||||
}
|
||||
return $userBusiness;
|
||||
|
||||
}
|
||||
|
|
@ -74,7 +85,7 @@ class UserPaymentCredits
|
|||
$user = User::findOrFail($user_id);
|
||||
$data = [];
|
||||
if($credit_send_mail){
|
||||
$data['credit_send_mail'] = true;
|
||||
$data['credit_send_mail'] = false;
|
||||
}
|
||||
$credit_repo = new CreditRepository($user);
|
||||
return $credit_repo->create($data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue