groupId = $groupId; $this->sysUserId = $sysUserId; } /** * @param array $row * * @return \Illuminate\Database\Eloquent\Model|null */ public function model(array $row) { ++$this->rows; return new SysStarInstitution([ 'group_id' => $this->groupId, 'sys_user_id' => $this->sysUserId, 'ins_id' => isset($row[2]) ? hash('fnv164', $row[2], false) : null, 'name' => $row[2], 'cat_id' => isset($row[1]) ? hash('fnv164', $row[1], false) : null, 'category' => $row[1], 'rebate_ratio' => $row[0], 'star_count' => $row[3], 'platforms' => $row[4], 'is_sign' => $row[5], 'contact' => $row[6], 'address' => $row[7] ]); } /** * @return string|array */ public function uniqueBy() { return ['group_id', 'ins_id']; } /** * @return int */ public function startRow(): int { return 2; } public function getRowCount(): int { return $this->rows; } }