gorm去重查询 iris框架

摘要: 写练习 demo 时遇到需要进行去重查询,gorm没有db.distinct()的写法 // 数据库的表字段 type Pro_location_relation struct { Id int64 Provicename string Cityname string Areaname string 阅读全文
posted @ 2020-09-10 16:13 EchoBao 阅读(4504) 评论(0) 推荐(0)

php防sql注入

摘要: 原始没有防sql注入操作: public function sql_export(Request $request){ $username = $request -> get("username"); $password = $request -> get("password"); $data = 阅读全文
posted @ 2020-07-21 16:37 EchoBao 阅读(277) 评论(0) 推荐(0)

nginx配置根据url的参数值进行转发

摘要: server { listen 8081; location / { set $tag ""; set $cs "/index/test/test"; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Host $http_ 阅读全文
posted @ 2020-07-01 15:19 EchoBao 阅读(11523) 评论(0) 推荐(0)

使用phpexcel导出excel和phpword导出word--简单使用

摘要: <?php namespace app\index\controller; //离线环境不能使用composer安装,只能下载包文件,然后放在vendor下,代码中require使用 require_once VENDOR_PATH.'/PHPExcel/PHPExcel.php'; use app 阅读全文
posted @ 2020-06-10 14:51 EchoBao 阅读(785) 评论(0) 推荐(0)

tp5上传图片常规

摘要: 前端不多说,就是使用input标签的file格式。 tp5用request()->file(‘input的名字’)接收图片,是binary格式的数据; $file = request()->file('file'); $info = $file->move('存放的路径');这一步有坑,php.in 阅读全文
posted @ 2020-04-27 20:23 EchoBao 阅读(714) 评论(0) 推荐(0)

goland使用go mod模式

摘要: 使用go mod之后,想要在goland中有代码提示,有两种方式,一种是使用gopath下的goimport工具,另一种是使用gomod自身的管理工具 我是用的是非gopath的方式,每次新建项目后总是报错 go list -m: can't compute 'all' using the vend 阅读全文
posted @ 2020-04-25 17:23 EchoBao 阅读(12325) 评论(0) 推荐(1)

猴子当大王算法 约瑟夫环

摘要: 线性算法 阅读全文
posted @ 2019-10-23 16:07 EchoBao 阅读(169) 评论(0) 推荐(0)

选择和快速排序

摘要: //选择排序 public function index(){ $arr = array(10,5,245,23,543,67,45,37,86,235,25,15); for($i = 0;$i < count($arr) - 1;$i++){ $minindex = $i; for($j = $ 阅读全文
posted @ 2018-09-11 11:07 EchoBao 阅读(108) 评论(0) 推荐(0)

php的冒泡算法

摘要: <?php$arr = array(5,21,5,7,8,3,435,745,234,23,45,67,8767,789,98,8,9);echo 'before: ';var_dump($arr);echo 'after: ';var_dump(maopao($arr));function mao 阅读全文
posted @ 2018-05-03 11:43 EchoBao 阅读(321) 评论(0) 推荐(0)

unbuntu下mysql安装

摘要: 在ubuntu下又重新装了一遍mysql,结果在配置的时候按照redhat系统配置的,随后配置到添加到系统服务时没有chkconfig命令,然后就学了sysv-rc-conf命令代替,采用安装包安装软件更能了解每个步骤,通过apt-get命令简单,但是貌似容易出错. 阅读全文
posted @ 2018-03-21 16:38 EchoBao 阅读(98) 评论(0) 推荐(0)