fix articles datatables, enhance statistics
This commit is contained in:
@@ -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']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user