API aktiviert / Anpassungen + User Übersicht Gutschriften Umsätze
This commit is contained in:
parent
c02fffd883
commit
a4c76d06fa
27 changed files with 500 additions and 110 deletions
|
|
@ -22,7 +22,7 @@ class CustomerPriority
|
|||
//only extern no members with no numbers
|
||||
$shopping_users = ShoppingUser::where('auth_user_id', '=', NULL)->where('number', '=', NULL)->orderBy('created_at', 'ASC')->get();
|
||||
foreach ($shopping_users as $shopping_user){
|
||||
if($shopping_user->shopping_order && $shopping_user->shopping_order->user_shop){
|
||||
if($shopping_user->shopping_order){
|
||||
self::checkOne($shopping_user);
|
||||
}
|
||||
}
|
||||
|
|
@ -217,8 +217,8 @@ class CustomerPriority
|
|||
}
|
||||
|
||||
private static function newCustomer($shopping_user){
|
||||
if($shopping_user->shopping_order && $shopping_user->shopping_order->user_shop) {
|
||||
$member_id = $shopping_user->shopping_order->user_shop->user_id;
|
||||
if($shopping_user->shopping_order && $shopping_user->shopping_order->member_id) {
|
||||
$member_id = $shopping_user->shopping_order->member_id;
|
||||
$shopping_user->member_id = $member_id;
|
||||
$shopping_user->number = self::nextNumber();
|
||||
$shopping_user->save();
|
||||
|
|
|
|||
|
|
@ -86,11 +86,16 @@ class UserMarign
|
|||
|
||||
public static function getMontlyPartnerCommissionOpen(User $user, $date = null, $format = false){
|
||||
|
||||
//$now = $date ? Carbon::parse($date) : Carbon::now();
|
||||
$start = Carbon::parse('01.01.2021');
|
||||
$end = Carbon::now();
|
||||
$startDay = $start->startOfMonth()->toDateString();
|
||||
$endDay = $end->endOfMonth()->toDateString();
|
||||
if(!$date){
|
||||
$start = Carbon::parse('01.01.2021');
|
||||
$end = Carbon::now();
|
||||
$startDay = $start->startOfMonth()->toDateString();
|
||||
$endDay = $end->endOfMonth()->toDateString();
|
||||
}else{
|
||||
$now = $date ? Carbon::parse($date) : Carbon::now();
|
||||
$startDay = $now->startOfMonth()->toDateString();
|
||||
$endDay = $now->endOfMonth()->toDateString();
|
||||
}
|
||||
|
||||
$sum_net_amount = ShoppingOrderMargin::whereMSponsorId($user->id)
|
||||
->whereBetween('from', [$startDay, $endDay])
|
||||
|
|
@ -129,12 +134,17 @@ class UserMarign
|
|||
|
||||
public static function getMontlyPartnerCommissionPending(User $user, $date = null, $format = false){
|
||||
|
||||
//$now = $date ? Carbon::parse($date) : Carbon::now();
|
||||
$start = Carbon::parse('01.01.2021');
|
||||
$end = Carbon::now();
|
||||
$startDay = $start->startOfMonth()->toDateString();
|
||||
$endDay = $end->endOfMonth()->toDateString();
|
||||
|
||||
if(!$date){
|
||||
$start = Carbon::parse('01.01.2021');
|
||||
$end = Carbon::now();
|
||||
$startDay = $start->startOfMonth()->toDateString();
|
||||
$endDay = $end->endOfMonth()->toDateString();
|
||||
}else{
|
||||
$now = $date ? Carbon::parse($date) : Carbon::now();
|
||||
$startDay = $now->startOfMonth()->toDateString();
|
||||
$endDay = $now->endOfMonth()->toDateString();
|
||||
}
|
||||
|
||||
$sum_net_amount = ShoppingOrderMargin::whereMSponsorId($user->id)
|
||||
->whereBetween('from', [$startDay, $endDay])
|
||||
->wherePaid(true)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue