Skip to content

Instantly share code, notes, and snippets.

View GithubMrxia's full-sized avatar

Mrxia GithubMrxia

View GitHub Profile
<?php
namespace App\Libs;
use Illuminate\Support\Facades\Redis;
class RedisLib
{
/**
* 加锁
$(function () {
// ajax 全局设置
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content'),
// 'Content-type': 'multipart/form-data',
// "Content-type": "multipart/form-data; charset=utf-8; boundary=" + Math.random().toString().substr(2)),
},
beforeSend: function () {
$('[type="submit"]').attr('disabled', true);
@GithubMrxia
GithubMrxia / excel.php
Last active February 28, 2020 10:34
php操作excel
<?php
$spreadsheet = @IOFactory::load(storage_path('app/public/template/开票申请单模板.xls'));
$spreadsheet->setActiveSheetIndex(0);
$worksheet = $spreadsheet->getActiveSheet();
$worksheet->getCell('C2')->setValue(date('Y'));
$worksheet->getCell('C2')->setValue(date('Y'));
$worksheet->getCell('E2')->setValue(date('m'));
$worksheet->getCell('G2')->setValue(date('d'));
@GithubMrxia
GithubMrxia / SmsVerificationCode.php
Last active April 23, 2020 08:21
短信验证码
<?php
namespace App\Libs\Sms;
use App\Libs\Sms\Sms;
use App\Libs\RedisLib;
class SmsVerificationCode
{
protected $seedLimit = 60;