Minor fixes

This commit is contained in:
Deon George
2019-12-27 13:32:42 +11:00
parent 8c453d7b0e
commit fe155525a3
6 changed files with 23 additions and 10 deletions

View File

@@ -143,13 +143,16 @@ class Video extends Abstracted\Catalog
public function setMakeModel()
{
$ma = Make::firstOrCreate([
'name'=>$this->property('make') ?: NULL,
]);
$ma = NULL;
if ($this->property('make'))
$ma = Make::firstOrCreate([
'name'=>$this->property('make'),
]);
$mo = Model::firstOrCreate([
'name'=>$this->property('model') ?: NULL,
'make_id'=>$ma->id,
'make_id'=>$ma ? $ma->id : NULL,
]);
$so = Software::firstOrCreate([