mirror of
https://gitee.com/technical-laohu/mpay.git
synced 2025-09-17 09:16:40 +08:00
Compare commits
2 Commits
748356cc6b
...
e524424628
Author | SHA1 | Date | |
---|---|---|---|
|
e524424628 | ||
|
a6b5133cc3 |
11
.env
11
.env
@ -1,11 +0,0 @@
|
||||
APP_DEBUG = false
|
||||
|
||||
DB_TYPE = mysql
|
||||
DB_HOST = 127.0.0.1
|
||||
DB_NAME = mpay
|
||||
DB_USER = mpay
|
||||
DB_PASS = 123456
|
||||
DB_PORT = 3306
|
||||
DB_PREFIX = mpay_
|
||||
|
||||
DEFAULT_LANG = zh-cn
|
8
.gitignore
vendored
8
.gitignore
vendored
@ -2,14 +2,12 @@
|
||||
*.env
|
||||
|
||||
extend/*
|
||||
!extend/ImgCaptcha.php
|
||||
!extend/payclient.zip
|
||||
!extend/Plugin.php
|
||||
|
||||
vendor/*
|
||||
!vendor/vendor.zip
|
||||
|
||||
runtime/*
|
||||
|
||||
app/*
|
||||
!app/controller/TestController.php
|
||||
app/controller/TestController.php
|
||||
|
||||
config/extend/*
|
@ -48,6 +48,8 @@ class Order extends BaseModel
|
||||
'state' => 0,
|
||||
// 开启监听:1, 关闭监听:0
|
||||
'patt' => $channel['patt'],
|
||||
// 平台
|
||||
'platform' => $channel['platform'],
|
||||
// 订单创建时间
|
||||
'create_time' => self::getFormatTime($my_time),
|
||||
// 订单关闭时间
|
||||
@ -136,7 +138,7 @@ class Order extends BaseModel
|
||||
if (!$channel_info) return backMsg(3, '用户账户无可用收款通道');
|
||||
// 选取收款通道
|
||||
$patt = PayAccount::find($channel_info->account_id);
|
||||
$channel = ['aid' => $channel_info->account_id, 'cid' => $channel_info->id, 'patt' => $patt->getData('pattern'), 'chan' => $channel_info->channel];
|
||||
$channel = ['aid' => $channel_info->account_id, 'cid' => $channel_info->id, 'patt' => $patt->getData('pattern'), 'chan' => $channel_info->channel, 'platform' => $patt->getData('platform')];
|
||||
PayChannel::update(['last_time' => self::getFormatTime(), 'id' => $channel['cid']]);
|
||||
return backMsg(0, 'ok', $channel);
|
||||
}
|
||||
@ -186,7 +188,9 @@ class Order extends BaseModel
|
||||
// 生成订单号
|
||||
private static function createOrderID(string $prefix = ''): string
|
||||
{
|
||||
return $prefix . date('Ymd') . substr(implode('', array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 8);
|
||||
$date = date('YmdHis');
|
||||
$rand = rand(1000, 9999);
|
||||
return $prefix . $date . $rand;
|
||||
}
|
||||
// 查询有效期内的未支付订单
|
||||
public function scopeActiveOrder($query)
|
||||
|
@ -1,72 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 后台菜单配置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
[
|
||||
'id' => 'console',
|
||||
'title' => '平台首页',
|
||||
'icon' => 'icon pear-icon pear-icon-home',
|
||||
'type' => 1,
|
||||
'openType' => '_iframe',
|
||||
'href' => 'Console/console',
|
||||
],
|
||||
[
|
||||
'id' => 'order',
|
||||
'title' => '订单管理',
|
||||
'icon' => 'icon pear-icon pear-icon-survey',
|
||||
'type' => 1,
|
||||
'openType' => '_iframe',
|
||||
'href' => '/Order/index',
|
||||
],
|
||||
[
|
||||
'id' => 'payManage',
|
||||
'title' => '账号管理',
|
||||
'icon' => 'icon pear-icon pear-icon-security',
|
||||
'type' => 1,
|
||||
'openType' => '_iframe',
|
||||
'href' => '/PayManage/index',
|
||||
],
|
||||
[
|
||||
'id' => 'pluginManage',
|
||||
'title' => '插件管理',
|
||||
'icon' => 'icon pear-icon pear-icon-modular',
|
||||
'type' => 1,
|
||||
'openType' => '_iframe',
|
||||
'href' => '/Plugin/index',
|
||||
],
|
||||
[
|
||||
'id' => 'userCenter',
|
||||
'title' => '用户中心',
|
||||
'icon' => 'icon pear-icon pear-icon-user',
|
||||
'type' => 1,
|
||||
'openType' => '_iframe',
|
||||
'href' => '/User/index',
|
||||
],
|
||||
// [
|
||||
// 'id' => 'system',
|
||||
// 'title' => '系统设置',
|
||||
// 'icon' => 'icon pear-icon pear-icon-import',
|
||||
// 'type' => 1,
|
||||
// 'openType' => '_iframe',
|
||||
// 'href' => '/System/index',
|
||||
// ],
|
||||
// [
|
||||
// 'id' => 'pay',
|
||||
// 'title' => '支付管理',
|
||||
// 'icon' => 'icon pear-icon pear-icon-import',
|
||||
// 'type' => 0,
|
||||
// 'href' => '',
|
||||
// 'children' => [
|
||||
// [
|
||||
// 'id' => 'pay_qrcode_list',
|
||||
// 'title' => '收款账户',
|
||||
// 'icon' => 'icon pear-icon pear-icon-import',
|
||||
// 'type' => 1,
|
||||
// 'openType' => '_iframe',
|
||||
// 'href' => '/PayQrcode/index',
|
||||
// ],
|
||||
// ],
|
||||
// ],
|
||||
];
|
@ -1,43 +0,0 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 支付插件列表
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return array (
|
||||
0 =>
|
||||
array (
|
||||
'platform' => 'wxpay',
|
||||
'name' => '微信支付',
|
||||
'class_name' => 'WxPay',
|
||||
'price' => NULL,
|
||||
'describe' => '支持微信个人收款码、赞赏码、经营码、商家码收款,监听回调',
|
||||
'website' => 'https://weixin.qq.com',
|
||||
'helplink' => 'https://f0bmwzqjtq2.feishu.cn/docx/JBshdZWokoWzLmxSKQWcSd4Jncg',
|
||||
'version' => '1.0',
|
||||
'state' => 1,
|
||||
),
|
||||
1 =>
|
||||
array (
|
||||
'platform' => 'alipay',
|
||||
'name' => '支付宝',
|
||||
'class_name' => 'AliPay',
|
||||
'price' => NULL,
|
||||
'describe' => '支持支付宝个人收款码、经营码收款,监听回调',
|
||||
'website' => 'https://www.alipay.com',
|
||||
'helplink' => 'https://f0bmwzqjtq2.feishu.cn/docx/GfltdDrjxoYXwexhtX8ckDCBn9f',
|
||||
'version' => '1.0',
|
||||
'state' => 1,
|
||||
),
|
||||
2 =>
|
||||
array (
|
||||
'platform' => 'sqbpay',
|
||||
'name' => '收钱吧',
|
||||
'class_name' => 'ShouQianBa',
|
||||
'price' => NULL,
|
||||
'describe' => '主流移动支付全能收 信用卡,花呗都能用,生意帮手收钱吧,移动收款就用它!',
|
||||
'website' => 'https://www.shouqianba.com',
|
||||
'helplink' => 'https://f0bmwzqjtq2.feishu.cn/docx/WwN7dRqmuoozlIxgiuFclZhCnte',
|
||||
'version' => '1.0',
|
||||
'state' => 1,
|
||||
),
|
||||
);
|
@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
class Plugin
|
||||
{
|
||||
private static $siteUrl = 'https://api.zhaidashi.cn';
|
||||
private static $siteUrl = 'https://api.qcjy.cc';
|
||||
// 获取全部插件(含本地)
|
||||
public static function getAllPlugins(array $local_plugin = []): array
|
||||
{
|
||||
|
@ -128,15 +128,6 @@
|
||||
清空过期
|
||||
</button>
|
||||
</script>
|
||||
<script type="text/html" id="platformTpl">
|
||||
<div>
|
||||
{{#
|
||||
let platforms = JSON.parse(sessionStorage.getItem('platforms')) || {};
|
||||
let platformName = platforms[d.platform] || '已卸载';
|
||||
return `${platformName} [${d.aid}:${d.cid}]`;
|
||||
}}
|
||||
</div>
|
||||
</script>
|
||||
<script src="/component/layui/layui.js"></script>
|
||||
<script src="/component/pear/pear.js"></script>
|
||||
<script>
|
||||
@ -223,6 +214,11 @@
|
||||
form.render('select');
|
||||
// 会话存储
|
||||
sessionStorage.setItem('platforms', JSON.stringify(platforms));
|
||||
let platformTpl = (d) => {
|
||||
let platforms = JSON.parse(sessionStorage.getItem('platforms')) || {};
|
||||
let platformName = platforms[d.platform] || '已卸载';
|
||||
return `${platformName} [${d.aid}:${d.cid}]`;
|
||||
}
|
||||
// 表格列参数
|
||||
let cols = [[
|
||||
{ type: 'checkbox' },
|
||||
@ -235,7 +231,7 @@
|
||||
{ title: '支付状态', field: 'state', align: 'center', minWidth: 85, templet: '<div>{{# if(d.state==1){return`<span class="layui-badge layui-bg-green">成功</span>`}else{if(new Date(d.close_time)>new Date("<?php echo $servertime ?>")){return`<span class="layui-badge layui-bg-orange">等待</span>`}else{return`<span class="layui-badge layui-bg-gray">过期</span>`} } }}</div>' },
|
||||
{ title: '支付时间', field: 'pay_time', align: 'center', minWidth: 160, templet: '<div>{{= d.pay_time == d.create_time ? "- -" : d.pay_time}}</div>' },
|
||||
{ title: '支付平台', field: 'type', align: 'center', width: 120, templet: '<div>{{# if(d.type=="wxpay"){return`<div class="paytype"><img src="/static/img/wxpay.ico"width="15"><span>微信支付</span></div>`}if(d.type=="alipay"){return`<div class="paytype"><img src="/static/img/alipay.ico"width="15"><span>支付宝</span></div>`}if(d.type=="unionpay"){return`<div class="paytype"><img src="/static/img/unionpay.ico"width="15"><span>云闪付</span></div>`} }}</div>' },
|
||||
{ title: '收款平台[账号:终端]', field: 'platform', align: 'center', minWidth: 160, templet: '#platformTpl' },
|
||||
{ title: '收款平台[账号:终端]', field: 'platform', align: 'center', minWidth: 160, templet: platformTpl },
|
||||
{ title: '操作', align: 'center', width: 120, fixed: 'right', templet: '<div><strong><a href="javascript:;" data-id="{{= d.id }}" class="layui-font-green {{= d.state==1 ? "orderSet-paid" : "orderSet-paying" }}">设置</a></strong></div>' }
|
||||
]]
|
||||
// 表格渲染
|
||||
|
Loading…
Reference in New Issue
Block a user