add shipping rules

This commit is contained in:
Ludovic CANDELLIER
2023-07-16 14:45:42 +02:00
parent 72a7b270f9
commit 0879b0abf0
459 changed files with 6219 additions and 5416 deletions

View File

@@ -2,9 +2,9 @@
namespace App\Datatables\Botanic;
use Yajra\DataTables\Html\Column;
use App\Datatables\ParentDataTable as DataTable;
use App\Models\Botanic\Family;
use Yajra\DataTables\Html\Column;
class FamiliesDataTable extends DataTable
{
@@ -12,7 +12,8 @@ class FamiliesDataTable extends DataTable
public function query(Family $model)
{
$model = $model::withCount(['genres','species','varieties']);
$model = $model::withCount(['genres', 'species', 'varieties']);
return $this->buildQuery($model);
}

View File

@@ -2,9 +2,9 @@
namespace App\Datatables\Botanic;
use Yajra\DataTables\Html\Column;
use App\Datatables\ParentDataTable as DataTable;
use App\Models\Botanic\Genre;
use Yajra\DataTables\Html\Column;
class GenresDataTable extends DataTable
{
@@ -13,6 +13,7 @@ class GenresDataTable extends DataTable
public function query(Genre $model)
{
$model = $model::with('family')->withCount('species')->withCount('varieties');
return $this->buildQuery($model);
}
@@ -23,6 +24,7 @@ class GenresDataTable extends DataTable
return $genre->family ? $genre->family->name : '';
})
->rawColumns(['genre_name', 'action']);
return parent::modifier($datatables);
}

View File

@@ -2,11 +2,11 @@
namespace App\Datatables\Botanic;
use App\Repositories\Shop\Tags;
use Yajra\DataTables\Html\Column;
use App\Datatables\ParentDataTable as DataTable;
use App\Models\Botanic\Specie;
use App\Repositories\Botanic\Species;
use App\Repositories\Shop\Tags;
use Yajra\DataTables\Html\Column;
class SpeciesDataTable extends DataTable
{
@@ -15,6 +15,7 @@ class SpeciesDataTable extends DataTable
public function query(Specie $model)
{
$model = $model::withCount(['images', 'varieties', 'tags'])->with(['genre', 'image', 'tags']);
return $this->buildQuery($model);
}
@@ -32,9 +33,11 @@ class SpeciesDataTable extends DataTable
foreach ($specie->tags as $tag) {
$html .= Tags::getTagHtml($tag);
}
return $html;
})
->rawColumns(['thumb', 'tags2', 'genre_name', 'action']);
return parent::modifier($datatables);
}

View File

@@ -2,11 +2,11 @@
namespace App\Datatables\Botanic;
use Yajra\DataTables\Html\Column;
use App\Datatables\ParentDataTable as DataTable;
use App\Models\Botanic\Variety;
use App\Repositories\Botanic\Varieties;
use App\Repositories\Shop\Tags;
use Yajra\DataTables\Html\Column;
class VarietiesDataTable extends DataTable
{
@@ -15,6 +15,7 @@ class VarietiesDataTable extends DataTable
public function query(Variety $model)
{
$model = $model::joinRelationship('Specie')->select('botanic_varieties.*', 'botanic_species.name as specie_name')->with(['image', 'Specie', 'tags'])->withCount(['Articles', 'tags', 'images']);
return $this->buildQuery($model);
}
@@ -29,13 +30,14 @@ class VarietiesDataTable extends DataTable
foreach ($variety->tags as $tag) {
$html .= Tags::getTagHtml($tag);
}
return $html;
})
->rawColumns(['thumb', 'tags2', 'action']);
return parent::modifier($datatables);
}
protected function getColumns()
{
return [