23-01-2026
This commit is contained in:
parent
a939cd51ef
commit
a8b395e20d
248 changed files with 29342 additions and 4805 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue