argument('type'); $file_path = $this->argument('filepath'); //路径相对于项目根目录即 /public if(empty($type) || empty($file_path)){ dd('请输入完整参数'); } //医生信息导入 if($type == 'docter'){ $this->makeDocter($file_path); } if($type == 'organization'){ $this->makeOrganization($file_path); } } //医生模块 public function makeDocter($file_path) { $this->imports($file_path); } public function imports($filePath) { $filePath = './public/import/' . $filePath . '.xls'; Excel::import(new DocterInfo(), $filePath); } //机构模块 public function makeOrganization($file_path) { $this->importsOrganization($file_path); } public function importsOrganization($filePath) { $filePath = './public/import/' . $filePath . '.xls'; Excel::import(new OrganizationInfo(), $filePath); } }