摘要: 策略模式 策略模式是对象的行为模式,用意是对一组算法的封装。动态的选择需要的算法并使用。 策略模式指的是程序中涉及决策控制的一种模式。策略模式功能非常强大,因为这个设计模式本身的核心思想就是面向对象编程的多形性思想。 策略模式的三个角色: 1.抽象策略角色 2.具体策略角色 3.环境角色(对抽象策略 阅读全文
posted @ 2019-09-16 09:31 FcLwYf 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 1、通过条件查询出上一条与下一条 sql说明:本表关联本表,然后通过其中一个表,查询出对应的条件,再用另外一个表求出上一条与下一条的数据,求出来的数据是多条的 SELECT ua.id, ua.wx_pages, ua.wx_pages_source, uaa.id as uaa_id, uaa.w 阅读全文
posted @ 2019-09-05 11:27 FcLwYf 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 1、SINTER 说明:多key之间取交集数据 key1 = {a,b,c,d} key2 = {c} key3 = {a,c,e} SINTER key1 key2 key3 = {c} 2、sadd 说明:添加队列数据 3、SUNION 说明:多key之间取并集数据 4、取出lRange多少,按 阅读全文
posted @ 2019-09-05 11:23 FcLwYf 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 1、多个字段多重排序 function sortArrByManyField(){ $args = func_get_args(); // 获取函数的参数的数组 if(empty($args)){ return null; } $arr = array_shift($args); if(!is_ar 阅读全文
posted @ 2019-09-05 11:19 FcLwYf 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 1、当我们要统计数据表数量时,如果遇到多表查询,会出现一个主表对应多个子表的维度,我们会用到group by,但是不要再用统计函数去操作数据,因为统计还是会统计原数据 案例 SELECT sum(`order`.goods_amount) AS total_goods_amount, sum(`or 阅读全文
posted @ 2019-07-15 09:27 FcLwYf 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 1、array_slice 作用:数组分页函数 案例:$output = array_slice ( $input , - 2 , 1 ); 2、array_column 作用:数组根据值取出一段数据 案例:array_column ( $records , 'first_name' ); 3、拼接 阅读全文
posted @ 2019-07-15 09:22 FcLwYf 阅读(148) 评论(0) 推荐(0) 编辑
摘要: ThinkPHP5实现定时任务 最近使用ThinkPHP5做了个项目,项目中需要定时任务的功能,感觉有必要分享下 TP5做定时任务使用到command.php的 步骤如下: 1.配置command.php文件,位于application/command.php <?php namespace app 阅读全文
posted @ 2019-07-12 10:42 FcLwYf 阅读(2558) 评论(0) 推荐(0) 编辑
摘要: 有关网址: MySQL 性能优化神器 Explain 使用分析 MySQL - EXPLAIN详解 1、时间比较 mysql> SELECT something FROM table WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) <= 30; 2、时间戳比较 se 阅读全文
posted @ 2019-07-12 10:39 FcLwYf 阅读(198) 评论(0) 推荐(0) 编辑
摘要: laravel基础操作手册 1、路由配置 测试配置路由: Route::get('/test', 'TestController@index'); 2、控制器书写 3、模型文件 4、增加扩展类文件 Laravel 版本:5.5 有很多第三方的类库并没有制作 Composer,而是还以 require 阅读全文
posted @ 2019-07-12 10:37 FcLwYf 阅读(862) 评论(0) 推荐(0) 编辑
摘要: 1、window下python简单使用 (1)、使用工具网址 https://jingyan.baidu.com/article/9f7e7ec0ec2e676f2915545f.html (2)、各种测试案例 循环案例 n = 100 nn = 1; while nn<=100: print('你 阅读全文
posted @ 2019-07-12 10:34 FcLwYf 阅读(211) 评论(0) 推荐(0) 编辑