GuPay 支付宝免签收款平台

简介

GuPay是Gu-Studio推出的一款基于收款码的支付宝免签收款平台系统。

特性

  1. 高效性能,基于Laravel55开发
  2. 自适应CSS框架
  3. 精简API
  4. 分布式,易于部署
  5. 自带微信消息推送

站点图片

源码呢?

此次的项目为商用项目,所以恕我不能像往常那样子公布源码和仓库啦,抱歉owo

[油猴脚本]Typeshower-动态显示按下的按键

描述:

一个基于油猴插件的按键显示的插件,主要可以用于教学演示

安装:

  1. 安装油猴插件,地址https://tampermonkey.net/
  2. 添加插件
  3. 运行插件

效果展示:

Greasy Fork地址:

https://greasyfork.org/zh-CN/scripts/375905-typeshower

脚本代码:

// ==UserScript==
// @name         TypeShower
// @namespace    https://103.249.111.182/
// @version      1.0
// @description  动态显示输入
// @author       7gugu <gz7gugu@qq.com>
// @match        https://tampermonkey.net/documentation.php?version=4.8.5847&ext=fire&updated=true
// @grant        none
// @include *
// @require https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js
// ==/UserScript==

(function() {
    'use strict';
var id=1;
var key_array=new Array(200);
key_array[65]='a';
key_array[66]='b';
key_array[67]='c';
key_array[68]='d';
key_array[69]='e';
key_array[70]='f';
key_array[71]='g';
key_array[72]='h';
key_array[73]='i';
key_array[74]='j';
key_array[75]='k';
key_array[76]='l';
key_array[77]='m';
key_array[78]='n';
key_array[79]='o';
key_array[80]='p';
key_array[81]='q';
key_array[82]='r';
key_array[83]='s';
key_array[84]='t';
key_array[85]='u';
key_array[86]='v';
key_array[87]='w';
key_array[88]='x';
key_array[89]='y';
key_array[90]='z';
key_array[112]='F1';
key_array[113]='F2';
key_array[114]='F3';
key_array[115]='F4';
key_array[116]='F5';
key_array[117]='F6';
key_array[118]='F7';
key_array[119]='F8';
key_array[120]='F9';
key_array[121]='F10';
key_array[122]='F11';
key_array[123]='F12';
key_array[136]='Num_Lock';
key_array[137]='Scorll_Lock';
key_array[8]='BackSpace';
key_array[9]='Tab';
key_array[32]='Space';
key_array[13]='Enter';
key_array[16]='Shift';
key_array[17]='Ctrl';
key_array[18]='Alt';
key_array[20]='Caps';
key_array[27]='Esc';
key_array[37]='←';
key_array[38]='↑';
key_array[39]='→';
key_array[40]='↓';
key_array[45]='Ins';
key_array[46]='Del';
key_array[48]='0';
key_array[49]='1';
key_array[50]='2';
key_array[51]='3';
key_array[52]='4';
key_array[53]='5';
key_array[54]='6';
key_array[55]='7';
key_array[56]='8';
key_array[57]='9';
key_array[192]='`';
key_array[173]='-';
key_array[61]='+';
key_array[219]='[';
key_array[221]=']';
key_array[220]='\\';
key_array[59]=';';
key_array[222]='\'';
key_array[188]=',';
key_array[190]='.';
key_array[191]='/';
var key_shift=0;
var key_ctrl=0;
console.log("Typeshower已启用");
$("body").append("
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-wp-preserve="%3Cstyle%20type%3D'text%2Fcss'%3Etype%7Bpadding%3A%205px%2010px%3Bfont-size%3A%2087.5%25%3Bcolor%3A%20%23fff%3Bbackground-color%3A%20%23212529%3Bborder-radius%3A%205px%3Bfont-family%3ASFMono-Regular%2CMenlo%2CMonaco%2CConsolas%2C'Liberation%20Mono'%2C'Courier%20New'%2Cmonospace%3Bline-height%3A%201.5%3B%7D.key_list%7Bpadding%3A10px%3Bposition%3Afixed%3Bright%3A20px%3Btop%3A20px%3Bwidth%3A60px%3Bheight%3A50px%3Bz-index%3A999%3B%7D%3C%2Fstyle%3E" data-mce-resize="false" data-mce-placeholder="1" class="mce-object" width="20" height="20" alt="<style>" title="<style>" />

");
$("body").append("
<div class='key_list'></div>

");
    document.onkeydown=function(event){
            id++;
        console.log("Typeshower 监听中");
			var key_template="";
            var e = event || window.event ;
            if(e && e.keyCode){
			if(key_shift==1){key_template="Shift+";}
			if(key_ctrl==1){key_template="Ctrl+";}
				key_template=key_template+key_array[e.keyCode];
				$("div.key_list").append("<type id='"+id+"'>"+key_template+"</type>

");
              if(e.keyCode==16){key_shift=1;}
			if(e.keyCode==17){key_ctrl=1;}
			  }

				$("type[id='"+id+"']").fadeOut(2500);
				$("br").fadeOut(2500);

        }
		document.onkeyup=function(event){
			var e = event || window.event ;
            if(e && e.keyCode){
			if(e.keyCode==16){key_shift=0;}
			if(e.keyCode==17){key_ctrl=0;}
			}
		}
})();

[笔记][Laravel]数据库操作

准备

新建App\Http\Controller\StudentController.php

<?php
namespace App\Http\Controller;
use Illuminate\Support\Facades\DB;//使用DB类

class StudentController extends Controller{
//创建名为StudentController的控制器并继承Controller基类
public function query(){
//php
}
}

切换至routes\web.php新建一个路由

[php]
Route::any(‘query’,’StudentController@query’);
[/php]

创建


连接数据库

配置.env文件

[php]
DB_CONNECTION=mysql[数据库的连接模式]
DB_HOST=数据库的IP地址
DB_PORT=数据库端口
DB_DATABASE=数据库库名
DB_USERNAME=数据库用户名
DB_PASSWORD=数据库密码
[/php]

配置config/database.php

[php]
‘mysql’ => [
‘driver’ => ‘mysql’, //数据库的类型
‘host’ => env(‘DB_HOST’, ‘localhost’), //数据库的位置
‘port’ => env(‘DB_PORT’, ‘3306’), //端口号
‘database’ => env(‘DB_DATABASE’, ”), //数据库名
‘username’ => env(‘DB_USERNAME’, ”), //用户名
‘password’ => env(‘DB_PASSWORD’, ”), //密码
‘charset’ => ‘utf8’, //字符集
‘collation’ => ‘utf8_unicode_ci’, //排序方式
‘prefix’ => ”, //前缀
‘strict’ => true, //Strict模式
‘engine’ => null, //引擎
],
[/php]

至此laravel即可连接上数据库了


使用DB facades完成数据库操作

SQL语句中的?是占位符,可以通过第二变量传入数组来传递数值

查询数据

[php]
DB::select(“select * from student”);//可以直接使用select语句
DB::select(“select * from student where age = ? and name = ?”,[18,’7gugu’])//等同于:select * from student where age = 18 and name = ‘7gugu’
[/php]

插入数据

[php]
DB::insert(“insert into student(name,age,sex) values(‘hzq’,’19’,’0′)”);//可以直接使用insert语句
DB::insert(“insert into student(name,age,sex) values(?,?,?)”,[‘hzq’,’19’,’0′]);//等同于:insert into student(name,age,sex) values(‘hzq’,’19’,’0′),这样子方便传值
[/php]

更新数据

[php]
DB::update(“update student set age = 1 where name =7gugu”);//可以直接使用update语句
DB::update(“update student set age = ? where name =?”,[1,’7gugu’])//等同于:update student set age = 1 where name =’7gugu’
[/php]

删除数据

[php]
DB::delete(‘delete from student where id=1002’);//直接使用delete语句
DB::delete(‘delete from student where id=?’,[‘1002’]);//等同于:delete from student where id=1002
[/php]


使用查询构造器

数据表指向器

[php]
DB::table(“数据表名”)->操作/筛选器;
DB::table(‘student’)->操作/筛选器;
[/php]

筛选器

[php]
DB::table(‘student’)->where()->操作;
where(‘id’,1001)//即可筛选id是1001的数据
where(‘id’,’=’,1001)//即可筛选id是1001的数据
where(‘id = ? and name = ?’,[1001,’7gugu’])//即可限定多个条件
[/php]

排序

[php]
/*
* @param string 字段名称
* @param string 排序方式(ASC:正序|DESC:倒序)
*/
DB::table(‘student’)->orderBy(‘字段名’,’asc|desc’)->操作;
[/php]

字段值自增

[php]
/*
* 数值自增
* @param string 字段名称
* @param int 单次自增数量
*/
DB::table(‘student’)->where(‘id’,’1001′)->increment(‘age’,1);
[/php]

字段值自减

[php]
/*
* 数值自减
* @param string 字段名称
* @param int 单次自减数量
*/
DB::table(‘student’)->where(‘id’,’1001′)->decrement(‘age’,1);
[/php]

插入数据

[php]
DB::table(‘student’)->insert([‘name’=>’7gugu’,’age’=>’18’]);//插入一条数据
DB::table(‘student’)->insert([
[‘name’=>’test’,’age’=>’20’],
[‘name’=>’guangzhou’,’age’=>’30’]
]);//使用一个数组来承载多条数据,即可插入多条数据
[/php]

更新数据

[php]
DB::table(‘student’)->where(‘id’,1004)->update([‘age’=>30]);//使用update函数即可更新指定字段的值
//laravel好像并不可以一次性更新多个字段
[/php]

删除数据

[php]
DB::table(‘student’)->where(‘id’,’1002′)->delete();
[/php]

get函数

[php]
/*
*用于获取限定条件后的数据,可以无限定条件直接获取
*/
DB::table(‘student’)->get();
[/php]

first函数

[php]
/*
* 用于获取符合限定条件的第一行的数据
* 无需传参
*/
DB::table(‘student’)->first();
[/php]

pluck函数

[php]
/*
* 获取指定名称的字段数据
*/
DB::table(‘student’)->pluck(‘name’,’age’);
[/php]

效果如图所示:

聚合函数

[php]
//count()统计表的数据总数
DB::table(‘student’)->count();
//max()比较某个字段的最大值
DB::table(‘student’)->max(‘age’);
//min()比较某个字段的最小值
DB::table(‘student’)->min(‘age’);
//avg()计算某个字段的平均值
DB::table(‘student’)->avg(‘age’);
//sum()计算某一个字段的所有数值
DB::table(‘student’)->avg(‘age’);
[/php]

truncate函数

清空表中数据[危险]

[php]
//truncate()清空表中数据[危险]
DB::table(‘student’)->truncate();
[/php]

chunk函数

用于分块查找数据(用于大量数据查找时使用)

[php]
DB::table(‘users’)->chunk(2, function($users)
{
dd($users);//每次运行仅仅查询两条数据,直至查询完毕
});
[/php]

结果如图所示: