使用DolphinPHP的框架中的excel插件导入数据
作者:互联网
直接上函数吧
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(); } }
标签:files,插件,name,DolphinPHP,excel,Excel,result,array,POST 来源: https://www.cnblogs.com/baker95935/p/10428083.html