Fixes
This commit is contained in:
@@ -12,7 +12,7 @@ class VarietiesDataTable extends DataTable
|
||||
|
||||
public function query(Variety $model)
|
||||
{
|
||||
$model = $model::with('specie')->select(['botanic_varieties.*']);
|
||||
$model = $model::with('specie')->select('botanic_varieties.*');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
|
||||
@@ -87,10 +87,7 @@ class ParentDataTable extends DataTable
|
||||
->minifiedAjax()
|
||||
->dom($this->getDom())
|
||||
->orderBy(0,'asc')
|
||||
->buttons(
|
||||
Button::make('export'),
|
||||
Button::make('print')
|
||||
);
|
||||
->buttons($this->getDatatablesButtons());
|
||||
}
|
||||
|
||||
public function getParameters()
|
||||
@@ -98,6 +95,14 @@ class ParentDataTable extends DataTable
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getDatatablesButtons()
|
||||
{
|
||||
$buttons = [];
|
||||
$buttons[] = Button::make('export');
|
||||
$buttons[] = Button::make('print');
|
||||
return $buttons;
|
||||
}
|
||||
|
||||
public function getDom()
|
||||
{
|
||||
$dom = $this->getDatatablesHeaderDefault();
|
||||
|
||||
@@ -12,15 +12,35 @@ class ArticlesDataTable extends DataTable
|
||||
|
||||
public function query(Article $model)
|
||||
{
|
||||
// $model = $model::with('Family')->select('shop_articles.*','family.name as family_name')->join('shop_article_families as family', 'family.id', '=', 'shop_articles.article_family_id')->groupBy('shop_articles.id');
|
||||
$model = $model::with('Family')->select('shop_articles.*');
|
||||
// $model = $model::joinRelations('Family')->select('shop_articles.*','shop_article_families.name as family_name');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
/*
|
||||
$columns = [];
|
||||
$columns[] = [
|
||||
'name' => 'family',
|
||||
'data' => 'family.name',
|
||||
'title' => 'Famille',
|
||||
'orderable' => false
|
||||
];
|
||||
$columns[] = [
|
||||
'name' => 'name',
|
||||
'title' => 'Nom',
|
||||
];
|
||||
$columns[] = self::makeColumnButtons();
|
||||
return $columns;
|
||||
*/
|
||||
return [
|
||||
Column::make('name'),
|
||||
Column::make('family.name')->title('Famille')->orderable(false),
|
||||
Column::make('name')->title('Nom'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ class InvoicesDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'Invoices';
|
||||
|
||||
public function query(Product $model)
|
||||
public function query(Invoice $model)
|
||||
{
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
@@ -7,19 +7,21 @@ use Spatie\MediaLibrary\HasMedia\HasMedia;
|
||||
use Spatie\MediaLibrary\HasMedia\HasMediaTrait;
|
||||
use Rinvex\Categories\Traits\Categorizable;
|
||||
use Rinvex\Tags\Traits\Taggable;
|
||||
use Fico7489\Laravel\EloquentJoin\Traits\EloquentJoin;
|
||||
|
||||
class Article extends Model implements HasMedia
|
||||
{
|
||||
use Categorizable;
|
||||
use Taggable;
|
||||
use HasMediaTrait;
|
||||
use EloquentJoin;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'shop_articles';
|
||||
|
||||
public function Family()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Family');
|
||||
return $this->belongsTo('App\Models\Shop\ArticleFamily','article_family_id');
|
||||
}
|
||||
|
||||
public function Inventories()
|
||||
|
||||
@@ -52,8 +52,11 @@ class ArticleAttributes
|
||||
return ArticleAttribute::create($data);
|
||||
}
|
||||
|
||||
public static function update($data)
|
||||
public static function update($data, $id = false)
|
||||
{
|
||||
dump($data);
|
||||
exit;
|
||||
$id = isset($data['id']) ? $id : $data['id'];
|
||||
return ArticleAttribute::find($id)->update($data);
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ return [
|
||||
'collation' => 'utf8mb4_unicode_ci',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'strict' => true,
|
||||
'strict' => false,
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
$('.select2').select2();
|
||||
$('.select2').select2({ width: '100%' });
|
||||
$('.editor').tinymce({});
|
||||
|
||||
$('.active-checkbox').bootstrapToggle();
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
{{ Form::label('attribute_family_id', 'Attributs') }}<br/>
|
||||
@include('components.select', [
|
||||
'name' => "prices[$key][attributes][attribute_family_id]",
|
||||
'value' => (isset($attribute['value']['attribute_family_id'])) ? $attribute['attribute_family_id'] : null,
|
||||
'value' => (isset($attribute['value']['article_attribute_family_id'])) ? $attribute['value']['article_attribute_family_id'] : null,
|
||||
'list' => $attribute_families_options,
|
||||
'required' => true,
|
||||
'class' => 'select2 form-control form-control-sm attributes-family'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<script>
|
||||
<script>
|
||||
$.extend( true, $.fn.dataTable.defaults, {
|
||||
language: {
|
||||
url: "/assets/vendor/boilerplate/js/datatables/i18n/French.json"
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
<script>
|
||||
function append_image() {
|
||||
$("#uploader-new-images .file").fileinput();
|
||||
$("#uploader-new-images .file").focus();
|
||||
}
|
||||
|
||||
$("#uploader-new-images").appender({
|
||||
|
||||
Reference in New Issue
Block a user