1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace App\Imports\Lab;
- use App\Repositories\Enums\ModelStatusEnum;
- use App\Repositories\Models\TCM\Drug;
- use App\Repositories\Models\TCM\Prescription;
- use Maatwebsite\Excel\Concerns\OnEachRow;
- use Maatwebsite\Excel\Row;
- use Overtrue\LaravelPinyin\Facades\Pinyin;
- class ImportLessonSchedules implements OnEachRow
- {
- public function onRow(Row $row)
- {
- // if ($row->getIndex() <= 2) return false;
- // if (empty($row[1])) return false;
- //
- // $type = Prescription::DRUG_TYPE_YP;
- //
- // switch ($row[2]) {
- // case '颗粒':
- // $type = Prescription::DRUG_TYPE_KL;
- // break;
- // }
- //
- // $letter = Pinyin::abbr($row[1]);
- // $initial = substr($letter, 1);
- //
- // $data = [
- // 'name' => $row[1],
- // 'type' => $type,
- // 'area' => $row[3],
- // 'unit' => $row[4],
- // 'letter' => $letter,
- // 'initial' => $initial,
- // 'admin_id' => login_admin_id(),
- // 'status' => ModelStatusEnum::OK,
- // ];
- // if (Drug::query()->where('name', $row[1])->exists()) return false;
- // Drug::create($data);
- dd($row->toArray());
- // return true;
- }
- }
|