argument('type'); $file_path = $this->argument('filepath'); //路径相对于项目根目录即 /public if(empty($type) || empty($file_path)){ dd('请输入完整参数'); } //医生信息导入 if($type == 'user'){ $this->makeUser($file_path); } } public function makeUser($file_path) { $this->importsUser($file_path); } public function importsUser($filePath) { $filePath = './public/import/' . $filePath . '.xls'; Excel::import(new UserInfo(), $filePath); } }