fix articles datatables, enhance statistics

This commit is contained in:
ludo
2024-01-28 19:56:13 +01:00
parent c5f06a608c
commit 36459de793
7 changed files with 81 additions and 21 deletions

View File

@@ -5,6 +5,7 @@ namespace App\Datatables\Admin\Shop;
use App\Datatables\ParentDataTable as DataTable;
use App\Models\Shop\Article;
use App\Repositories\Shop\Articles;
use App\Repositories\Shop\ArticleImages;
use App\Repositories\Shop\Tags;
use Yajra\DataTables\Html\Column;
@@ -71,7 +72,7 @@ class ArticlesDataTable extends DataTable
]);
})
->editColumn('thumb', function (Article $article) {
$image = Articles::getFullImageByArticle($article);
$image = ArticleImages::getFullImageByArticle($article);
return Articles::getThumb($image, false);
})
@@ -87,7 +88,7 @@ class ArticlesDataTable extends DataTable
return $html;
})
->editColumn('images_count2', function (Article $article) {
return Articles::countFullImagesByArticle($article);
return ArticleImages::countFullImagesByArticle($article);
})
->rawColumns(['tags2', 'thumb', 'action']);