- bug: error if dataset table is empty
This commit is contained in:
parent
c0022e3c1c
commit
0fd0f02537
2 changed files with 4 additions and 3 deletions
|
@ -258,17 +258,18 @@ class Dataset extends Model
|
|||
*
|
||||
* @return \Carbon\Carbon\Date
|
||||
*/
|
||||
public function scopeEarliestPublicationDate($query, string $column = null)
|
||||
public static function earliestPublicationDate(string $column = null)
|
||||
{
|
||||
if (!$column) {
|
||||
$column = self::PUBLISHED_AT;
|
||||
}
|
||||
return $query->select('server_date_published')
|
||||
$result = Dataset::select('server_date_published')
|
||||
->where('server_date_published', '<>', null)
|
||||
->where('server_state', 'published')
|
||||
->orderBy('server_date_published', 'asc')
|
||||
->first();
|
||||
//->server_date_published;
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function setServerState($targetType)
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue