2022年1月16日

摘要: //封装函数 function like(str,start,length){ var offset = start || 0; var len = length || 10; len = Math.min(len,20); //判断字符串长度 if(str.length <= len){ retu 阅读全文
posted @ 2022-01-16 21:42 少雄3306 阅读(682) 评论(0) 推荐(0) 编辑

2021年12月30日

摘要: /*** 查询商家信息* @param $id 商家id*/public function getStoreInfo(Request $request){ $validate = new CommonValidate([ 'id' => 'require|integer', ]); if (!$va 阅读全文
posted @ 2021-12-30 11:54 少雄3306 阅读(703) 评论(0) 推荐(0) 编辑
摘要: function limitoftimes($numberoftimes=10,$timespant="oneday",$verification=false){ $cacheneme = request()->url().$numberoftimes; $nowtimes = cache($cac 阅读全文
posted @ 2021-12-30 11:52 少雄3306 阅读(33) 评论(0) 推荐(0) 编辑

2021年12月29日

摘要: 第一步: composer require firebase/php-jwt 第二步 <?phpnamespace app\controller;use Firebase\JWT\ExpiredException;use Firebase\JWT\JWT as JWTUtil;use think\E 阅读全文
posted @ 2021-12-29 20:32 少雄3306 阅读(762) 评论(0) 推荐(0) 编辑

2021年12月15日

摘要: 一、开启SMTP服务(使用php发送邮件需要用到SMTP服务,这里以QQ邮箱的SMTP服务为例) 1.登录qq邮箱,在首页上找到“设置”。 2.选择开启的服务,一般都全选,POP3/SMTP/IMAP,开启SMTP服务就得先开通客户授权码。 3.点击开通客户授权码,选择开启 4.需要手机验证码,需要 阅读全文
posted @ 2021-12-15 17:13 少雄3306 阅读(252) 评论(0) 推荐(0) 编辑

2021年12月9日

摘要: /** * 单文件上传接口 * @param Request $request * @return \think\response\Json */ public function logo(Request $request): Json { // 接收上传的类型 $type = $request-> 阅读全文
posted @ 2021-12-09 09:50 少雄3306 阅读(786) 评论(0) 推荐(0) 编辑

2021年12月2日

摘要: public function excel(){ $list = Db::table('news')->select(); //导出的文件名称 $file_name = date('Y-m-d_H:i:s') . '表格' . '.xls'; $PHPExcel=new \PHPExcel(); $ 阅读全文
posted @ 2021-12-02 11:28 少雄3306 阅读(36) 评论(0) 推荐(0) 编辑
摘要: public function images(Request $request) { $news = file_get_contents("http://v.juhe.cn/toutiao/index?type=top&key=?自己的七牛云key"); $news = json_decode($n 阅读全文
posted @ 2021-12-02 11:07 少雄3306 阅读(31) 评论(0) 推荐(0) 编辑

2021年11月30日

摘要: //先把七牛云下载下来composer require qiniu/php-sdk//引入必须要的类 use Qiniu\Auth;use Qiniu\Http\Client; //在common.php 中定义一个公共方法function imageCheck($image_url){ // 用于 阅读全文
posted @ 2021-11-30 11:22 少雄3306 阅读(105) 评论(0) 推荐(0) 编辑

2021年11月28日

摘要: //验证信息public function pay(){ $params = input(); unset($params['/callback']); $validate = $this->validate($params,[ 'order_number|订单号'=>'require', 'pay 阅读全文
posted @ 2021-11-28 20:31 少雄3306 阅读(42) 评论(0) 推荐(0) 编辑