Updates to 03-2025

This commit is contained in:
Kevin Adametz 2025-04-01 10:39:21 +02:00
parent 6167273a48
commit 9b54eb0512
348 changed files with 34535 additions and 5774 deletions

View file

@ -20,7 +20,6 @@ use Util;
* @method static \Illuminate\Database\Eloquent\Builder|User newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|User newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|User query()
* @mixin \Eloquent
* @property int $id
* @property string $email
* @property \Illuminate\Support\Carbon|null $email_verified_at
@ -105,6 +104,13 @@ use Util;
* @property-read int|null $clients_count
* @property-read \Illuminate\Database\Eloquent\Collection|\Laravel\Passport\Token[] $tokens
* @property-read int|null $tokens_count
* @property-read \App\Models\UserShop|null $shop
* @property int|null $lead_type_id
* @property-read \App\Models\LeadType|null $lead_type
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\UserWhitelabelProduct> $whitelabel_products
* @property-read int|null $whitelabel_products_count
* @method static \Illuminate\Database\Eloquent\Builder|User whereLeadTypeId($value)
* @mixin \Eloquent
*/
class User extends Authenticatable
{
@ -146,6 +152,11 @@ class User extends Authenticatable
return $this->belongsTo('App\Models\UserAccount', 'account_id');
}
public function shop()
{
return $this->hasOne('App\Models\UserShop', 'user_id', 'id');
}
public function user_level(){
return $this->belongsTo('App\Models\UserLevel', 'm_level');
}
@ -158,6 +169,10 @@ class User extends Authenticatable
return $this->belongsTo('App\User', 'm_sponsor');
}
public function lead_type(){
return $this->belongsTo('App\Models\LeadType', 'lead_type_id');
}
public function sponsorHasCommisson(){
if($this->user_sponsor && $this->user_sponsor->user_level && $this->user_sponsor->user_level->partner_provision){
return true;
@ -182,6 +197,10 @@ class User extends Authenticatable
return $this->hasMany('App\Models\UserPayCredit', 'user_id', 'id')->orderBy('created_at', 'DESC');
}
public function whitelabel_products()
{
return $this->hasMany('App\Models\UserWhitelabelProduct', 'user_id', 'id');
}
public function getMUserSponsor(){
if($this->user_sponsor && $this->user_sponsor->account){
@ -310,7 +329,10 @@ class User extends Authenticatable
}
public function isActiveAccount(){
return $this->payment_account ? Carbon::parse($this->payment_account)->gt(Carbon::now()) : false;
if($this->isActive() && $this->payment_account){
return Carbon::parse($this->payment_account)->gt(Carbon::now());
}
return false;
}