直接上函数吧
public function importfile() { if ($this->request->isPost()) { if($_POST['files']) { CustomerDataModel::where('id','>',0)->delete(); $info=Db::name('admin_attachment')->find($_POST['files']); $fields=array('name'=>'名称','count'=>'申请量'); $result=plugin_action('Excel/Excel/import', [$info['path'],$table='customer_data',$fields,1,$where=array(),'name']); $this->success($result['message'], 'applyinfo'); } exit; } else { return ZBuilder::make('form') ->addFormItem('file', 'files', '附件') ->isAjax(false) ->fetch(); } }