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
|
|
@ -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