作者 董瑞恩
1 个管道 的构建 通过 耗费 0 秒

interface

... ... @@ -185,18 +185,18 @@ class AdminEquipmentController extends AdminBaseController{
public function ceshi(){
$ids=$this->request->param('ids/a');
$this->success('成功'.$ids[0]);
$data=$this->batch_export($ids);
if ($data==true){
$this->success('成功');
}else{
$this->error('失败');
}
}
//批量导出
public function batch_export(){
$ids=$this->request->param('ids/a');
if (empty($ids)){
dump('数据为空');
exit();
}
public function batch_export($ids){
$data= Db::name('equipment')->where(['id' => ['in', $ids]])->select();
// 导出Exl
vendor("VENDOR_PATH/phpoffice/phpexcel/Classes/PHPExcel");
vendor("VENDOR_PATH/phpoffice/phpexcel/Classes/PHPExcel/Worksheet/Drawing");
... ... @@ -279,7 +279,7 @@ class AdminEquipmentController extends AdminBaseController{
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output'); //文件通过浏览器下载
// END
$this->success('success');
return true;
}
//生成二维码
... ...