Fixes for date ranges
This commit is contained in:
parent
557700307c
commit
318e301308
|
|
@ -1291,10 +1291,12 @@ $products = str_getcsv($this->input['product_key'], ',', "'");
|
||||||
$this->end_date = 'All available data';
|
$this->end_date = 'All available data';
|
||||||
return $query;
|
return $query;
|
||||||
case 'last7':
|
case 'last7':
|
||||||
|
case 'last_7_days':
|
||||||
$this->start_date = now()->subDays(7)->format('Y-m-d');
|
$this->start_date = now()->subDays(7)->format('Y-m-d');
|
||||||
$this->end_date = now()->format('Y-m-d');
|
$this->end_date = now()->format('Y-m-d');
|
||||||
return $query->whereBetween($this->date_key, [now()->subDays(7), now()])->orderBy($this->date_key, 'ASC');
|
return $query->whereBetween($this->date_key, [now()->subDays(7), now()])->orderBy($this->date_key, 'ASC');
|
||||||
case 'last30':
|
case 'last30':
|
||||||
|
case 'last_30_days':
|
||||||
$this->start_date = now()->subDays(30)->format('Y-m-d');
|
$this->start_date = now()->subDays(30)->format('Y-m-d');
|
||||||
$this->end_date = now()->format('Y-m-d');
|
$this->end_date = now()->format('Y-m-d');
|
||||||
return $query->whereBetween($this->date_key, [now()->subDays(30), now()])->orderBy($this->date_key, 'ASC');
|
return $query->whereBetween($this->date_key, [now()->subDays(30), now()])->orderBy($this->date_key, 'ASC');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue