Cron Jobs, Reminder, Fonts, Members / Wizard / Price, Credit and Promotion

This commit is contained in:
Kevin Adametz 2023-01-25 12:42:41 +01:00
parent a0f4eda6ea
commit 6167273a48
204 changed files with 8746 additions and 215 deletions

View file

@ -3,6 +3,7 @@ namespace App\Services;
use App\User;
use App\Models\PromotionUser;
class UserService
{
@ -18,4 +19,15 @@ class UserService
return $confirmation_code;
}
public static function hasActivePromotion($user) {
$promotion_users = PromotionUser::where('user_id', $user->id)->where('active', 1)->whereNull('user_deleted_at')->get();
foreach($promotion_users as $promotion_user){
if($promotion_user->promotion_admin->isActive()){
return true;
}
}
return false;
}
}