Merge pull request #2981 from CihanSenturk/fix-import-issues

Import issues fixed
This commit is contained in:
Cüneyt Şentürk 2023-06-05 08:55:11 +03:00 committed by GitHub
commit ee81c4d184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -107,7 +107,7 @@ class Item extends Model
return $query;
}
return $query->whereIn($this->qualifyColumn('type'), $type);
return $query->where($this->qualifyColumn('type'), $type);
}
/**

View File

@ -323,8 +323,10 @@ trait Import
return $contact->id;
}
public function getItemIdFromName($row, $type = 'product')
public function getItemIdFromName($row, $type = null)
{
$type = !empty($type) ? $type : (!empty($row['item_type']) ? $row['item_type'] : 'product');
$item_id = Item::type($type)->where('name', $row['item_name'])->pluck('id')->first();
if (!empty($item_id)) {