08 2024
This commit is contained in:
parent
04d677d37a
commit
bfa3bb1df4
1191 changed files with 637397 additions and 10619 deletions
45
app/User.php
45
app/User.php
|
|
@ -115,6 +115,9 @@ use Laravel\Passport\HasApiTokens;
|
|||
* @property-read int|null $tokens_count
|
||||
* @property array|null $payment_methods
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\User wherePaymentMethods($value)
|
||||
* @property int|null $pre_sponsor
|
||||
* @property-read User|null $user_pre_sponsor
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|User wherePreSponsor($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class User extends Authenticatable
|
||||
|
|
@ -164,6 +167,10 @@ class User extends Authenticatable
|
|||
return $this->belongsTo('App\User', 'm_sponsor');
|
||||
}
|
||||
|
||||
public function user_pre_sponsor(){
|
||||
return $this->belongsTo('App\User', 'pre_sponsor');
|
||||
}
|
||||
|
||||
public function payment_order_product(){
|
||||
return $this->belongsTo('App\Models\Product', 'payment_order_id');
|
||||
}
|
||||
|
|
@ -201,6 +208,11 @@ class User extends Authenticatable
|
|||
return $this->hasMany('App\Models\ShoppingUser', 'member_id', 'id');
|
||||
}
|
||||
|
||||
public function getLocale(){
|
||||
return $this->lang ? $this->lang : \App::getLocale();
|
||||
}
|
||||
|
||||
|
||||
public function getMUserSponsor(){
|
||||
if($this->user_sponsor && $this->user_sponsor->account){
|
||||
return $this->user_sponsor->account->first_name." ".$this->user_sponsor->account->last_name." | ".$this->user_sponsor->email;
|
||||
|
|
@ -228,10 +240,11 @@ class User extends Authenticatable
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isAdmin()
|
||||
public function isVIP()
|
||||
{
|
||||
if($this->admin >= 1){
|
||||
return true;
|
||||
|
|
@ -239,10 +252,11 @@ class User extends Authenticatable
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isSuperAdmin()
|
||||
public function isAdmin()
|
||||
{
|
||||
if($this->admin >= 2){
|
||||
return true;
|
||||
|
|
@ -253,7 +267,7 @@ class User extends Authenticatable
|
|||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isSySAdmin()
|
||||
public function isSuperAdmin()
|
||||
{
|
||||
if($this->admin >= 3){
|
||||
return true;
|
||||
|
|
@ -261,6 +275,17 @@ class User extends Authenticatable
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isSySAdmin()
|
||||
{
|
||||
if($this->admin >= 4){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public function isUserHasApi()
|
||||
{
|
||||
|
|
@ -275,7 +300,7 @@ class User extends Authenticatable
|
|||
*/
|
||||
public function isApiUser()
|
||||
{
|
||||
if($this->admin >= 4){
|
||||
if($this->admin >= 5){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -301,10 +326,9 @@ class User extends Authenticatable
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function isAboOption(){
|
||||
return ($this->abo_options && $this->account && $this->account->payment_data) ? true : false;
|
||||
return false;
|
||||
// Abo Option deaktiviert ($this->abo_options && $this->account && $this->account->payment_data) ? true : false;
|
||||
}
|
||||
|
||||
public function isActive(){
|
||||
|
|
@ -470,12 +494,15 @@ class User extends Authenticatable
|
|||
*/
|
||||
public function sendPasswordResetNotification($token)
|
||||
{
|
||||
Mail::to($this->email)->send(new MailResetPassword($token, $this));
|
||||
// $this->notify(new ResetPasswordNotification($token));
|
||||
//$bcc[] = "kevin.adametz@me.com"; //config('app.checkout_mail');
|
||||
//Mail::to($this->email)->bcc($bcc)->locale(\App::getLocale())->send(new MailResetPassword($token, $this));
|
||||
Mail::to($this->email)->locale(\App::getLocale())->send(new MailResetPassword($token, $this));
|
||||
//$this->notify(new ResetPasswordNotification($token));
|
||||
}
|
||||
|
||||
public function getUserSalesVolumeBy($month, $year, $key)
|
||||
{
|
||||
|
||||
//NOTE check ist, cant change month year !
|
||||
if($this->userSalesVolume === false){
|
||||
$this->userSalesVolume = $this->getUserSalesVolume($month, $year, 'first');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue