私人领地
摘要: 场景描述:要做seo,要缩短路由。原xxx.com/home/article/1改为xxx.com/article/1 解决办法:index.php <?php // + // | ThinkPHP [ WE CAN DO IT JUST THINK ] // + // | Copyright (c 阅读全文
posted @ 2023-07-01 11:43 狂奔的蜗牛Snails 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 步骤一:备份文件,然后迁移到新服务器对应目录下。 目录 /www/server/cron,备份cron下的所有文件 步骤二:数据库迁移 下载/www/server/panel/data/default.db文件,使用SQLiteStudio工具打开数据库。删除老站的crontab表,把新站的表复制进 阅读全文
posted @ 2023-01-07 11:38 狂奔的蜗牛Snails 阅读(920) 评论(0) 推荐(0) 编辑
摘要: 步骤一: 在阿里图标中创建项目并且选好图标,进入“”项目设置“”-》选中base64,再保存 步骤二: 微信小程序创建一个/static/icon.wxss文件。复制阿里图标代码,放入到icon.wxss文件里 步骤三:调用 在wxss文件里,先引入icon.wxss // wxss引入文件 @im 阅读全文
posted @ 2022-12-25 17:48 狂奔的蜗牛Snails 阅读(518) 评论(0) 推荐(0) 编辑
摘要: 环境是linux+apache,先找到文件mime.types(路径:apache/conf/mime.types) application/pdf pdf # application/pdx application/pgp-encrypted pgp # application/pgp-keys 阅读全文
posted @ 2022-12-06 15:17 狂奔的蜗牛Snails 阅读(213) 评论(0) 推荐(0) 编辑
摘要: 官方手册地址:https://www.jianguoyun.com/s/downloads/linux 阿里云图形界面安装:https://help.aliyun.com/document_detail/41227.html 1.安装linux系统必须先安装图形界面 2.命令行 // 官方命令行su 阅读全文
posted @ 2022-11-10 18:28 狂奔的蜗牛Snails 阅读(407) 评论(0) 推荐(0) 编辑
摘要: 适用场景:加载自己的某些配置 1.创建配置文件app/config/test.php 或者app/admin/test.php <?php return [ 'rule'=>[ 'alibaba'=>[], 'ebay'=>[], 'titok'=>[], 'amazon'=>[], ] ]; 2. 阅读全文
posted @ 2022-11-05 16:52 狂奔的蜗牛Snails 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 适用于: select * from table where 1=1 and cat_id in('','','') // 分类id $arr = [1,2,3]; $inData = implode(',',array_map(function ($str){ return sprintf("'% 阅读全文
posted @ 2022-06-16 11:30 狂奔的蜗牛Snails 阅读(1262) 评论(0) 推荐(0) 编辑
摘要: 步骤一:后台开启优化 步骤二:nginx配置伪静态 location / { try_files $uri @opencart; } location @opencart { rewrite ^/sitemap.xml$ /index.php?route=extension/feed/google_ 阅读全文
posted @ 2022-01-06 19:20 狂奔的蜗牛Snails 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 显示不出来的根本原因,图片地址国内网络阻止了 functions.php添加以下代码 // 头像-FQ问题 add_filter('get_avatar', function ($avatar) { return str_replace([ 'www.gravatar.com/avatar/', ' 阅读全文
posted @ 2021-11-26 17:30 狂奔的蜗牛Snails 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 来源:https://brushes8.com/97397.html 阅读全文
posted @ 2021-11-25 16:25 狂奔的蜗牛Snails 阅读(463) 评论(0) 推荐(0) 编辑
摘要: 场景: 访问地址:http://xxx.com/index.php?m=home&c=demo&a=test&keyword=3B9D082D,3B9D082A,3B9D0903,3B9D082C 把接收到参数(keyword),在sql查询中,使用in会自动加上引号 php应用代码: $param 阅读全文
posted @ 2021-07-27 19:21 狂奔的蜗牛Snails 阅读(405) 评论(0) 推荐(0) 编辑
摘要: 代码: // 在mysql5.6,运行正常,5.7报错SELECT sum((select a.num where a.status =1) ) as total FROM mes_order_product AS a LEFT JOIN mes_order AS b ON a.osn = b.os 阅读全文
posted @ 2021-07-26 19:43 狂奔的蜗牛Snails 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 场景:做APP项目,接口请求数据。前端发起的post请求,开发环境能收到post请求,到线上变成了get。导致app一直报错 php function test(){ print_r($_SERVER): } postman模拟 解决办法:线上环境安装了ssl证书,所以把请求改为https即可 出现 阅读全文
posted @ 2021-07-02 10:37 狂奔的蜗牛Snails 阅读(3612) 评论(0) 推荐(0) 编辑
摘要: 最终效果: css 样式 /*pages*/ .pages{ box-sizing:content-box; display: inline-block; border-top: 1px solid #e6e6e6; border-bottom: 1px solid #e6e6e6; border- 阅读全文
posted @ 2021-06-07 18:15 狂奔的蜗牛Snails 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 有三种方式:https://lbs.amap.com/faq/android/map-sdk/create-project/43112 使用 keytool(jdk自带工具)获取SHA1 1.安装jdk https://www.oracle.com/java/technologies/javase- 阅读全文
posted @ 2021-05-30 16:14 狂奔的蜗牛Snails 阅读(951) 评论(0) 推荐(0) 编辑
摘要: 帮助文档:http://www.c-lodop.com/LodopDemo.html lodop与clodop的区别:http://www.c-lodop.com/faq/pp21.html 1.先安装clodop程序。 程序名称:CLodop_Setup_for_Win32NT.exe 下载地址: 阅读全文
posted @ 2021-03-03 11:09 狂奔的蜗牛Snails 阅读(2348) 评论(0) 推荐(0) 编辑
摘要: js调用打印机功能,有弹窗 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="Access-Control-Allow-Origin" content="*"> <title>Title< 阅读全文
posted @ 2021-03-02 16:44 狂奔的蜗牛Snails 阅读(1882) 评论(0) 推荐(0) 编辑
摘要: 验证器类:Validate.php <?php namespace framework\library; class Validate { /** * 当前验证规则 * @var array */ protected $rule = []; /** * 验证提示信息 * @var array */ 阅读全文
posted @ 2021-01-27 17:53 狂奔的蜗牛Snails 阅读(399) 评论(0) 推荐(0) 编辑
摘要: 注意事项 1.规定验证器格式 $validate->rule($rule)->message($message)->check($data) 2.验证器思路:需要验证的字段,启用某条规则,验证字段的限定值,它的提示信息 3.返回的错误提示。返回全部错误,或者取一条返回 $data = [ 'name 阅读全文
posted @ 2021-01-27 17:51 狂奔的蜗牛Snails 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 链式操作的时候,有的方法没有提示。需要在注释里面加上 @return $this; 阅读全文
posted @ 2020-12-17 11:20 狂奔的蜗牛Snails 阅读(80) 评论(0) 推荐(0) 编辑
摘要: $idd = 35; $idArr = [0=>35,1=>39,2=>45,3=>47,4=>48,5=>80]; // 查询id,所在位置 $offset=array_search($id,$idArr); // 假设id位置 if($idArr[$offset]==reset($idArr)) 阅读全文
posted @ 2020-10-26 20:12 狂奔的蜗牛Snails 阅读(102) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2020-09-28 16:57 狂奔的蜗牛Snails 阅读(0) 评论(0) 推荐(0) 编辑
摘要: 中间件位置:app/Http/Middleware/ 加载中间件:bean 'httpDispatcher' => [ // Add global http middleware 'middlewares' => [ \App\Http\Middleware\FavIconMiddleware::c 阅读全文
posted @ 2020-09-03 11:09 狂奔的蜗牛Snails 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 手动档模式 手动模式需要xxx.com?db=1、xxx.com?db=2、xxx.com?db=3 这种方式来切换1、2、3数据库。操作权在用户手上。使用并不太方便。 手册地址:http://swoft.io/docs/2.x/zh-CN/db/selectDb.html 自动档模式:推荐使用 手 阅读全文
posted @ 2020-09-03 11:08 狂奔的蜗牛Snails 阅读(250) 评论(0) 推荐(0) 编辑
摘要: woft验证器,比thinkphp的验证器难搞很多。非注解式验证就很简单了 一:创建验证器 位置:app/Validator/TestValidator.php <?php declare(strict_types=1); /** * This file is part of Swoft. * * 阅读全文
posted @ 2020-09-03 11:05 狂奔的蜗牛Snails 阅读(287) 评论(0) 推荐(0) 编辑
摘要: swoft语言包的术语是:国际化 使用语言包好处: 统一存放"类型"数据 如 'sex'=>[0=>'未知',1=>'男','女'] // 文本中可用大括号注入参数 'sayhello' => 'Hey {name}!', 'saygoodbye' => 'Bye!', 'order_status' 阅读全文
posted @ 2020-09-03 11:04 狂奔的蜗牛Snails 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 要部署三个接口 v - 在不传递参数的情况下,默认访问接口,此接口也是最新接口,访问方式xx.com/v(api.xx.com) v100 - 版本v1.0接口 v200 - 版本2.0接口 .... 提前预留好接口位置,方便以后升级迭代工作 另一种接口模式是利用nginx进行转发 实际目录结构 其 阅读全文
posted @ 2020-09-03 11:03 狂奔的蜗牛Snails 阅读(302) 评论(0) 推荐(0) 编辑
摘要: Swoft-Api项目部署四:模型调用 阅读全文
posted @ 2020-09-03 11:01 狂奔的蜗牛Snails 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 注意事项:swoft使用模型获取数据前,一定要先生成实体模型。 简介 无论是高级查询还是基础查询,都会需要一个表实体。一个表字段和一个类属性是一一映射,对类的操作相当于对表的操作,该类称为一个实体 Swoft 2.x 和 1.x 实体使用简单的许多,兼有Builder查询构造器所有的方法,使用和查询 阅读全文
posted @ 2020-09-03 11:00 狂奔的蜗牛Snails 阅读(367) 评论(0) 推荐(0) 编辑
摘要: 正式开始项目前,一定要先加载自己的公共函数,方便使用(模型、控制器、中间件...)。 公共函数位置:app\Helper\Functions.php(swoft默认已经加载) if(!function_exists('lang')){ /* * 语言包助手函数 * */ function lang( 阅读全文
posted @ 2020-09-03 10:58 狂奔的蜗牛Snails 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 操作项目前,推荐要修改下http服务器默认端口 位置:app\bean.php 'httpServer' => [ 'class' => HttpServer::class, 'port' => 805, ] 阅读全文
posted @ 2020-09-03 10:57 狂奔的蜗牛Snails 阅读(321) 评论(0) 推荐(0) 编辑
摘要: 虽然redis实现了发布订阅(publish/subscribe)的功能,但是在通常的情况下是不推荐使用的,如果想使用消息队列这种功能,最好还是使用专业的各种MQ中间件,例如rabbitMQ,rockedMQ,activitedMQ等,本文主要讲一下不推荐使用redis的发布订阅功能的原因。 概要说 阅读全文
posted @ 2020-09-03 10:15 狂奔的蜗牛Snails 阅读(6094) 评论(0) 推荐(0) 编辑
摘要: 【Thinkphp6】 thinkphp到thinkphp6,从模块概念变成多应用概念 默认thinkphp6实用API开发,因为有些插件默认不加载,减少负载 【 总结如下】 记住标题,比内容更重要; MVC框架大多数都这个套路(模型、视图、控制器、中间件、公共函数、常用常量、语言包、验证器); 要 阅读全文
posted @ 2020-04-08 17:19 狂奔的蜗牛Snails 阅读(749) 评论(0) 推荐(0) 编辑
摘要: 控制器调用: public function test(){ // 查询状态为1的用户数据 并且每页显示10条数据 $list = Db::name('log')->order('id', 'desc')->paginate(10); // 获取分页显示 $page = $list->render( 阅读全文
posted @ 2020-04-08 17:18 狂奔的蜗牛Snails 阅读(452) 评论(0) 推荐(0) 编辑
摘要: 控制器代码: public function test(){ // 查询状态为1的用户数据 并且每页显示10条数据 $list = Db::name('log')->order('id', 'desc')->paginate(10); // 渲染模板输出 return view('', ['list 阅读全文
posted @ 2020-04-08 17:17 狂奔的蜗牛Snails 阅读(581) 评论(0) 推荐(0) 编辑
摘要: Thinkphp6手册,模板标签没有太多的介绍。因为Thinkphp的内置模板引擎一直都是ThinkTemplate thinkTemplate模板引擎地址[:https://www.kancloud.cn/manual/think-template/1286413 普通调用:{$home} 语言包 阅读全文
posted @ 2020-04-08 17:16 狂奔的蜗牛Snails 阅读(3123) 评论(0) 推荐(0) 编辑
摘要: CheckIp.php代码:文件位置app\middleware\CheckIp.php <?php namespace app\middleware; class CheckIp { // 状态 关闭:false,开启:true private $status = true; // ip库 pri 阅读全文
posted @ 2020-04-08 17:13 狂奔的蜗牛Snails 阅读(1090) 评论(0) 推荐(0) 编辑
摘要: 新版框架默认只能支持PHP原生模板,如果需要使用thinkTemplate模板引擎,需要安装think-view扩展(该扩展会自动安装think-template依赖库) TP6默认还是侧重于API接口开发,因为很多插件默认都不安装 composer require topthink/think-v 阅读全文
posted @ 2020-04-08 17:10 狂奔的蜗牛Snails 阅读(4372) 评论(0) 推荐(0) 编辑
摘要: cache配置,文件位置:config/cache.php <?php // + // | 缓存设置 // + return [ // 默认缓存驱动 'default' => env('cache.driver', 'file'), // 缓存连接方式配置 'stores' => [ 'file' 阅读全文
posted @ 2020-04-08 17:05 狂奔的蜗牛Snails 阅读(6923) 评论(0) 推荐(0) 编辑
摘要: 验证器代码,在上一页。这里直邮模型调用 <?php namespace app\admin\model; use app\admin\model\AdminBase; class User extends AdminBase{ public function ajaxSave($data,$scen 阅读全文
posted @ 2020-04-08 17:02 狂奔的蜗牛Snails 阅读(1184) 评论(0) 推荐(0) 编辑