mzeros b8c34de8c8 refactor(merchant): 优化账户数据处理和订单逻辑
- 添加 endsWithDoubleZero 函数,用于处理数值字符串末尾的两个零
- 修改 Core.php 中的 queue 方法,增加对卡库提单的特殊处理逻辑
-调整 Feedov.php 中的订单查询和充值逻辑,提高系统稳定性
- 优化数据库配置,连接测试数据库以确保数据安全
2025-02-15 19:00:17 +08:00

73 lines
1.6 KiB
PHP

<?php
use think\exception\HttpResponseException;
$version = request()->post('version');
//var_dump($version);die;
if(!$version){
$version = request()->param('version');
}
app()->http->name('gateway'); #应用
//#设置指定应用的命名空间
app()->setNamespace('app\gateway'); #应用的命名空间
//默认跳转到v1版本
if ($version == null) $version = "api";#api.notify,url
if (str_contains($version, '.')) {
$version = explode('.', $version);
if($version[1] == '0'){
$version = $version[0];
}else{
$version = $version[0].'_'.$version[1];
}
}
$pathInfo = request()->pathinfo();
if ($pathInfo == null) {
$json = [
'code' => -802,
'data'=>'',
'msg' =>'请求错误'
];
throw new HttpResponseException(json($json));
}
if($version!='api'){
if(!str_contains($pathInfo, 'api.')){
if(str_contains($version, '.')){
$versions = str_replace(".", "", $version);
#支持小版本的更新
app()->route->any('call','/gateway/'.$versions.'.notify/call');
app()->route->any('kuaijiaofei','/gateway/'.$versions.'.notify/kuaijiaofei');
}else{
app()->route->any('call','/gateway/'.$version.'.notify/call');
app()->route->any('kuaijiaofei','/gateway/'.$version.'.notify/kuaijiaofei');
}
}
}else{
if(!str_contains($pathInfo, 'api.')){
// app()->route->any('call','/gateway/'.$version.'.notify/call');
app()->route->any('call','/gateway/api.notify/call');
app()->route->any('kuaijiaofei','/gateway/api.notify/kuaijiaofei');
}
}