<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ``` /** * 添加 */ public function add() { if ($this->request->isPost()) { $params = $this->request->post("row/a"); if ($params) { $file = $params['local']; if (!$file) { $this->error(__('Parameter %s can not be empty', 'file')); } $filePath = ROOT_PATH . DS . 'public' . DS . $file; if (!is_file($filePath)) { $this->error(__('No results were found')); } $PHPReader = new \PHPExcel_Reader_Excel2007(); if (!$PHPReader->canRead($filePath)) { $PHPReader = new \PHPExcel_Reader_Excel5(); if (!$PHPReader->canRead($filePath)) { $PHPReader = new \PHPExcel_Reader_CSV(); if (!$PHPReader->canRead($filePath)) { $this->error(__('Unknown data format')); } } } $PHPExcel = $PHPReader->load($filePath); //加載文件 $currentSheet = $PHPExcel->getSheet(0); //讀取文件中的第一個工作表 $highestRow = $currentSheet->getHighestRow(); // // 取得總列數 $highestColumm = $currentSheet->getHighestColumn(); $i=0; $data=[]; //從第一行開始讀取數據 for($j=2;$j<=$highestRow;$j++){ //從A列讀取數據 // for($k='A';$k!=$highestColumn;$k++){ /*這是大于26列的數據*/ for($k='A';$k<=$highestColumm;$k++){ /*這是小于26列的數據*/ // 讀取單元格 $data[$j][] = $PHPExcel->getActiveSheet()->getCell("$k$j")->getValue(); // $data[$j][] = $sheet->getCell($k.$j)->getValue(); } } foreach ($data as $val) { $dataArray = array( 'house_name'=>trim($val[0]), 'name' => trim($val[1]), 'id_card' => trim($val[2]), 'category_id' => $params['category_id'], 'community'=>trim($val[3]), 'remarks' => trim($val[4]), ); $subsidy_user=Db::name('subsidy_user')->where('id_card',$val[2])->where('category_id',$params['category_id'])->find(); if(!$subsidy_user){ $res = Db::name('subsidy_user')->insert($dataArray); if ($res) { $i++; } } } } if ($i>0) { $this->success('導入成功'); } else { $this->error('導入失敗,請檢查是否有重復或者模板格式是否正確!'); } } return $this->view->fetch(); } ``` ``` "phpoffice/phpexcel": "^1.8", composer update 就可以了 ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看