diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index 657511e6..e6382621 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -4267,18 +4267,30 @@ class Admin_DataController extends Zend_Controller_Action //检查能否写入数据表 if($ac == "checktables"){ + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); + $table = $this->_getParam('table'); - if(empty($table)){ + $schema = $this->_getParam('schema'); + $file = $this->_getParam('file'); + if(empty($table) || empty($schema) || empty($file)){ $this->_helper->json(['error'=>'參數錯誤']); return true; } $tableControl = new Visual\DataTableControl; - $fields = $tableControl->readFields($table); + $fields = $tableControl->readFields($schema . "." .$table); - foreach($fields as $k=>$v){ + $fileHandle = new Dataimport\File; + $realFile = $fileHandle->getRealName($file); - } + $processing = Dataimport\ProcessFactory::Bootstrap($fileHandle->getFileTextExt($file)); + /** @var \Westdc\Dataimport\Processing\Csv $processing */ + $processing->init($realFile); + + $status = $processing->checkTableField($fields); + + //$this->_helper->json($status); return true; } diff --git a/application/admin/views/scripts/data/dataimport-target.phtml b/application/admin/views/scripts/data/dataimport-target.phtml index 141bdda7..1f44727b 100644 --- a/application/admin/views/scripts/data/dataimport-target.phtml +++ b/application/admin/views/scripts/data/dataimport-target.phtml @@ -36,16 +36,21 @@ $this->headTitle()->setSeparator(' - ');
-