mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#2480 Sales Reports
This commit is contained in:
parent
e239937e5c
commit
67d39e625a
@ -56,4 +56,20 @@ $(document).ready( function () {
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
$('#metaPageReport').DataTable({
|
||||
ajax: '/admin/api/classified/report/page',
|
||||
columns: [
|
||||
{
|
||||
data: 'name',
|
||||
render: function ( data, type, row, meta ) {
|
||||
return `
|
||||
<a href="/admin/pages/edit/${row.id}" class="text-info">
|
||||
${data ?? productsReportTrans.undefined_page}
|
||||
</a>
|
||||
`;
|
||||
}
|
||||
},
|
||||
],
|
||||
});
|
||||
} );
|
||||
|
||||
@ -392,4 +392,7 @@ return [
|
||||
'product' => 'Product',
|
||||
'count' => 'Count',
|
||||
'undefined_product' => 'Undefined Product',
|
||||
'pages_without_meta_information_report' => 'Pages Without Meta Information Report',
|
||||
'page' => 'Page',
|
||||
'undefined_page' => 'Undefined Page',
|
||||
];
|
||||
|
||||
@ -254,6 +254,7 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
|
||||
'admin/api/classified/report/status' => 'Visiosoft\AdvsModule\Http\Controller\Admin\ReportController@status',
|
||||
'admin/api/classified/report/unexplained' => 'Visiosoft\AdvsModule\Http\Controller\Admin\ReportController@unexplained',
|
||||
'admin/api/classified/report/no-image' => 'Visiosoft\AdvsModule\Http\Controller\Admin\ReportController@noImage',
|
||||
'admin/api/classified/report/page' => 'Visiosoft\AdvsModule\Http\Controller\Admin\ReportController@page',
|
||||
];
|
||||
|
||||
protected $middleware = [
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php namespace Visiosoft\AdvsModule\Http\Controller\Admin;
|
||||
|
||||
use Anomaly\PagesModule\Page\Contract\PageRepositoryInterface;
|
||||
use Anomaly\Streams\Platform\Http\Controller\AdminController;
|
||||
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
|
||||
|
||||
@ -52,4 +53,23 @@ class ReportController extends AdminController
|
||||
'data' => $this->advRepository->getNoImageClassifiedsReport()
|
||||
];
|
||||
}
|
||||
|
||||
public function page(PageRepositoryInterface $pageRepository)
|
||||
{
|
||||
$pages = $pageRepository->newQuery()
|
||||
->select('title as name', 'pages_pages.id')
|
||||
->where(function ($q) {
|
||||
$q->whereNull('meta_title')
|
||||
->orWhereNull('meta_description');
|
||||
})
|
||||
->leftJoin('pages_pages_translations as pages_trans', function ($join) {
|
||||
$join->on('pages_pages.id', '=', 'pages_trans.entry_id');
|
||||
$join->whereIn('locale', [config('app.locale'), setting_value('streams::default_locale'), 'en']);
|
||||
})
|
||||
->get();
|
||||
|
||||
return [
|
||||
'data' => $pages
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user