ozzzi / excel_import_worker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example import worker from excel

Producer

use App\Service\ExcelParser;

$file = 'price.xlsx';

$setting = [
    'category' => 'B',
    'name' => 'C',
    'model' => 'D',
    'price' => 'G',
    'quantity' => 'H',
    'manufacturer' => 'F',
    'description' => 'M',
];

$this->load->library('queue');

$excelService = new ExcelParser($setting, $file);

foreach ($excelService->parse() as $product) {
    $this->queue->addTask('import', ['product' => $product]);
}

About


Languages

Language:PHP 100.0%