| xqd
@@ -75,8 +75,15 @@ class InfoController extends Controller
|
|
|
*/
|
|
|
public function import(Request $request)
|
|
|
{
|
|
|
- Excel::import(new CompanyInfoImport, request()->file('company_info'));
|
|
|
- $this->showMessage('操作成功');
|
|
|
+ $fileName = request()->file('company_info')->getClientOriginalName();
|
|
|
+ $fileType = fileExt($fileName);
|
|
|
+ if($fileType == 'xls' || $fileType== 'xlsx'){
|
|
|
+ Excel::import(new CompanyInfoImport, request()->file('company_info'));
|
|
|
+ $this->showMessage('操作成功');
|
|
|
+ }else{
|
|
|
+ return $this->showWarning("请上传xls或者xlsx格式的Excel文件");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/***
|