随笔分类 - Yii2框架
Yii2框架笔记
摘要:在某些程序在执行的时候需要进行多个动作,而我们的业务要求是某个动作在执行错误的时候该进程所有的动作都不再执行,全部执行成功才算成功,否则就回到执行之前的状态,这就需要用到事务的处理。 示例(基于YII框架): //支付单编号 $paySn = CommonFun::makeRandSn($this-
阅读全文
摘要:使用这个类前,需安装PHPExcel库,安装教程可参考:https://www.cnblogs.com/JahanGu/p/8039021.html 导出excel类: <?php /* * 导出表格 */ namespace common\utils; class OutputExecl { /*
阅读全文
摘要:使用快递鸟的api查询物流详情,以此写的类 <?php /* * 快递鸟物流 */ namespace common\utils; class Kdniao { //填写你自己申请的快递鸟的配置 private $EBusinessID = '000000'; private $AppKey = '
阅读全文
摘要:YII2图片上传类和调用 上传类: <?php namespace common\utils; use common\utils\CommonFun; use Yii; /** file: fileupload.class.php 文件上传类FileUpload 本类的实例对象用于处理上传文件,可以
阅读全文
摘要:Yii2框架增删改查自定义类归纳: <?php namespace common\models; use \Yii; class DB { public static function query($sql,$a=''){ $reslt = \Yii::$app->db->createCommand
阅读全文