23-01-2026

This commit is contained in:
Kevin Adametz 2026-01-23 17:35:23 +01:00
parent a939cd51ef
commit a8b395e20d
248 changed files with 29342 additions and 4805 deletions

View file

@ -605,9 +605,11 @@ class User extends Authenticatable
return 0;
}
public function getUserSalesVolume($month, $year, $record = 'get')
//with = ['shopping_order.shopping_user'] <- optional wenn es noch weitere relations gibt
public function getUserSalesVolume($month, $year, $record = 'get', $with = [])
{
$query = UserSalesVolume::where('user_id', $this->id)->where('month', $month)->where('year', $year)->orderBy('id', 'DESC');
$relations = array_merge(['shopping_order'], $with);
$query = UserSalesVolume::with($relations)->where('user_id', $this->id)->where('month', $month)->where('year', $year)->orderBy('id', 'DESC');
switch ($record) {
case 'get':
return $query->get();