change last_nulls on mysql , is compatible with mariadb ?
This commit is contained in:
@@ -15,7 +15,7 @@ class ArticlesDataTable extends DataTable
|
|||||||
|
|
||||||
public function query(Article $model)
|
public function query(Article $model)
|
||||||
{
|
{
|
||||||
$model = $model::with(['article_nature', 'image'])->withCount(['categories', 'tags', 'offers'])->joinRelationship('article_nature');
|
$model = $model::with(['article_nature', 'image'])->withCount(['categories', 'tags', 'offers']);
|
||||||
$model = self::filterByArticleNature($model);
|
$model = self::filterByArticleNature($model);
|
||||||
return $this->buildQuery($model);
|
return $this->buildQuery($model);
|
||||||
}
|
}
|
||||||
@@ -28,9 +28,13 @@ class ArticlesDataTable extends DataTable
|
|||||||
|
|
||||||
public function modifier($datatables)
|
public function modifier($datatables)
|
||||||
{
|
{
|
||||||
$datatables->editColumn('thumb', function (Article $article) {
|
$datatables
|
||||||
|
->editColumn('thumb', function (Article $article) {
|
||||||
return '<img src="' . Articles::getThumbSrc($article->image) . '">';
|
return '<img src="' . Articles::getThumbSrc($article->image) . '">';
|
||||||
})
|
})
|
||||||
|
->editColumn('article_nature.name', function (Article $article) {
|
||||||
|
return $article->article_nature ? $article->article_nature->name : '';
|
||||||
|
})
|
||||||
->rawColumns(['thumb', 'action']);
|
->rawColumns(['thumb', 'action']);
|
||||||
return parent::modifier($datatables);
|
return parent::modifier($datatables);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ return [
|
|||||||
* Nulls last sql pattern for PostgreSQL & Oracle.
|
* Nulls last sql pattern for PostgreSQL & Oracle.
|
||||||
* For MySQL, use 'CASE WHEN :column IS NULL THEN 1 ELSE 0 END, :column :direction'
|
* For MySQL, use 'CASE WHEN :column IS NULL THEN 1 ELSE 0 END, :column :direction'
|
||||||
*/
|
*/
|
||||||
'nulls_last_sql' => ':column :direction NULLS LAST',
|
'nulls_last_sql' => 'CASE WHEN :column IS NULL THEN 1 ELSE 0 END, :column :direction',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* User friendly message to be displayed on user if error occurs.
|
* User friendly message to be displayed on user if error occurs.
|
||||||
|
|||||||
Reference in New Issue
Block a user