fix: mr review
This commit is contained in:
parent
7456b31bf3
commit
bd85c81259
5 changed files with 122 additions and 14 deletions
|
|
@ -62,6 +62,7 @@ class ReindexElasticMedia extends Command
|
|||
/** @var \App\Models\Media $media */
|
||||
foreach ($mediaCollection->getCollection() as $media) {
|
||||
/** @throws \RuntimeException */
|
||||
$media->marque_ids = $media->marques()->pluck('codMarq')->toArray();
|
||||
$media->addToElasticSearch();
|
||||
$bar->advance();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -891,7 +891,10 @@ class MediaController extends Controller
|
|||
// * OR
|
||||
$esShould = array_merge($esShould, [
|
||||
\array_undot(['match.statut' => MediaStatut::public_etendu]),
|
||||
\array_undot(['match.statut' => MediaStatut::public])
|
||||
\array_undot(['match.statut' => MediaStatut::public]),
|
||||
\array_undot([
|
||||
'terms.marque_ids' => $user->marques->pluck('codMarq')->all()
|
||||
])
|
||||
]);
|
||||
return;
|
||||
} //end if
|
||||
|
|
|
|||
|
|
@ -91,7 +91,15 @@ class Dossier extends Model
|
|||
|
||||
// * Tous les non brouillons ou liés à une marque du user.
|
||||
return $this->mediaList()
|
||||
->where(fn (Builder $q) => $q->where('statut', '!=', MediaStatut::brouillon))
|
||||
->where(
|
||||
fn (Builder $q) => $q->where('statut', '!=', MediaStatut::brouillon)
|
||||
->orWhere(fn (Builder $query) => $query
|
||||
->whereHas('marques', fn ($pivotQuery) => $pivotQuery->whereIn(
|
||||
'marque_id',
|
||||
$user->marques->pluck('id')->toArray()
|
||||
))
|
||||
)
|
||||
)
|
||||
->count();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -205,7 +205,8 @@ class Media extends Model
|
|||
]
|
||||
],
|
||||
'fielddata' => true
|
||||
]
|
||||
],
|
||||
'marque_ids' => ['type' => 'keyword'],
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
@ -224,6 +225,7 @@ class Media extends Model
|
|||
MediaCreated::dispatch($user, $model);
|
||||
|
||||
if (empty($model->isDuplicate)) {
|
||||
$model->marque_ids = $model->marques()->pluck('codMarq')->toArray();
|
||||
/** @throws \RuntimeException */
|
||||
$model->addToElasticSearch();
|
||||
}
|
||||
|
|
@ -255,6 +257,7 @@ class Media extends Model
|
|||
MediaChangedLabel::dispatch($user, $model, $oldLabel, $newLabel);
|
||||
}
|
||||
|
||||
$model->marque_ids = $model->marques()->pluck('codMarq')->toArray();
|
||||
/** @throws \RuntimeException */
|
||||
$model->addToElasticSearch();
|
||||
});
|
||||
|
|
@ -451,17 +454,6 @@ class Media extends Model
|
|||
return $this->belongsToMany(Marque::class, 'media_marque', 'media_id', 'marque_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* BelongsTo user relation
|
||||
* Get the user that owns the media.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function owner()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
|
||||
/**
|
||||
* BelongsTo ArcadiaTypeContenu relation
|
||||
* Get the ArcadiaTypeContenu that belongs to the media.
|
||||
|
|
|
|||
104
edl.md
Normal file
104
edl.md
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
# DAM
|
||||
|
||||
## Type vues
|
||||
|
||||
| Clé DAM | Valeur | Clé Arcadia |
|
||||
| --- | ------ | ----------- |
|
||||
| 1 | Facing | 1 |
|
||||
| 2 | Côté gauche | 2 |
|
||||
| 3 | Dessus | 3 |
|
||||
| 4 | Ambiance | xxx |
|
||||
| 5 | 3D | xxx |
|
||||
| 6 | Produit nu | xxx |
|
||||
| 7 | Dos | 7 |
|
||||
| 8 | Côté droit | 8 |
|
||||
| 9 | Dessous | 9 |
|
||||
| 10 | Standard | 10 |
|
||||
| 11 | Logo société | 11 |
|
||||
| 12 | Logo activité | 12 |
|
||||
| 13 | Logo | 13 |
|
||||
| 14 | Logo organisme certificateur | 14 |
|
||||
| 15 | Logos signe de qualité | 15 |
|
||||
| 16 | Logo standard | 16 |
|
||||
| 17 | Etiquette Colis | 17 |
|
||||
| 18 | CB Colis | 18 |
|
||||
| 19 | BAT | xxx |
|
||||
| 20 | Non applicable (vue interne / zoom / vue en coupe) | 0 |
|
||||
| 21 | Charte Graphique | 21 |
|
||||
| 22 | Portrait | 22 |
|
||||
| 23 | Paysage | 23 |
|
||||
| 24 | Panoramique | 24 |
|
||||
| xx | En-tête | 25 |
|
||||
| xx | Pied-de-page | 26 |
|
||||
| 27 | En-tête | 27 |
|
||||
| 28 | Pied-de-page | 28 |
|
||||
|
||||
## Type Media
|
||||
|
||||
| Clé DAM | Valeur | Clé Arcadia |
|
||||
| --- | ------ | ----------- |
|
||||
| 1 | Photo | 1 |
|
||||
| 2 | Illustration/Vectorielle | 2 |
|
||||
| 3 | Vidéo | 3 |
|
||||
| 4 | Audio | 4 |
|
||||
| 5 | jpeg | 5 |
|
||||
| 6 | BAT | 6 |
|
||||
|
||||
## Variantes
|
||||
|
||||
| Clé DAM | Valeur | Clé Arcadia |
|
||||
| --- | ------ | ----------- |
|
||||
| 1 | Permanent | 1 |
|
||||
| 2 | Eté | 2 |
|
||||
| 3 | Noël | 3 |
|
||||
| 4 | Saveurs de l'année | 4 |
|
||||
| 5 | Promo | 5 |
|
||||
| 6 | Carrefour | 6 |
|
||||
| 7 | Permanent ambiance | 7 |
|
||||
| 8 | permanent 3D | 8 |
|
||||
| 9 | SDA 2018 | 9 |
|
||||
| 10 | Permanent dos | 10 |
|
||||
| 11 | Standard document | 11 |
|
||||
| 12 | Std document | 12 |
|
||||
| 13 | std | 13 |
|
||||
| 14 | été ambiance | 14 |
|
||||
| 15 | PERMANENT | 15 |
|
||||
| 16 | HIVER | 16 |
|
||||
| 17 | Standard | 17 |
|
||||
| 18 | BAT | 18 |
|
||||
| 19 | Signe de qualité | 19 |
|
||||
| 20 | Standard Panoramique | 20 |
|
||||
|
||||
## Sujet
|
||||
|
||||
| Clé DAM | Valeur | Clé Arcadia |
|
||||
| --- | ------ | ----------- |
|
||||
| 1 | Visuel Article | 1 |
|
||||
| 2 | Marque | 2 |
|
||||
| 3 | Pièces Anatomiques - Sous familles de ventes | 3 |
|
||||
| 4 | Sociétés | 4 |
|
||||
| 5 | Logos signe de qualité | 5 |
|
||||
| 6 | Organisme Certificateur | 6 |
|
||||
| 7 | Groupement Qualité | 7 |
|
||||
| 8 | Logo Allégation Marketing | 8 |
|
||||
| 9 | CB Colis | 9 |
|
||||
| 10 | Etiquette Colis | 10 |
|
||||
| 11 | Groupe | 11 |
|
||||
| xx | Etiquette Piece | 12 |
|
||||
| xx | Rouleau | 13 |
|
||||
|
||||
|
||||
## Langues
|
||||
|
||||
| Clé DAM | Valeur | Clé Arcadia |
|
||||
| --- | ------ | ----------- |
|
||||
| 1 | Francais | 1 |
|
||||
| 2 | English | 2 |
|
||||
| 3 | Español | 3 |
|
||||
| 4 | Polonais | 4 |
|
||||
| 5 | Allemand | 5 |
|
||||
| 6 | Italien | 6 |
|
||||
| xx | Hongrois | 7 |
|
||||
| 11 | Danois | 11 |
|
||||
| 13 | Neerlandais | 13 |
|
||||
|
||||
Loading…
Add table
Reference in a new issue