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