last changes since 6-2023
This commit is contained in:
parent
0341c9c189
commit
04d677d37a
142 changed files with 7895 additions and 2855 deletions
|
|
@ -12,6 +12,7 @@ use App\Models\ShoppingPayment;
|
|||
use App\Services\ShopApiOrderCart;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use App\Repositories\InvoiceRepository;
|
||||
use App\Services\BusinessPlan\SalesPointsVolume;
|
||||
|
||||
class Payment
|
||||
{
|
||||
|
|
@ -106,6 +107,21 @@ class Payment
|
|||
]);
|
||||
}
|
||||
|
||||
public static function addSponsorBuyingPoints(User $user, $product){
|
||||
|
||||
if($user->user_sponsor){
|
||||
$data = [
|
||||
'user_id' => $user->user_sponsor->id,
|
||||
'total_net' => 0,
|
||||
'points' => $product->sponsor_buying_points_amount,
|
||||
'info' => 'VP: '.$user->getFullName(false).' | '.$product->name,
|
||||
'status_points' => 2,
|
||||
'status' => 5
|
||||
];
|
||||
SalesPointsVolume::addSalesPointsVolume($data);
|
||||
}
|
||||
}
|
||||
|
||||
public static function updateUserLevel(User $user, $to_level_id){
|
||||
//nur updaten, wenn der user->m_level kleiner ist als $to_level_id
|
||||
if($user->user_level){
|
||||
|
|
@ -140,6 +156,9 @@ class Payment
|
|||
if($shopping_order_item->product->buying_restriction){
|
||||
self::addBuyingRestriction($user, $shopping_order_item->product->id);
|
||||
}
|
||||
if($shopping_order_item->product->sponsor_buying_points){
|
||||
self::addSponsorBuyingPoints($user, $shopping_order_item->product);
|
||||
}
|
||||
if($shopping_order_item->product->action){
|
||||
$send_link = true;
|
||||
//new date
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue