摘要: DB facade实现CURD(操作数据库 手写原生SQL语句) namespace App\Http\Controllers; //控制器继承use Illuminate\Support\Facades\DB; use App\Student;插入数据 (返回bool 插入是否成功) $resul 阅读全文
posted @ 2020-05-04 20:45 北满 阅读(220) 评论(0) 推荐(0) 编辑
摘要: #微信小程序登录 ###微信小程序官方给了十分详细的登陆时序图,当然为了安全着想,应该加上签名加密。 ###微信小程序端1).调用wx.login获取 code 。2).调用wx.getUserInfo获取签名所需的 rawData , signatrue , encryptData 。3).发起请 阅读全文
posted @ 2020-04-13 19:23 北满 阅读(289) 评论(0) 推荐(0) 编辑
摘要: /** * Notes: 文件上传 * Created by jessie@seabig.cn * DateTime: 2020-02-18 16:17 */ public function UploadImg() { $this->_globals(); //数据过滤 if (!$_FILES) 阅读全文
posted @ 2020-03-30 19:31 北满 阅读(232) 评论(0) 推荐(0) 编辑
摘要: /** * Notes: Base64 图片 上传 * Created by chenbiao@seabig.cn * Date: 2020/1/16 * Time: 10:49 *@param $image base64图片字符串 */ public function fileUploads($i 阅读全文
posted @ 2020-01-17 15:17 北满 阅读(872) 评论(0) 推荐(0) 编辑
摘要: public function getWechatOpenid(){ $appid = trim($this->result["sites"]["appid"]); $secret = trim($this->result["sites"]["appsecret"]); $code = $_GET[ 阅读全文
posted @ 2020-01-02 09:09 北满 阅读(326) 评论(0) 推荐(0) 编辑
摘要: 1、不用系统函数反转字符串 function descstr($str){ $len=strlen($str); //函数返回字符串的长度: $newstr=""; for($i=$len-1;$i>=0;$i--){ $newstr.=$str[$i]; //注意此处的花括号 } return $ 阅读全文
posted @ 2019-11-26 22:49 北满 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 因为需要在 php 开发中对接其它接口需要用 php curl 去对接其它接口 我把他们封装成函数 希望能对大家有所帮助。 这里面是封装好的会自动把 data 进行转成 json 格式,同时解码成 php 数组输出。 function geturl($url){ $headerArray =arra 阅读全文
posted @ 2019-11-19 22:21 北满 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 1、冒泡排序 2、快排 阅读全文
posted @ 2019-10-16 11:05 北满 阅读(430) 评论(0) 推荐(0) 编辑
摘要: 简单粗暴直接上代码 引入文件(PHPExcel.php)传送门 :http://xcdn.php.cn/leiku/chuli/PHPExcel-1.8.zip?sign=32bd8b6174060344d512ff228b4bc229&timestamp=1571102641 :https://w 阅读全文
posted @ 2019-10-15 15:26 北满 阅读(1114) 评论(0) 推荐(0) 编辑
摘要: 最近在做ecshop的商品库存模块,分别给一款商品的多个属性组合设置库存,如下图: 一款手机有不同颜色,屏幕尺寸,系统和电量,都要设置不同的库存,如果都要手动选择属性组合,则会耗费很多不必要的时间。假如打开页面时就已经设置好属性排列组合那就最好不过,因此想了整天,写了如下函数: 如果需要组合内容的来 阅读全文
posted @ 2019-09-18 14:53 北满 阅读(1510) 评论(0) 推荐(0) 编辑