Replies: 1 comment
-
Please check this documentation https://docs.laravel-excel.com/3.1/architecture/objects.html#constructor |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I installed this extension as suggested and setup almost everything, In import model, I need to pass some custom data, Can you please suggest How I can pass that?
I want to pass custom attributes Like below
[$merchantId,$reportType,$marketplace]
namespace Modules\Marketplaces\Console;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Modules\Amazon\Http\Traits\AmazonapiTrait;
use Modules\Amazon\Http\Traits\Import;
use Modules\AmazonRepricer\Entities\AmazonInventoryMonthlyData;
use App\Imports\AmazonInventoryMonthlyDataImport;
use Maatwebsite\Excel\Facades\Excel;
class ImportInventory extends Command
{
// Use Traits setup in Modules\Amazon\Http\Traits\AmazonapiTrait;
}
Import Model Code as Below
and want to get custom parameters passed to import function as Params
$params
"; print_r($row); die(); $currentRowNumber = $this->getRowNumber(); $idIndex = 9; $last_updated_time = date("Y-m-d H:i:s"); $fnskuIndex = 1; $skuIndex = 2; $date_index = 0; $product_index = 3; $importModel = new AmazonInventoryMonthlyData(); $snapshot_date = $row[$date_index]; $merchantId = !empty($options['merchantId']) ? $options['merchantId'] : Configure::read('Amazon.merchant'); $id = $importModel->generateId($row[$skuIndex], $merchantId, $snapshot_date); return new AmazonInventoryMonthlyData([ 'inventory_month' => $row[0], 'fnsku' => $row[1], 'sku' => $row[2], 'product_name' => $row[3], 'average_quantity' => $row[4], 'end_quantity' => $row[5], 'fulfillment_center_id' => $row[6], 'detailed_disposition' => $row[7], 'country' => $row[8], 'id' => $row[9], 'merchant_id' => $row[10], 'marketplace' => $row[11], 'update_date', 'inventory_month_date' ]); } public function uniqueBy() { return 'id'; } public function batchSize(): int { return 1000; } public function chunkSize(): int { return 1000; } }
Please suggest solution how to pass parameters there.Beta Was this translation helpful? Give feedback.
All reactions