![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
fastadmin
范多伦
我是一个在北京的技术流浪者,FastAdmin项目组成员,致力于PHP后端云开发,用户体验研究,Web3技术,区块链,元宇宙技术探索
展开
-
thinkphp6如何用mysql函数查询
其中INSTR就是mysql函数,这个函数的作用就是查询name字段里面是否包含/,前面加一个not,那么否定的意思。原创 2022-09-01 13:44:27 · 810 阅读 · 0 评论 -
如何禁用doctrine/annotations
这个thinkphp6插件虽然好,可是有的时候,我们并不需要他。在不需要的时候,打开vendor/services.php,把这一行1 => 'iszsw\\mock\\Service', 注释掉。原创 2021-07-20 03:45:50 · 238 阅读 · 0 评论 -
Your Composer dependencies require a PHP version “>= 7.2.
Composer detected issues in your platform:Your Composer dependencies require a PHP version ">= 7.2.5". You are running 7.1.9. in G:\shzh\vendor\composer\platform_check.php on line 24碰到这种情况,把电脑环境变量的PHP路径,设置成7.3以上的。有点时候在机器上开发环境,安装了好几个版本的php,但是环境变量里面只有一个原创 2021-07-07 15:00:37 · 7352 阅读 · 0 评论 -
mysql远程无法连接,阿里云给我的回复
1. 请您确认您自身mysql端口正常,如netstat -antp| grep 3306。2. 如端口正常监听0.0.0.0,确认下是否有iptables规则限制。点击阿里云服务器实例,进入安全组,配置规则,开启3306端口,设置授权对象0.0.0.0/0。运行: iptables -L -n -t natz如iptables查看有规则,执行 iptables -I INPUT -p tcp --dport 3306 -j ACCEPT运行: firewal...原创 2021-04-29 10:34:39 · 70 阅读 · 0 评论 -
在thinkphp6中,应该如何用in查询
当一个非常简单的查询,我们直接这样写就可以了。$where=[];$where['status']=1;$lst=$this->where($where)->select();如何涉及到比较复杂的查询,有in这样的嵌套查询,那么就必须这样写。$where=[];$where[]=['memberid','=',$uid];$where[]=['itemid','in',$cartIds];$lst=$this->where(...原创 2021-03-22 22:31:07 · 5939 阅读 · 0 评论 -
Thinkphp6.0 获取绝对路径
在tp6.0 改到了App 基础类里面获取助手函数获取:app()>getRootPath() //获取应用根目录app()>getNamespace() //获取应用类库命名空间app()>version() //获取框架版本app()>getBasePath() //获取应用基础目录app()>getAppPath() //获取当前应用目录app()>getThinkPath() //获取核心框架目录app()>getConfigPath() /转载 2020-10-24 13:10:59 · 6588 阅读 · 0 评论 -
fastadmin升级bootstrap遇到的问题
fastadmin引用的Bootstrap版本是3.X,我升级到了4.4之后,遇到了这样一个问题。Uncaught Error: Script error for "popper.js", needed by: bootstrap - require.js。在bootstrap里定义的是require('popper.js'), 而不是require标准的require('popper'), 所以要在map里做一个转换以让require.js识别。在require-backend.js文件里面,原创 2020-10-23 17:34:28 · 899 阅读 · 0 评论 -
服务器上MYSQL的配置
不要问我从哪里来,不要问我为什么?MYSQL版本用5.7 innodb_flush_log_at_trx_commit 这个参数设置成 1 的时候,表示每次事务的 redo log 都直接持久化到磁盘。 sync_binlog 这个参数设置成 1 的时候,表示每次事务的 binlog 都持久化到磁盘。 transaction-isolation 事务隔离级别配置。 se原创 2020-10-18 22:42:06 · 181 阅读 · 0 评论 -
微信支付H5完整版代码
在贴代码之前,说明一下:我用的是php7.1第一步:在前端html里面,设置一个iframe。<iframe src="" id="payw" width="0" height="0" sandbox="allow-scripts allow-top-navigation allow-same-origin"></iframe>第二步,当点击支付按钮的时候,调用js代码。$("#btnsure").click(function(e){ $.原创 2020-09-19 21:32:53 · 4191 阅读 · 0 评论 -
配置了slb,fastadmin登录无法保存session
这个问题我解决了!!! 就是把application/admin/library/Auth.php 改成我这样的。<?phpnamespace app\admin\library;use app\admin\model\Admin;use fast\Random;use fast\Tree;use think\Config;use think\Cookie;use think\Hook;use think\Request;use think\Session;class.原创 2020-07-17 13:14:58 · 1714 阅读 · 0 评论 -
在Thinkphp6控制器中创建success函数和error函数
/** * 操作成功跳转的快捷方法 * @access protected * @param mixed $msg 提示信息 * @param string $url 跳转的URL地址 * @param string $type 请求类型,默认是接口请求,如果pc端请求那么用html * @param mix...原创 2020-03-30 22:39:28 · 1179 阅读 · 0 评论 -
在thinkphp6中解决twig模板读取问题
在thinkphp6中,可以这样访问某个文件夹的控制器。例如:/admin/area.province.html 这样写代表admin模块下面,area文件夹下,province控制器。但是这样写的话,在加载模板的时候,会出现错误。The "G:\gaowangbei\app\admin\view\area.province\" directory does not exist ("G:...原创 2020-03-16 22:10:37 · 817 阅读 · 0 评论 -
在Thinkphp6发邮件
$transport = \Swift_SmtpTransport::newInstance('smtp.163.com', 25) ->setUsername('andiff@163.com') ->setPassword('7654321a') ; ...原创 2020-03-09 10:56:23 · 2103 阅读 · 0 评论 -
在thinkphp6里面,如何关闭debugbar
在目录vendor/topthink/think-debugbar/src/Service.php里面,把函数boot里面的语句注释掉。这样就可以了。如果打开的话,就取消注释,没有必要运行composer remove命令,尽量少用这个命令。如果非得删除的话,那么composer remove maximebf/debugbar...原创 2020-01-31 00:33:10 · 1146 阅读 · 0 评论 -
fastadmin里面播放声音插件
(function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as anonymous module. define(['jquery'], factory); } else if (typeof exports ==...原创 2018-07-20 21:51:27 · 1644 阅读 · 0 评论 -
Summernote文字编辑器添加代码插入功能
经过两天的改造,目前Summernote终于可以支持代码插入了。summernote.js文件奉上/** * Super simple wysiwyg editor v0.8.10 * https://summernote.org * * Copyright 2013- Alan Hong. and other contributors * summernote may be ...原创 2018-10-22 18:14:41 · 4358 阅读 · 0 评论 -
mysql正确的配置
/etc/my.cnf文件# For advice on how to change settings please see# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html[client]default-character-set = utf8mb4[mysql]default-ch...原创 2018-09-11 09:58:20 · 289 阅读 · 0 评论 -
Fastadmin里面类别多选效果实现
selectcategory: function(form){ if ($(".selects3", form).size() > 0) { $(".selects3").bind('click',function(){ var s1 = '';var p = ''; ...原创 2018-09-09 11:29:43 · 7219 阅读 · 0 评论 -
Fastadmin如何配置默认采用又拍云上传?
在application/extra/addons.php里面,hooks数组里面,增加'upload_config_init' => array ( 0 => 'upyun', ),即可,very easy原创 2018-09-01 11:14:44 · 1021 阅读 · 0 评论 -
微信小程序如何引用其他js文件
1.我们先建立一个common.js文件,在common.js编写我们的程序,function myfunc() {console.log("myfunc....");}module.exports.myfunc = myfunc; 这样暴露接口,这里不暴露是不能引用的,在文件域js内var common = require("../../common.js");去链接过来,光...转载 2018-07-26 21:43:33 · 15320 阅读 · 0 评论 -
前端标准化(PC)
<div class="warp container"> <form id="frm" name="frm" action=""> <input type="hidden" id="userid" name="userid" value="{$user.itemid}"&原创 2018-10-26 16:41:03 · 759 阅读 · 0 评论 -
thinkphp5.1里面APP_PATH不能随便修改
APP_PATH常量默认是tp51/tp5/public\一旦随意修改了之后,那么就会报错。Fatal error: Uncaught exception 'think\exception\ErrorException' with message 'include(): Filename cannot be empty' in F:\wamp64\www\web\think_git\thi...原创 2018-11-03 14:56:19 · 7105 阅读 · 1 评论 -
UEeditor编辑器上传文件以后如何显示图片绝对路径
现在网站都有手机版和pc版,但是后台往往都是一个。但是在后台用ueeditor来上传图片的时候,往往会发现上传的图片,显示的路径是相对路径,也就是不带域名的路径,这样在pc端上传的图片,往往在手机版看不到。如何解决这个问题,其实非常简单。在ueeditor文件夹下面的library\php文件夹下面,有一个config.json文件,打开之后找到imageUrlPrefix,把这个配置...原创 2019-01-31 00:07:19 · 1289 阅读 · 0 评论 -
小程序类别联动选择(二级类别)
<view class="weui-cell__bd"> <picker mode="multiSelector" bindchange="bindMultiPickerChange" bindcolumnchange="bindMultiPickerColumnChange" range-key="name" range="{{brands}}"> ...原创 2019-05-29 03:32:38 · 6830 阅读 · 0 评论 -
FastAdmin 目录权限设置
开发阶段请给予项目全部的777权限。生产环境首先全部设置为655权限,runtime目录设置为755权限public/uploads目录设置为755权限并禁用PHP脚本执行生产环境修改用户组及权限代码如下:chown www:www /var/www/fastadmin -Rchmod 655 /var/www/fastadmin -Rchmod u+w /var/www/f...原创 2019-07-11 09:58:13 · 3377 阅读 · 0 评论 -
Fastadmin上传多个图片的前端代码
如果一个商品,需要上传多个图片,那么如此定义html‘代码即可’<div class="form-group"> <label for="c-thumb" class="control-label col-xs-12 col-sm-2">图片:</label> <div class="col-xs-12 col-sm-8"> &...原创 2019-07-18 16:40:23 · 5795 阅读 · 3 评论 -
FastAdmin又拍云插件第三版,支持多文件上传
JS代码/*又拍云插件--Power by Andiff weixin:17191079694 QQ:165607361 */(function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as anonymous module....原创 2019-07-18 22:31:48 · 696 阅读 · 0 评论 -
Thinkphp开发应该如何注意安全问题
ThinkPHP在考虑开发体验的同时,仍然十分重视框架的底层安全,虽然屡有安全漏洞被播报,但官方都是第一时间进行修复处理,而且大部分漏洞只要开发者有一定的安全意识都是可以避免的,今年也和国内的几个安全团队建立了合作关系,有助于提前发现和及时修正框架可能被利用的漏洞或者隐患。请务必把你的WEB根目录指向public目录而不是应用根目录,并且不要随意更改入口文件的位置。public目录下面不要放除...转载 2019-07-29 10:31:38 · 1047 阅读 · 0 评论 -
Fastadmin里面的配置信息
{ "site": { "name": "FastAdminCMS", "cdnurl": "", "version": 1517987530, "timezone": "Asia\/Shanghai", "languages": { "backend": "zh-cn", "frontend": "zh-cn" } }, "upload": { "c原创 2018-02-07 16:48:01 · 9915 阅读 · 0 评论 -
用photoswipe实现朋友圈查看图片效果
.text{ float: left; text-align: left; padding-left: 10px;width:99%;}.text .my-gallery{ overflow: hidden;}.text .my-gallery div{ width: 31%; overflow: hidden; float: left; margin-top: 5px;margin-righ...原创 2018-07-07 09:45:36 · 3016 阅读 · 5 评论 -
不修改upyun的上传地址,ueditor无法使用
不修改upyun的上传地址,ueditor无法使用,总是报这种错误http://yourcdnurl.com/assets/addons/ueditor/themes/iframe.css Failed to load resource: net::ERR_NAME_NOT_RESOLVED必须修改addons/upyun/config.php,找到cdnurl,然后把这个值设置为空。uedito...原创 2018-07-06 17:01:03 · 274 阅读 · 0 评论 -
FastAdmin添加首字母大写功能
在Fast.js里面,添加这个函数。ucfirst:function(s){ //首字母大写 var str = s.toLowerCase(); var strarr = str.split(' '); var result = ''; for(var i in strarr){ result += strarr[...原创 2018-03-16 02:51:48 · 531 阅读 · 0 评论 -
PHP数组根据数组内的某个单元字段排序
$arr = array( array( 'name'=>'sadas', 'norder'=>1 ), array( 'name'=>'sadas', 'norder'=>11 ), array( 'name'=>'sadas'...转载 2018-02-22 17:27:31 · 197 阅读 · 0 评论 -
Fastadmin读取数据库配置
php代码:\think\Config::get('database')返回数组:[type] => mysql [dsn] => [hostname] => localhost [database] => fastadmin [username] => root [password] => root [hostport] => [params] =>...原创 2018-02-22 13:57:42 · 9065 阅读 · 0 评论 -
Fastadmin的表格切换代码
在Fastadmin中,可以把表格切换成适应手机的形式。这是响应式最重要的一个部分。下面我把我写的代码给大家开源了。$("#toggleview").on('click', function (e) { if($("#table thead").is(":hidden")){ //转换table视图 ...原创 2018-02-19 22:31:28 · 1363 阅读 · 0 评论 -
Fastadmin的导入功能
导入功能默认是禁用的,如需启用需做以下操作1. 在你的控制器中继承import方法,如下public function import(){ return parent::import();}2. 在index.html中的build_toolbar方法添加import,如下{:build_toolbar('refresh,add,edit,del,import')}3. 在模块对...转载 2018-02-18 18:03:42 · 12430 阅读 · 0 评论 -
Fastadmin类别无限极选择组件源码泄露
我们只需要在界面代码的form中,做如下定义即可。HTML代码:<div class="form-group"> <label for="c-catid" class="control-label col-xs-12 col-sm-2">类别:</label> <div class="col-xs-12 col原创 2018-02-18 17:56:59 · 4357 阅读 · 1 评论 -
如何关闭FastAdmin的后台版本自动检测更新功能?
为了让大家及时接收到FastAdmin的最新版更新,我们在后台管理部分加入了一个版本检测功能,从1.0.0.20180118_beta这个版本起,自动检测更新的功能已经默认关闭,如果需要开启,可以修改application/config.php中的fastadmin中checkupdate的值为true即可。请注意:如果你使用的FastAdmin的版本低于1.0.0.20180118_转载 2018-02-06 15:15:24 · 2011 阅读 · 0 评论 -
fastadmin创蓝短信插件第二版
<?phpnamespace addons\clsms;use think\Addons;/** * 插件 */class Clsms extends Addons{ /** * 插件安装方法 * @return bool */ public function install() { return true;原创 2018-01-29 00:31:56 · 1581 阅读 · 0 评论 -
Fastadmin类别联动选择的问题
不能选择顶级类别。在/admin/Controller/Ajax.php文件里面。/** * 读取分类数据,联动列表 */ public function category() { $type = $this->request->get('type'); $pid = $this->request->get...原创 2018-02-09 13:30:43 · 12806 阅读 · 0 评论