兵兵有你

人品好,气质差.丢了工作就回家...

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

1.将整数转成带2位有效数字的小数  sprintf("%1\$.2f",199);

2.excel中日期接收转换: date("Y-m-d H:i:s",intval(($get_row['开票日期']- 25569) * 3600 * 24));

3. excel导出流模式,easy_excel

        Excel::export($data)->store($fileName);
        //$fileName = "./a.xls";
        ob_clean();
        ob_start();
        $handler            = fopen($fileName, 'r+b');
        $file_size          = filesize($fileName);
        Header("Content-type: application/octet-stream");
        Header("Accept-Ranges: bytes");
        Header("Accept-Length: ".$file_size);
        Header("Content-Disposition: attachment; filename=" . basename( $fileName));
        Header('Access-Control-Allow-Origin:*');
        Header('Access-Control-Allow-Methods:POST,GET,OPTIONS,DELETE');
        echo fread($handler,$file_size);
        fclose($handler);
        unlink($fileName);
        ob_end_flush();
        exit;

 

4.excel中创建sql句子

="update waybills set aa='"&B2&"' where goods_order='"&A2&"';"

posted on 2023-05-06 08:59  greatbing  阅读(11)  评论(0编辑  收藏  举报