随笔分类 -  ThinkPHP

摘要:安装 首先通过 composer 安装 composer require topthink/think-worker SocketServer 在命令行启动服务端 php think worker:server 默认会在0.0.0.0:2345开启一个websocket服务。如果需要自定义参数,可以 阅读全文
posted @ 2023-09-15 00:10 成文的博客 阅读(635) 评论(0) 推荐(0) 编辑
摘要:一、Class 'think\Image' not found composer require topthink/think-image 装上了扩展控制器头部加了 use think\Image然后\think\image::open($imgSrc);提示Class 'think\Image' 阅读全文
posted @ 2020-07-29 11:47 成文的博客 阅读(1329) 评论(0) 推荐(1) 编辑
摘要:<?php //发送手机验证码 function smsCode() { //dump($this->request->post()); //请求方式验证 /*if (!$this->request->isAjax()) { $this->error('请求异常'); }*/ $mobile = $ 阅读全文
posted @ 2020-07-02 17:37 成文的博客 阅读(253) 评论(0) 推荐(0) 编辑
摘要://防止恶意刷新 function refresh() { //代理IP直接退出 empty($_SERVER['HTTP_VIA']) or exit('访问失败'); //ip限制 $ip=request()->ip(); //黑名单 if(cache('ip_black')&&in_array 阅读全文
posted @ 2020-07-02 17:31 成文的博客 阅读(222) 评论(0) 推荐(0) 编辑
摘要:关联模型 $this->hasOne(关联模型的类名, 关联模型的外键, 当前模型的主键); $this->belongsTo(关联模型的类名, 当前模型的外键, 关联模型的主键); $this->hasMany(关联模型的类名, 关联模型的外键, 当前模型主键); $this->belongsTo 阅读全文
posted @ 2020-07-01 21:27 成文的博客 阅读(116) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示