option('company'); if ($companyId <= 0 || !Company::query()->where('id', $companyId)->exists()) { $this->error('请指定有效的 --company,公司配置不会跨公司写入。'); return self::FAILURE; } $path = $this->argument('file'); $rows = $importer->read($path); if ($this->option('dry-run')) { $this->info('文件校验通过,共' . count($rows) . '条;未写入。'); return self::SUCCESS; } $result = $store->import($companyId, $rows, '用户授权存量配置导入', hash_file('sha256', $path)); $this->info('导入完成:新增' . $result['added'] . '条,重复跳过' . $result['skipped'] . '条。'); return self::SUCCESS; } }