摘要: php读取上传的csv文件 $filePath = $_FILES['file']['tmp_name']; $data = []; if (file_exists($filePath)) { $handle = fopen($filePath, 'r'); while ($tmp = fgetcs 阅读全文
posted @ 2022-11-19 11:08 carol2014 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 安装 composer require phpoffice/phpspreadsheet 读文件 <?php require './libs/phpoffice/vendor/autoload.php'; use PhpOffice\PhpSpreadsheet\IOFactory; use Php 阅读全文
posted @ 2022-11-19 11:08 carol2014 阅读(1045) 评论(0) 推荐(0) 编辑
摘要: 最近需要开发一个生成pdf文件的程序 ,试用了下几个生成pdf包的效果 <div style="width: 80%; padding-right: 3rem; padding-left: 3rem; margin-right: 3rem; margin-left: 3rem"> <table bo 阅读全文
posted @ 2022-11-19 11:06 carol2014 阅读(3033) 评论(0) 推荐(0) 编辑
摘要: <?php require_once './libs/tcpdf/vendor/autoload.php'; require_once './libs/mpdf/vendor/autoload.php'; require_once './libs/dompdf/vendor/autoload.php 阅读全文
posted @ 2022-11-19 10:56 carol2014 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 多语言切换 config/app.php 中 locale 中默认为‘en’ 'locale' => 'zh_CN', 建立LanguageController namespace App\Http\Controllers; class LanguageController extends Cont 阅读全文
posted @ 2022-11-19 10:52 carol2014 阅读(335) 评论(0) 推荐(0) 编辑
摘要: $query=DB::connection($conn)->table($table) ->select('*', DB::raw("CONCAT(date,' ',time) AS dttm")) ->where('P', $p) ->whereIn('status', $status) ->wh 阅读全文
posted @ 2022-11-19 10:47 carol2014 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 宏指令允许添加自定义功能到 Laravel 的内部组件里去,App\Providers\AppServiceProvider boot()方法中注册。 Request #注册 Request::macro('introduce', function ($name) { return 'Hello ' 阅读全文
posted @ 2022-11-19 10:43 carol2014 阅读(330) 评论(0) 推荐(0) 编辑
摘要: 安装代码包 composer require maatwebsite/excel 导出多个sheet //ExportMulSheets.php namespace App\Exports; use Maatwebsite\Excel\Concerns\Exportable; use Maatweb 阅读全文
posted @ 2022-11-19 10:28 carol2014 阅读(469) 评论(0) 推荐(0) 编辑
摘要: JSZIP的github地址:https://github.com/Stuk/jszip 多个echarts图一键下载 charts_all.map(([index, myChart]) => { const imgContent = myChart.getDataURL({ type: "png" 阅读全文
posted @ 2022-11-19 10:20 carol2014 阅读(72) 评论(0) 推荐(0) 编辑
摘要: <script> function readCsv() { const file = $("#uploadFile")[0].files[0]; if (file.type != "text/csv") { alert("文件类型错误"); return; } var reader = new Fi 阅读全文
posted @ 2022-11-19 10:16 carol2014 阅读(788) 评论(0) 推荐(0) 编辑