mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Add finer grained resolution to created_at query
This commit is contained in:
parent
cfe2d397da
commit
d0f18647ed
@ -174,25 +174,22 @@ abstract class QueryFilters
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function created_at($value = '')
|
public function created_at($value)
|
||||||
{
|
{
|
||||||
|
$created_at = $value ? (int) $value : 0;
|
||||||
if($value == '')
|
|
||||||
return $this->builder;
|
|
||||||
|
|
||||||
try{
|
$created_at = date('Y-m-d H:i:s', $value);
|
||||||
|
|
||||||
$created_at = Carbon::parse($value)->timestamp;
|
if(is_string($created_at)){
|
||||||
|
|
||||||
return $this->builder->where('created_at', '>=', $created_at);
|
$created_at = strtotime(str_replace("/","-",$created_at));
|
||||||
|
|
||||||
|
if(!$created_at)
|
||||||
|
return $this->builder;
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(\Exception $e) {
|
|
||||||
|
|
||||||
return $this->builder;
|
return $this->builder->where('created_at', '>=', $created_at);
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function is_deleted($value)
|
public function is_deleted($value)
|
||||||
|
Loading…
Reference in New Issue
Block a user