23-01-2026
This commit is contained in:
parent
a939cd51ef
commit
a8b395e20d
248 changed files with 29342 additions and 4805 deletions
|
|
@ -137,25 +137,29 @@ class UserBusiness extends Model
|
|||
'm_level_id' => 'int',
|
||||
'active_account' => 'bool',
|
||||
'm_account' => 'int',
|
||||
'sales_volume_KP_points' => 'int',
|
||||
'sales_volume_TP_points' => 'int',
|
||||
'sales_volume_points_shop' => 'int',
|
||||
'sales_volume_points_KP_sum' => 'int',
|
||||
'sales_volume_points_TP_sum' => 'int',
|
||||
'sales_volume_KP_points' => 'float',
|
||||
'sales_volume_TP_points' => 'float',
|
||||
'sales_volume_points_shop' => 'float',
|
||||
'sales_volume_points_KP_sum' => 'float',
|
||||
'sales_volume_points_TP_sum' => 'float',
|
||||
'sales_volume_total' => 'float',
|
||||
'sales_volume_total_shop' => 'float',
|
||||
'sales_volume_total_sum' => 'float',
|
||||
'payline_points' => 'int',
|
||||
'payline_points_qual_kp' => 'int',
|
||||
'active_growth_bonus' => 'float',
|
||||
'payline_points' => 'float',
|
||||
'payline_points_qual_kp' => 'float',
|
||||
'margin' => 'float',
|
||||
'margin_shop' => 'float',
|
||||
'qual_kp' => 'int',
|
||||
'qual_pp' => 'int',
|
||||
'calc_qual_kp' => 'int',
|
||||
'total_pp' => 'int',
|
||||
'total_qual_pp' => 'int',
|
||||
'commission_pp_total' => 'float',
|
||||
'commission_growth_total' => 'float',
|
||||
'growth_bonus_details' => 'array',
|
||||
'commission_shop_sales' => 'float',
|
||||
'active_growth_bonus' => 'float',
|
||||
'qual_user_level' => 'array',
|
||||
'qual_user_level_next' => 'array',
|
||||
'next_qual_user_level' => 'array',
|
||||
|
|
@ -202,15 +206,18 @@ class UserBusiness extends Model
|
|||
'margin_shop',
|
||||
'qual_kp',
|
||||
'qual_pp',
|
||||
'calc_qual_kp',
|
||||
'qual_user_level',
|
||||
'qual_user_level_next',
|
||||
'next_qual_user_level',
|
||||
'next_can_user_level',
|
||||
'total_pp',
|
||||
'total_qual_pp',
|
||||
'active_growth_bonus',
|
||||
'commission_shop_sales',
|
||||
'commission_pp_total',
|
||||
'commission_growth_total',
|
||||
'growth_bonus_details',
|
||||
'business_lines',
|
||||
'user_items',
|
||||
'version',
|
||||
|
|
@ -220,29 +227,66 @@ class UserBusiness extends Model
|
|||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
|
||||
public function user_business_structure()
|
||||
{
|
||||
return $this->belongsTo(UserBusinessStructure::class, 'b_structure_id');
|
||||
}
|
||||
|
||||
public function isSave(){
|
||||
public function isSave()
|
||||
{
|
||||
return $this->id !== null ? true : false;
|
||||
}
|
||||
|
||||
public function setPaymentAccountDateAttribute( $value ) {
|
||||
$this->attributes['payment_account_date'] = isset($value) ? (new Carbon($value))->format('Y-m-d') : NULL;
|
||||
}
|
||||
|
||||
public function setPaymentAccountDateAttribute($value)
|
||||
{
|
||||
$this->attributes['payment_account_date'] = isset($value) ? (new Carbon($value))->format('Y-m-d') : NULL;
|
||||
}
|
||||
|
||||
|
||||
public function setActiveDateAttribute( $value ) {
|
||||
$this->attributes['active_date'] = isset($value) ? (new Carbon($value))->format('Y-m-d') : NULL;
|
||||
}
|
||||
public function setActiveDateAttribute($value)
|
||||
{
|
||||
$this->attributes['active_date'] = isset($value) ? (new Carbon($value))->format('Y-m-d') : NULL;
|
||||
}
|
||||
|
||||
public function getSalesVolumeTotalMargin(){
|
||||
public function getSalesVolumeTotalMargin()
|
||||
{
|
||||
return $this->sales_volume_total / 100 * $this->margin;
|
||||
}
|
||||
|
||||
|
||||
// Formatted Points Getter
|
||||
public function getFormattedSalesVolumeKPPoints()
|
||||
{
|
||||
return isset($this->attributes['sales_volume_KP_points']) ? formatNumber($this->attributes['sales_volume_KP_points']) : "";
|
||||
}
|
||||
|
||||
public function getFormattedSalesVolumeTPPoints()
|
||||
{
|
||||
return isset($this->attributes['sales_volume_TP_points']) ? formatNumber($this->attributes['sales_volume_TP_points']) : "";
|
||||
}
|
||||
|
||||
public function getFormattedSalesVolumePointsShop()
|
||||
{
|
||||
return isset($this->attributes['sales_volume_points_shop']) ? formatNumber($this->attributes['sales_volume_points_shop']) : "";
|
||||
}
|
||||
|
||||
public function getFormattedSalesVolumePointsKPSum()
|
||||
{
|
||||
return isset($this->attributes['sales_volume_points_KP_sum']) ? formatNumber($this->attributes['sales_volume_points_KP_sum']) : "";
|
||||
}
|
||||
|
||||
public function getFormattedSalesVolumePointsTPSum()
|
||||
{
|
||||
return isset($this->attributes['sales_volume_points_TP_sum']) ? formatNumber($this->attributes['sales_volume_points_TP_sum']) : "";
|
||||
}
|
||||
|
||||
public function getFormattedPaylinePoints()
|
||||
{
|
||||
return isset($this->attributes['payline_points']) ? formatNumber($this->attributes['payline_points']) : "";
|
||||
}
|
||||
|
||||
public function getFormattedPaylinePointsQualKp()
|
||||
{
|
||||
return isset($this->attributes['payline_points_qual_kp']) ? formatNumber($this->attributes['payline_points_qual_kp']) : "";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue