收藏一个微信支付v2版的php开发Demo
开发文档
微信支付V2的开发文档:https://pay.weixin.qq.com/wiki/doc/api/index.html
微信支付V3的开发文档:https://pay.weixin.qq.com/wiki/doc/apiv3/index.shtml
各支付接口的PHP演示(官方)
点击下载:
WxpayAPI_php.zip
微信支付V2的开发文档:https://pay.weixin.qq.com/wiki/doc/api/index.html
微信支付V3的开发文档:https://pay.weixin.qq.com/wiki/doc/apiv3/index.shtml
点击下载:
WxpayAPI_php.zip
$agent = strtolower($_SERVER['HTTP_USER_AGENT']);
$iphone = (strpos($agent, 'iphone')) ? true : false;
$ipad = (strpos($agent, 'ipad')) ? true : false;
$android = (strpos($agent, 'android')) ? true : false;
if($iphone || $ipad || $android){
define('ISMOBILE',true);
} else {
define('ISMOBILE',false);
};
function isWeixin() {
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) {
return true;
} else {
return false;
}
}
<?php
header('Content-type:text/html; Charset=utf-8');
$mchid = '微信支付商户号';
$appid = '微信支付申请对应的公众号的APPID';
$appKey = '微信支付申请对应的公众号的APPSECRET';
$apiKey = 'API密钥'; //商户平台-帐户设置-安全设置-API安全-API密钥-设置API密钥
//①、获取用户openid
$wxPay = new WxpayService($mchid,$appid,$appKey,$apiKey);
$openId = $wxPay->GetOpenid(); //获取openid
if(!$openId) exit('获取openid失败');
//②、统一下单
$outTradeNo = uniqid(); //你自己的商品订单号
$payAmount = 0.01; //付款金额,单位:元
$orderName = 'test'; //订单标题
$notifyUrl = 'https://www.likeyunba.com/pay/notify.php'; //付款成功后的回调地址(不要有问号)
$payTime = time(); //付款时间
$jsApiParameters = $wxPay->createJsBizPackage($openId,$payAmount,$outTradeNo,$orderName,$notifyUrl,$payTime);
$jsApiParameters = json_encode($jsApiParameters);
?>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>微信支付样例-支付</title>
<script type="text/javascript">
//调用微信JS api 支付
function jsApiCall()
{
WeixinJSBridge.invoke(
'getBrandWCPayRequest',
<?php echo $jsApiParameters; ?>,
function(res){
WeixinJSBridge.log(res.err_msg);
//alert(res.err_code+res.err_desc+res.err_msg);
if(res.err_msg == "get_brand_wcpay_request:ok"){
//支付成功跳转页面
window.location.href="http://www.likeyunba.com/pay/true.html";
}else{
//支付失败/或取消支付跳转页面
window.location.href="http://www.likeyunba.com/pay/false.html";
}
}
);
}
function callpay()
{
if (typeof WeixinJSBridge == "undefined"){
if( document.addEventListener ){
document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
}else if (document.attachEvent){
document.attachEvent('WeixinJSBridgeReady', jsApiCall);
document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
}
}else{
jsApiCall();
}
}
</script>
</head>
<body>
<br/>
<font color="#9ACD32"><b>该笔订单支付金额为<span style="color:#f00;font-size:50px"><?php echo $payAmount?>元</span>钱</b></font><br/><br/>
<div align="center">
<button style="width:210px; height:50px; border-radius: 15px;background-color:#FE6714; border:0px #FE6714 solid; cursor: pointer; color:white; font-size:16px;" type="button" onclick="callpay()" >立即支付</button>
</div>
</body>
</html>
<?php
header("Content-Type:text/html; charset=utf-8");
class WxpayService
{
protected $mchid;
protected $appid;
protected $appKey;
protected $apiKey;
public $data = null;
public function __construct($mchid, $appid, $appKey,$key)
{
$this->mchid = $mchid; //https://pay.weixin.qq.com 产品中心-开发配置-商户号
$this->appid = $appid; //微信支付申请对应的公众号的APPID
$this->appKey = $appKey; //微信支付申请对应的公众号的APP Key
$this->apiKey = $key; //https://pay.weixin.qq.com 帐户设置-安全设置-API安全-API密钥-设置API密钥
}
/**
* 通过跳转获取用户的openid,跳转流程如下:
* 1、设置自己需要调回的url及其其他参数,跳转到微信服务器https://open.weixin.qq.com/connect/oauth2/authorize
* 2、微信服务处理完成之后会跳转回用户redirect_uri地址,此时会带上一些参数,如:code
* @return 用户的openid
*/
public function GetOpenid()
{
//通过code获得openid
if (!isset($_GET['code'])){
//触发微信返回code码
$scheme = $_SERVER['HTTPS']=='on' ? 'https://' : 'http://';
$baseUrl = urlencode($scheme.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].$_SERVER['QUERY_STRING']);
$url = $this->__CreateOauthUrlForCode($baseUrl);
Header("Location: $url");
exit();
} else {
//获取code码,以获取openid
$code = $_GET['code'];
$openid = $this->getOpenidFromMp($code);
return $openid;
}
}
/**
* 通过code从工作平台获取openid机器access_token
* @param string $code 微信跳转回来带上的code
* @return openid
*/
public function GetOpenidFromMp($code)
{
$url = $this->__CreateOauthUrlForOpenid($code);
$res = self::curlGet($url);
//取出openid
$data = json_decode($res,true);
$this->data = $data;
$openid = $data['openid'];
return $openid;
}
/**
* 构造获取open和access_toke的url地址
* @param string $code,微信跳转带回的code
* @return 请求的url
*/
private function __CreateOauthUrlForOpenid($code)
{
$urlObj["appid"] = $this->appid;
$urlObj["secret"] = $this->appKey;
$urlObj["code"] = $code;
$urlObj["grant_type"] = "authorization_code";
$bizString = $this->ToUrlParams($urlObj);
return "https://api.weixin.qq.com/sns/oauth2/access_token?".$bizString;
}
/**
* 构造获取code的url连接
* @param string $redirectUrl 微信服务器回跳的url,需要url编码
* @return 返回构造好的url
*/
private function __CreateOauthUrlForCode($redirectUrl)
{
$urlObj["appid"] = $this->appid;
$urlObj["redirect_uri"] = "$redirectUrl";
$urlObj["response_type"] = "code";
$urlObj["scope"] = "snsapi_base";
$urlObj["state"] = "STATE"."#wechat_redirect";
$bizString = $this->ToUrlParams($urlObj);
return "https://open.weixin.qq.com/connect/oauth2/authorize?".$bizString;
}
/**
* 拼接签名字符串
* @param array $urlObj
* @return 返回已经拼接好的字符串
*/
private function ToUrlParams($urlObj)
{
$buff = "";
foreach ($urlObj as $k => $v)
{
if($k != "sign") $buff .= $k . "=" . $v . "&";
}
$buff = trim($buff, "&");
return $buff;
}
/**
* 统一下单
* @param string $openid 调用【网页授权获取用户信息】接口获取到用户在该公众号下的Openid
* @param float $totalFee 收款总费用 单位元
* @param string $outTradeNo 唯一的订单号
* @param string $orderName 订单名称
* @param string $notifyUrl 支付结果通知url 不要有问号
* @param string $timestamp 支付时间
* @return string
*/
public function createJsBizPackage($openid, $totalFee, $outTradeNo, $orderName, $notifyUrl, $timestamp)
{
$config = array(
'mch_id' => $this->mchid,
'appid' => $this->appid,
'key' => $this->apiKey,
);
$orderName = iconv('GBK','UTF-8',$orderName);
$unified = array(
'appid' => $config['appid'],
'attach' => 'pay', //商家数据包,原样返回,如果填写中文,请注意转换为utf-8
'body' => $orderName,
'mch_id' => $config['mch_id'],
'nonce_str' => self::createNonceStr(),
'notify_url' => $notifyUrl,
'openid' => $openid, //rade_type=JSAPI,此参数必传
'out_trade_no' => $outTradeNo,
'spbill_create_ip' => '127.0.0.1',
'total_fee' => intval($totalFee * 100), //单位 转为分
'trade_type' => 'JSAPI',
);
$unified['sign'] = self::getSign($unified, $config['key']);
$responseXml = self::curlPost('https://api.mch.weixin.qq.com/pay/unifiedorder', self::arrayToXml($unified));
$unifiedOrder = simplexml_load_string($responseXml, 'SimpleXMLElement', LIBXML_NOCDATA);
if ($unifiedOrder === false) {
die('parse xml error');
}
if ($unifiedOrder->return_code != 'SUCCESS') {
die($unifiedOrder->return_msg);
}
if ($unifiedOrder->result_code != 'SUCCESS') {
die($unifiedOrder->err_code);
}
$arr = array(
"appId" => $config['appid'],
"timeStamp" => "$timestamp", //这里是字符串的时间戳,不是int,所以需加引号
"nonceStr" => self::createNonceStr(),
"package" => "prepay_id=" . $unifiedOrder->prepay_id,
"signType" => 'MD5',
);
$arr['paySign'] = self::getSign($arr, $config['key']);
return $arr;
}
public static function curlGet($url = '', $options = array())
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
if (!empty($options)) {
curl_setopt_array($ch, $options);
}
//https请求 不验证证书和host
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
public static function curlPost($url = '', $postData = '', $options = array())
{
if (is_array($postData)) {
$postData = http_build_query($postData);
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_TIMEOUT, 30); //设置cURL允许执行的最长秒数
if (!empty($options)) {
curl_setopt_array($ch, $options);
}
//https请求 不验证证书和host
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
public static function createNonceStr($length = 16)
{
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$str = '';
for ($i = 0; $i < $length; $i++) {
$str .= substr($chars, mt_rand(0, strlen($chars) - 1), 1);
}
return $str;
}
public static function arrayToXml($arr)
{
$xml = "<xml>";
foreach ($arr as $key => $val) {
if (is_numeric($val)) {
$xml .= "<" . $key . ">" . $val . "</" . $key . ">";
} else
$xml .= "<" . $key . "><![CDATA[" . $val . "]]></" . $key . ">";
}
$xml .= "</xml>";
return $xml;
}
public static function getSign($params, $key)
{
ksort($params, SORT_STRING);
$unSignParaString = self::formatQueryParaMap($params, false);
$signStr = strtoupper(md5($unSignParaString . "&key=" . $key));
return $signStr;
}
protected static function formatQueryParaMap($paraMap, $urlEncode = false)
{
$buff = "";
ksort($paraMap);
foreach ($paraMap as $k => $v) {
if (null != $v && "null" != $v) {
if ($urlEncode) {
$v = urlencode($v);
}
$buff .= $k . "=" . $v . "&";
}
}
$reqPar = '';
if (strlen($buff) > 0) {
$reqPar = substr($buff, 0, strlen($buff) - 1);
}
return $reqPar;
}
}
?>
<?php
/**
* 原生支付(扫码支付)及公众号支付的异步回调通知
* 说明:需要在native.php或者jsapi.php中的填写回调地址。例如:http://www.xxx.com/wx/notify.php
* 付款成功后,微信服务器会将付款结果通知到该页面
*/
header('Content-type:text/html; Charset=utf-8');
$mchid = '微信支付商户号';
$appid = '公众号APPID';
$apiKey = 'API密钥';
$wxPay = new WxpayService($mchid, $appid, $apiKey);
$result = $wxPay->notify();
if ($result) {
echo '成功了';
//完成你的逻辑
//例如连接数据库,获取付款金额$result['cash_fee'],获取订单号$result['out_trade_no'],修改数据库中的订单状态等;
} else {
echo 'pay error';
}
class WxpayService
{
protected $mchid;
protected $appid;
protected $apiKey;
public function __construct($mchid, $appid, $key)
{
$this->mchid = $mchid;
$this->appid = $appid;
$this->apiKey = $key;
}
public function notify()
{
$config = array(
'mch_id' => $this->mchid,
'appid' => $this->appid,
'key' => $this->apiKey,
);
$postStr = $GLOBALS["HTTP_RAW_POST_DATA"];
$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);
if ($postObj === false) {
die('parse xml error');
}
if ($postObj->return_code != 'SUCCESS') {
die($postObj->return_msg);
}
if ($postObj->result_code != 'SUCCESS') {
die($postObj->err_code);
}
$arr = (array)$postObj;
unset($arr['sign']);
if (self::getSign($arr, $config['key']) == $postObj->sign) {
echo '<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>';
return $arr;
}
}
/**
* 获取签名
*/
public static function getSign($params, $key)
{
ksort($params, SORT_STRING);
$unSignParaString = self::formatQueryParaMap($params, false);
$signStr = strtoupper(md5($unSignParaString . "&key=" . $key));
return $signStr;
}
protected static function formatQueryParaMap($paraMap, $urlEncode = false)
{
$buff = "";
ksort($paraMap);
foreach ($paraMap as $k => $v) {
if (null != $v && "null" != $v) {
if ($urlEncode) {
$v = urlencode($v);
}
$buff .= $k . "=" . $v . "&";
}
}
$reqPar = '';
if (strlen($buff) > 0) {
$reqPar = substr($buff, 0, strlen($buff) - 1);
}
return $reqPar;
}
}
本文转自互联网,具体网址不记得了。向原作者致敬!
不多说,上完整代码!
<!DOCTYPE html>
<html lang="zh-CN">
<head>
//这里是应有的css文件引用
<?php require "app/admin/view/layout/header.html" ?>
</head>
<body>
<div class="layui-card-body text-center" style="box-sizing: border-box;">
<div id="qrcode" class="layui-inline"></div>
<h2 style="color: red;padding-top:20px">请使用微信扫码支付</h2>
</div>
//这里是应有的js文件引用
<?php require "app/admin/view/layout/footer.html" ?>
<script>
layui.use(['form', 'QRCode'], function () {
var $ = layui.jquery;
var form = layui.form;
var QRCode = layui.QRCode;
new QRCode(document.getElementById("qrcode"), {
text: '二维码的短地址',
width: 250,
height: 250,
colorDark: '#000000',
colorLight: '#ffffff',
correctLevel: QRCode.CorrectLevel.H,
});
//1.支付轮询
$(document).ready(function () {
setInterval(function () {
//1.先得到当前iframe层的索引 关闭窗口
var index = parent.layer.getFrameIndex(window.name);
$.post("后台url",
{out_trade_no: "订单号"},
function (res) {
if (res.code === 200) {
layer.msg(res.msg, {icon: 1, time: 2500, shade: 0.4}, function () {
parent.layer.close(index); //2.再执行关闭自身
parent.location.reload();
});
}
}, 'json');
return false;
}, 3000);
});
});
</script>
</body>
</html>
说实话,到放弃为止,我还是没有找到这个商户公钥
到底在哪里得到。
我下面收集了一个热心网友给我的回复,但我也没有测试
,贴出来给大家参考:
# 必填-商户号,服务商模式下为服务商商户号
mch_id='1111111111',
# 必填-商户秘钥 V3 版本生成的 32 位秘钥
mch_secret_key=""
# 商户私钥 字符串或路径 (商户私钥,就是V2的私钥,路径也可以)
mch_secret_cert="apiclient_cert.key"
# 必填-商户公钥证书路径 (商户公钥,就是V2的私钥,路径也可以)
mch_public_cert_path="apiclient_key.pem"
// 就是之前的 那两个 对应一下就行啦
// 没有什么太复杂的 很简单
// 这个证书 要去 https://pay.weixin.qq.com/wiki/doc/apiv3/wechatpay/wechatpay6_0.shtml 下载证书文件生成
// 生成的就是 apiclient_cert + apiclient_key文件
========================== 更新(暂未测试) ==========================
1、官方文档:https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=24_7
2、命令行工具:https://github.com/EasyWechat/console
$ ./vendor/bin/easywechat payment:rsa_public_key \
--mch_id=14339221228 \
--api_key=36YTbDmLgyQ52noqdxgwGiYy \
--cert_path=/Users/overtrue/www/demo/apiclient_cert.pem \
--key_path=/Users/overtrue/www/demo/apiclient_key.pem
# Public key of mch_id:14339221228 saved as ./public-14339221228.pem
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Workerman\Worker;
use Workerman\Connection\AsyncTcpConnection;
$worker = new Worker('tcp://0.0.0.0:80');
$worker->onConnect = function ($con) {
$rcon = new AsyncTcpConnection('tcp://内网ip:80');
$rcon->pipe($con);
$con->pipe($rcon);
$rcon->connect();
};
$worker = new Worker('tcp://0.0.0.0:443');
$worker->count = 8;
$worker->onConnect = function ($con) {
$rcon = new AsyncTcpConnection('tcp://内网ip:443');
$rcon->pipe($con);
$con->pipe($rcon);
$rcon->connect();
};
Worker::runAll();
比方说一个试卷,总共 60 题,每道题都由难度、章节、类型 3 个属性
按照难度 简单 20 题 一般 30 题 困难 10 题
按照章节 章节一 10 题 章节二 15 题 章节 3 20 题,章节四 15 题
按照类型 文字题 20 题 图片题 20 题 视频题 20 题
每种维度题目数量是可以自行设置的,保证总题量等于 60 就行
不是每个最细分类(我这里称 sku 把)都有题目或者说有足量的题目,这种情况要考虑到
然后随机从数据库中取出这些题,有没有比较好的算法?
$tmp = [];
for ($i=1;$i<=60;$i++){
if($i <= 20) $item = ['简单'];
if($i <= 50 && $i>20) $item = ['一般'];
if($i <= 60 && $i>50) $item = ['困难'];
$tmp[] = $item;
}
shuffle($tmp);
foreach ($tmp as $key => &$value){
if($key < 10) array_push($value,'章节一');
if($key < 25 && $key>=10) array_push($value,'章节二');
if($key < 45 && $key>=25) array_push($value,'章节三');
if($key < 60 && $key>=45) array_push($value,'章节四');
}
shuffle($tmp);
foreach ($tmp as $key => &$value){
if($key < 20) array_push($value,'文字题');
if($key < 40 && $key>=20) array_push($value,'图片题');
if($key < 60 && $key>=40) array_push($value,'视频题');
}
$qa = [];
foreach ($tmp as $v){
$index = implode('-',$v);
$qa[$index] = isset($qa[$index]) ? $qa[$index] + 1 : 1;
}
dd($qa);
效果
$origin = [
'level' => [
['text' => '简单', 'total' => 20],
['text' => '一般', 'total' => 30],
['text' => '困难', 'total' => 10]
]
];
$data = [];
for ($index = 0; $index < 60; $index++) {
$item = [];
foreach ($origin as $type => $values) {
$total = array_sum(array_column($values, 'total'));
$random = rand(1, $total);
foreach ($values as $key => $value) {
if ($random <= $value['total']) {
$item[$type] = $value['text'];
$origin[$type][$key]['total']--;
break;
} else {
$random -= $value['total'];
}
}
}
$data[] = $item;
}
composer require aliyuncs/oss-sdk-php
use OSS\Core\OssException;
use OSS\OssClient;
use OSS\Core\OssUtil;
// 接收文件数据
$file = request()->file('img');
// 取出文件名截取后缀
$name = $file->getOriginalName();
$suffix = strchr($name,'.');
// 阿里云配置
$accessKeyId = "LTAI5t88SfZ5yhH4Sgu1u3gt";
$accessKeySecret = "vbLBZWvzazGZvJpPap20ZyKDoBbdq2";
// Endpoint以杭州为例,其它Region请按实际情况填写。
$endpoint = "oss-cn-shanghai.aliyuncs.com";
// 设置存储空间名称。
$bucket= "*";
// 设置文件名称。
//这里是由sha1加密生成文件名 之后连接上文件后缀
$object = sha1(date('YmdHis', time()) . uniqid()) . $suffix;
$url = 'http://test.caotengfei.xyz/'.$object;
// <yourLocalFile>由本地文件路径加文件名包括后缀组成,例如/users/local/myfile.txt。
$filePath = $file->getPathname();
$options = array(
OssClient::OSS_CHECK_MD5 => true,
OssClient::OSS_PART_SIZE => 1,
);
try{
$ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint);
//返回uploadId。uploadId是分片上传事件的唯一标识,您可以根据uploadId发起相关的操作,如取消分片上传、查询分片上传等。
$uploadId = $ossClient->initiateMultipartUpload($bucket, $object);
} catch(OssException $e) {
printf(__FUNCTION__ . ": initiateMultipartUpload FAILED\n");
printf($e->getMessage() . "\n");
return ;
}
print(__FUNCTION__ . ": initiateMultipartUpload OK" . "\n");
$partSize = 10 * 1024 * 1024;
$uploadFileSize = filesize($filePath);
$pieces = $ossClient->generateMultiuploadParts($uploadFileSize, $partSize);
$responseUploadPart = array();
$uploadPosition = 0;
$isCheckMd5 = true;
foreach ($pieces as $i => $piece) {
$fromPos = $uploadPosition + (integer)$piece[$ossClient::OSS_SEEK_TO];
$toPos = (integer)$piece[$ossClient::OSS_LENGTH] + $fromPos - 1;
$upOptions = array(
// 上传文件。
$ossClient::OSS_FILE_UPLOAD => $filePath,
// 设置分片号。
$ossClient::OSS_PART_NUM => ($i + 1),
// 指定分片上传起始位置。
$ossClient::OSS_SEEK_TO => $fromPos,
// 指定文件长度。
$ossClient::OSS_LENGTH => $toPos - $fromPos + 1,
// 是否开启MD5校验,true为开启。
$ossClient::OSS_CHECK_MD5 => $isCheckMd5,
);
// 开启MD5校验。
if ($isCheckMd5) {
$contentMd5 = OssUtil::getMd5SumForFile($filePath, $fromPos, $toPos);
$upOptions[$ossClient::OSS_CONTENT_MD5] = $contentMd5;
}
try {
// 上传分片。
$responseUploadPart[] = $ossClient->uploadPart($bucket, $object, $uploadId, $upOptions);
} catch(OssException $e) {
printf(__FUNCTION__ . ": initiateMultipartUpload, uploadPart - part#{$i} FAILED\n");
printf($e->getMessage() . "\n");
return;
}
printf(__FUNCTION__ . ": initiateMultipartUpload, uploadPart - part#{$i} OK\n");
}
// $uploadParts是由每个分片的ETag和分片号(PartNumber)组成的数组。
$uploadParts = array();
foreach ($responseUploadPart as $i => $eTag) {
$uploadParts[] = array(
'PartNumber' => ($i + 1),
'ETag' => $eTag,
);
}
try {
// 执行completeMultipartUpload操作时,需要提供所有有效的$uploadParts。OSS收到提交的$uploadParts后,会逐一验证每个分片的有效性。当所有的数据分片验证通过后,OSS将把这些分片组合成一个完整的文件。
$ossClient->completeMultipartUpload($bucket, $object, $uploadId, $uploadParts);
} catch(OssException $e) {
printf(__FUNCTION__ . ": completeMultipartUpload FAILED\n");
printf($e->getMessage() . "\n");
return;
}
return json(['code'=>200,'msg'=>'成功','url'=>$url]);
tenancy/tenancy
stancl/tenancy
gecche/laravel-multidomain
romegadigital/multitenancy