Fix for product import
This commit is contained in:
parent
5ceb2d9ab6
commit
bb38aaccb5
1 changed files with 5 additions and 0 deletions
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Ninja\Repositories;
|
||||
|
||||
use App\Models\Product;
|
||||
use Utils;
|
||||
use DB;
|
||||
|
||||
class ProductRepository extends BaseRepository
|
||||
|
|
@ -64,6 +65,10 @@ class ProductRepository extends BaseRepository
|
|||
}
|
||||
|
||||
$product->fill($data);
|
||||
$product->product_key = isset($data['product_key']) ? trim($data['product_key']) : '';
|
||||
$product->notes = isset($data['notes']) ? trim($data['notes']) : '';
|
||||
$product->cost = isset($data['cost']) ? Utils::parseFloat($data['cost']) : 0;
|
||||
$product->qty = isset($data['qty']) ? Utils::parseFloat($data['qty']) : 1;
|
||||
$product->save();
|
||||
|
||||
return $product;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue