Promotion Backend v1

This commit is contained in:
Kevin Adametz 2021-10-15 16:35:47 +02:00
parent 0ed47d3553
commit f0da981737
43 changed files with 2765 additions and 45 deletions

View file

@ -117,6 +117,13 @@ use Illuminate\Database\Eloquent\SoftDeletes;
* @method static \Illuminate\Database\Eloquent\Builder|Product wherePartnerCommission($value)
* @method static \Illuminate\Database\Eloquent\Builder|Product whereSingleCommission($value)
* @method static \Illuminate\Database\Eloquent\Builder|Product whereValueCommission($value)
* @property bool|null $shipping_addon
* @property bool|null $max_buy
* @property int|null $max_buy_num
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ProductBuy[] $product_buys
* @property-read int|null $product_buys_count
* @method static \Illuminate\Database\Eloquent\Builder|Product whereMaxBuy($value)
* @method static \Illuminate\Database\Eloquent\Builder|Product whereMaxBuyNum($value)
*/
class Product extends Model
{
@ -340,10 +347,13 @@ class Product extends Model
/*price by user Factor*/
private function calcPriceUserFactor($price){
/*
Nicht in benutzung, die margin errechnet sich im Warenkorb, wegen der Staffelprovision
if(\Auth::user() && \Auth::user()->user_level){
$margin = ((\Auth::user()->user_level->margin -100)*-1) / 100;
$price = $price * $margin;
}
*/
return $price;
}
/*price net*/