Initial project files: BESCMS full source
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'type' => 'app',
|
||||
'name' => '支付',
|
||||
'author' => '迅睿云软件',
|
||||
'icon' => 'fa fa-rmb',
|
||||
|
||||
];
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
if (!method_exists(\Phpcmf\Service::M('table'), 'install_schema')) {
|
||||
return dr_return_data(0, '请先升级迅睿系统后再安装本插件');
|
||||
}
|
||||
|
||||
//if (!dr_is_app('member')) {
|
||||
//return dr_return_data(0, '需要先安装官方版的<用户系统>插件');
|
||||
//}
|
||||
|
||||
return dr_return_data(1, 'ok');
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 缓存参数配置
|
||||
*
|
||||
* 模型名称 => 项目目录
|
||||
*
|
||||
**/
|
||||
|
||||
return [
|
||||
|
||||
//'模型文件名',
|
||||
|
||||
];
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
// 3天清理一次系统缓存
|
||||
if (!is_file(WRITEPATH.'config/run_auto_pay_time.php')) {
|
||||
$time = SYS_TIME;
|
||||
file_put_contents(WRITEPATH.'config/run_auto_pay_time.php', $time);
|
||||
} else {
|
||||
$time = file_get_contents(WRITEPATH.'config/run_auto_pay_time.php');
|
||||
}
|
||||
|
||||
// 3天清理一次系统缓存
|
||||
if (SYS_TIME - $time > 3600 * 24 * 3) {
|
||||
// 未付款的清理
|
||||
\Phpcmf\Service::M('pay', 'pay')->clear_paylog();
|
||||
file_put_contents(WRITEPATH.'config/run_auto_pay_time.php', SYS_TIME);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* CSRF过滤白名单
|
||||
*/
|
||||
|
||||
return [
|
||||
|
||||
'home' => [
|
||||
'pay/home/ajax'
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
$rt = \Phpcmf\Service::M('table')->install_schema([
|
||||
'tables' => [
|
||||
'member_setting' => [
|
||||
'comment' => '用户属性参数表',
|
||||
'fields' => [
|
||||
'name' => 'varchar(50) NOT NULL',
|
||||
'value' => 'mediumtext NOT NULL',
|
||||
],
|
||||
'indexes' => [
|
||||
'PRIMARY KEY (`name`)',
|
||||
],
|
||||
],
|
||||
'member_paylog' => [
|
||||
'comment' => '用户支付记录表',
|
||||
'fields' => [
|
||||
'id' => 'bigint(18) unsigned NOT NULL AUTO_INCREMENT',
|
||||
'site' => 'int(10) NOT NULL COMMENT \'站点\'',
|
||||
'mid' => 'varchar(100) NOT NULL COMMENT \'支付标识\'',
|
||||
'uid' => 'int(10) unsigned NOT NULL COMMENT \'付款人\'',
|
||||
'touid' => 'int(10) unsigned DEFAULT 0 COMMENT \'收款人\'',
|
||||
'title' => 'varchar(255) NOT NULL COMMENT \'支付标题\'',
|
||||
'url' => 'varchar(255) NOT NULL COMMENT \'相关链接\'',
|
||||
'value' => 'decimal(10,2) NOT NULL COMMENT \'支付金额\'',
|
||||
'money' => 'decimal(10,2) NOT NULL COMMENT \'余额\'',
|
||||
'type' => 'varchar(20) NOT NULL COMMENT \'支付方式\'',
|
||||
'status' => 'tinyint(1) unsigned NOT NULL COMMENT \'支付状态\'',
|
||||
'result' => 'text NOT NULL COMMENT \'支付结果\'',
|
||||
'paytime' => 'int(10) unsigned NOT NULL COMMENT \'支付时间\'',
|
||||
'inputtime' => 'int(10) unsigned NOT NULL COMMENT \'创建时间\'',
|
||||
],
|
||||
'indexes' => [
|
||||
'PRIMARY KEY (`id`)',
|
||||
'KEY `uid` (`uid`)',
|
||||
'KEY `touid` (`touid`)',
|
||||
'KEY `mid` (`mid`)',
|
||||
'KEY `status` (`status`)',
|
||||
'KEY `value` (`value`)',
|
||||
'KEY `paytime` (`paytime`)',
|
||||
'KEY `inputtime` (`inputtime`)',
|
||||
],
|
||||
],
|
||||
],
|
||||
'seeds' => [],
|
||||
]);
|
||||
if (empty($rt['code'])) {
|
||||
log_message('error', 'Pay install_schema: '.($rt['msg'] ?? ''));
|
||||
return dr_return_data(0, dr_lang('安装失败').':'.($rt['msg'] ?? ''));
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 菜单配置
|
||||
*/
|
||||
|
||||
|
||||
return [
|
||||
|
||||
'admin' => [
|
||||
|
||||
|
||||
|
||||
'app-pay' => [
|
||||
'name' => '支付',
|
||||
'icon' => 'fa fa-rmb',
|
||||
'left' => [
|
||||
'app-pay-list' => [
|
||||
'name' => '支付管理',
|
||||
'icon' => 'fa fa-rmb',
|
||||
'link' => [
|
||||
[
|
||||
'name' => '已付流水',
|
||||
'icon' => 'fa fa-calendar-check-o',
|
||||
'uri' => 'pay/paylog/index',
|
||||
'displayorder' => '-1',
|
||||
],
|
||||
[
|
||||
'name' => '未付流水',
|
||||
'icon' => 'fa fa-calendar-times-o',
|
||||
'uri' => 'pay/paylog/not_index',
|
||||
'displayorder' => '-1',
|
||||
],
|
||||
[
|
||||
'name' => '后台充值',
|
||||
'icon' => 'fa fa-plus',
|
||||
'uri' => 'pay/pay/index',
|
||||
'displayorder' => '-1',
|
||||
],
|
||||
]
|
||||
],
|
||||
|
||||
'app-config-pay' => [
|
||||
'name' => '支付设置',
|
||||
'icon' => 'fa fa-rmb',
|
||||
'link' => [
|
||||
[
|
||||
'name' => '支付设置',
|
||||
'icon' => 'fa fa-cog',
|
||||
'uri' => 'pay/payconfig/index',
|
||||
],
|
||||
[
|
||||
'name' => '支付接口',
|
||||
'icon' => 'fa fa-code',
|
||||
'uri' => 'pay/payapi/index',
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
],
|
||||
],
|
||||
|
||||
|
||||
|
||||
|
||||
],
|
||||
|
||||
'member' => [
|
||||
|
||||
|
||||
|
||||
'app-pay' => [
|
||||
'name' => '支付管理',
|
||||
'icon' => 'fa fa-rmb',
|
||||
'link' => [
|
||||
[
|
||||
'name' => '在线充值',
|
||||
'icon' => 'fa fa-rmb',
|
||||
'uri' => 'pay/recharge/index',
|
||||
'displayorder' => '-1',
|
||||
],
|
||||
[
|
||||
'name' => '我的交易',
|
||||
'icon' => 'fa fa-calendar',
|
||||
'uri' => 'pay/paylog/index',
|
||||
'displayorder' => '-1',
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
|
||||
|
||||
];
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/**
|
||||
* https://www.besyun.com
|
||||
* BESCMS
|
||||
* 本文件是框架系统文件,二次开发时不可以修改本文件
|
||||
**/
|
||||
|
||||
/**
|
||||
* 通知动作注册配置
|
||||
*
|
||||
* 动作字符 => 动作名称
|
||||
*
|
||||
**/
|
||||
|
||||
return [
|
||||
|
||||
'pay_success' => '前台充值/付款',
|
||||
'pay_admin' => '后台管理员充值',
|
||||
|
||||
];
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
// 加载主程序的路由
|
||||
require COREPATH.'Config/Routes.php';
|
||||
@@ -0,0 +1,2 @@
|
||||
<?php
|
||||
\Phpcmf\Service::M('table')->drop_table(\Phpcmf\Service::M()->dbprefix('member_paylog'), true);
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 更新数据结构
|
||||
**/
|
||||
|
||||
$table = \Phpcmf\Service::M()->dbprefix('member_paylog');
|
||||
if (\Phpcmf\Service::M()->is_table_exists($table)) {
|
||||
if (!\Phpcmf\Service::M()->is_field_exists($table, 'money')) {
|
||||
\Phpcmf\Service::M('table')->add_field($table, 'money', 'decimal(10,2)', 'NOT NULL', '余额');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
'id' => '777',
|
||||
'vip' => '',
|
||||
'cms' => '4.7.3',
|
||||
'version' => '2.5',
|
||||
'license' => '375C71349B295FBE2DCDCA9206F20A1703',
|
||||
'updatetime' => '2026-08-04 07:49:13',
|
||||
'downtime' => '2026-08-08 00:54:28',
|
||||
|
||||
];
|
||||
@@ -0,0 +1,222 @@
|
||||
<?php namespace Phpcmf\Controllers\Admin;
|
||||
/**
|
||||
* https://www.besyun.com
|
||||
* BESCMS
|
||||
* 本文件是框架系统文件,二次开发时不可以修改本文件
|
||||
**/
|
||||
|
||||
class Pay extends \Phpcmf\Common {
|
||||
|
||||
public function __construct() {
|
||||
parent::__construct();
|
||||
$fdata = \Phpcmf\Service::L('Field')->sys_field(['uid']);
|
||||
$fdata['uid']['name'] = dr_lang('用户账号');
|
||||
\Phpcmf\Service::V()->assign([
|
||||
'form' => dr_form_hidden(),
|
||||
'menu' => \Phpcmf\Service::M('auth')->_admin_menu(
|
||||
[
|
||||
'用户充值' => ['pay/pay/index', 'fa fa-rmb'],
|
||||
'资金冻结' => ['pay/pay/freeze_index', 'bi bi-dash-circle-fill'],
|
||||
'help' => [ 600 ],
|
||||
]
|
||||
),
|
||||
'myfield' => dr_rp(\Phpcmf\Service::L('Field')->toform(0, $fdata), 'width:100%;', 'width:300px;'),
|
||||
]);
|
||||
}
|
||||
|
||||
public function index() {
|
||||
|
||||
if (IS_AJAX_POST) {
|
||||
$post = \Phpcmf\Service::L('input')->post('data');
|
||||
if (!$post['uid']) {
|
||||
$this->_json(0, dr_lang('账号不能为空'), ['field' => 'uid']);
|
||||
}
|
||||
$user = \Phpcmf\Service::M()->db->table('member')->where('username', $post['uid'])->get()->getRowArray();
|
||||
if (!$user) {
|
||||
$this->_json(0, dr_lang('账号[%s]不存在', $post['uid']), ['field' => 'uid']);
|
||||
} elseif (!$post['value']) {
|
||||
$this->_json(0, dr_lang('金额值未填写'), ['field' => 'value']);
|
||||
} elseif (!$post['unit']) {
|
||||
$this->_json(0, dr_lang('充值类型未选择'), ['field' => 'unit']);
|
||||
} elseif (!$post['note']) {
|
||||
$this->_json(0, dr_lang('备注说明未填写'), ['field' => 'note']);
|
||||
}
|
||||
if ($post['type'] == 1) {
|
||||
// 增加
|
||||
$post['value'] = abs($post['value']);
|
||||
$msg = '充值%s成功';
|
||||
} else {
|
||||
// 减少
|
||||
$post['value'] = abs($post['value']) * -1;
|
||||
$msg = '扣减%s成功';
|
||||
}
|
||||
if ($post['unit'] == 1) {
|
||||
// 积分
|
||||
if ($user['score'] + $post['value'] < 0) {
|
||||
$this->_json(0, dr_lang('账号%s不足', SITE_SCORE), ['field' => 'value']);
|
||||
}
|
||||
// 付款方的钱
|
||||
$rt = \Phpcmf\Service::M('member')->add_score($user['id'], $post['value'], $post['note']);
|
||||
if (!$rt['code']) {
|
||||
$this->_json(0, $rt['msg']);
|
||||
}
|
||||
$this->_json(1, dr_lang($msg, SITE_SCORE.$post['value']));
|
||||
} elseif ($post['unit'] == 3) {
|
||||
// 升级值
|
||||
if ($user['experience'] + $post['value'] < 0) {
|
||||
$this->_json(0, dr_lang('账号%s不足', SITE_EXPERIENCE), ['field' => 'value']);
|
||||
}
|
||||
// 付款方的钱
|
||||
$rt = \Phpcmf\Service::M('member')->add_experience($user['id'], $post['value'], $post['note']);
|
||||
if (!$rt['code']) {
|
||||
$this->_json(0, $rt['msg']);
|
||||
}
|
||||
$this->_json(1, dr_lang($msg, SITE_EXPERIENCE.$post['value']));
|
||||
} else {
|
||||
// rmb
|
||||
if ($user['money'] + $post['value'] < 0) {
|
||||
$this->_json(0, dr_lang('账号余额不足'), ['field' => 'value']);
|
||||
}
|
||||
// 付款方的钱
|
||||
$rt = \Phpcmf\Service::M('Pay')->add_money($user['id'], $post['value']);
|
||||
if (!$rt['code']) {
|
||||
$this->_json(0, $rt['msg']);
|
||||
}
|
||||
// 增加到交易流水
|
||||
$rt = \Phpcmf\Service::M('Pay')->add_paylog([
|
||||
'uid' => $user['id'],
|
||||
'touid' => $user['id'],
|
||||
'mid' => 'system',
|
||||
'title' => dr_lang('后台充值'),
|
||||
'value' => $post['value'],
|
||||
'type' => 'system',
|
||||
'status' => 1,
|
||||
'result' => $post['note'],
|
||||
'paytime' => SYS_TIME,
|
||||
'inputtime' => SYS_TIME,
|
||||
]);
|
||||
if (!$rt['code']) {
|
||||
$this->_json(0, $rt['msg']);
|
||||
}
|
||||
$call = [
|
||||
'uid' => $user['id'],
|
||||
'username' => $user['username'],
|
||||
'email' => $user['email'],
|
||||
'phone' => $user['phone'],
|
||||
'value' => $post['value'],
|
||||
'url' => \Phpcmf\Service::L('Router')->member_url('pay/paylog/show', ['id' => $rt['code']]),
|
||||
'result' => $post['note'],
|
||||
];
|
||||
// 通知
|
||||
\Phpcmf\Service::L('Notice')->send_notice('pay_admin', $call);
|
||||
// 钩子
|
||||
\Phpcmf\Hooks::trigger('pay_admin_after', $call);
|
||||
$this->_json(1, dr_lang($msg, 'RMB'.$post['value']));
|
||||
}
|
||||
}
|
||||
|
||||
\Phpcmf\Service::V()->display('pay.html');
|
||||
}
|
||||
|
||||
public function freeze_index() {
|
||||
|
||||
if (IS_AJAX_POST) {
|
||||
$post = \Phpcmf\Service::L('input')->post('data');
|
||||
if (!$post['uid']) {
|
||||
$this->_json(0, dr_lang('账号不能为空'), ['field' => 'uid']);
|
||||
}
|
||||
$user = \Phpcmf\Service::M()->db->table('member')->where('username', $post['uid'])->get()->getRowArray();
|
||||
if (!$user) {
|
||||
$this->_json(0, dr_lang('账号[%s]不存在', $post['uid']), ['field' => 'uid']);
|
||||
} elseif (!$post['note']) {
|
||||
$this->_json(0, dr_lang('备注说明未填写'), ['field' => 'note']);
|
||||
}
|
||||
|
||||
$post['value'] = abs($post['value']);
|
||||
if ($post['type'] == 1) {
|
||||
// 冻结
|
||||
if (!$post['value']) {
|
||||
$this->_json(0, dr_lang('金额值未填写'), ['field' => 'value']);
|
||||
} elseif ($user['money'] - $post['value'] < 0) {
|
||||
$this->_json(0, dr_lang('账号可用金额不足'), ['field' => 'value']);
|
||||
}
|
||||
\Phpcmf\Service::M('member')->add_freeze($user['id'], $post['value']);
|
||||
// 增加到交易流水
|
||||
$rt = \Phpcmf\Service::M('Pay')->add_paylog([
|
||||
'uid' => $user['id'],
|
||||
'touid' => $user['id'],
|
||||
'mid' => 'admin-freeze',
|
||||
'title' => '后台冻结资金',
|
||||
'value' => -$post['value'],
|
||||
'type' => 'system',
|
||||
'status' => 1,
|
||||
'result' => $post['note'],
|
||||
'paytime' => SYS_TIME,
|
||||
'inputtime' => SYS_TIME,
|
||||
]);
|
||||
$msg = '冻结%s成功';
|
||||
} elseif ($post['type'] == 0) {
|
||||
// 解冻
|
||||
if (!$post['value']) {
|
||||
$this->_json(0, dr_lang('金额值未填写'), ['field' => 'value']);
|
||||
} elseif ($user['freeze'] - $post['value'] < 0) {
|
||||
$this->_json(0, dr_lang('账号可用冻结金额不足'), ['field' => 'value']);
|
||||
}
|
||||
\Phpcmf\Service::M('member')->cancel_freeze($user['id'], $post['value']);
|
||||
// 增加到交易流水
|
||||
$rt = \Phpcmf\Service::M('Pay')->add_paylog([
|
||||
'uid' => $user['id'],
|
||||
'touid' => $user['id'],
|
||||
'mid' => 'admin-freeze',
|
||||
'title' => '后台解冻资金',
|
||||
'value' => abs($post['value']),
|
||||
'type' => 'system',
|
||||
'status' => 1,
|
||||
'result' => $post['note'],
|
||||
'paytime' => SYS_TIME,
|
||||
'inputtime' => SYS_TIME,
|
||||
]);
|
||||
$msg = '解冻%s成功';
|
||||
} else {
|
||||
// 指定任意值
|
||||
\Phpcmf\Service::M()->table('member')->update($user['id'], ['freeze' => $post['value'] ]);
|
||||
// 增加到交易流水
|
||||
$rt = \Phpcmf\Service::M('Pay')->add_paylog([
|
||||
'uid' => $user['id'],
|
||||
'touid' => $user['id'],
|
||||
'mid' => 'admin-freeze',
|
||||
'title' => '后台设置指定冻结资金',
|
||||
'value' => abs($post['value']),
|
||||
'type' => 'system',
|
||||
'status' => 1,
|
||||
'result' => $post['note'],
|
||||
'paytime' => SYS_TIME,
|
||||
'inputtime' => SYS_TIME,
|
||||
]);
|
||||
$msg = '设置指定冻结资金%s';
|
||||
}
|
||||
|
||||
if (!$rt['code']) {
|
||||
$this->_json(0, $rt['msg']);
|
||||
}
|
||||
$call = [
|
||||
'uid' => $user['id'],
|
||||
'username' => $user['username'],
|
||||
'email' => $user['email'],
|
||||
'phone' => $user['phone'],
|
||||
'value' => $post['value'],
|
||||
'url' => \Phpcmf\Service::L('Router')->member_url('pay/paylog/show', ['id' => $rt['code']]),
|
||||
'result' => $post['note'],
|
||||
];
|
||||
// 通知
|
||||
\Phpcmf\Service::L('Notice')->send_notice('pay_admin_freeze', $call);
|
||||
// 钩子
|
||||
\Phpcmf\Hooks::trigger('pay_admin_freeze', $call);
|
||||
$this->_json(1, dr_lang($msg, abs($post['value'])));
|
||||
|
||||
}
|
||||
|
||||
\Phpcmf\Service::V()->display('pay_freeze.html');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
<?php namespace Phpcmf\Controllers\Admin;
|
||||
/**
|
||||
* https://www.besyun.com
|
||||
* BESCMS
|
||||
* 本文件是框架系统文件,二次开发时不可以修改本文件
|
||||
**/
|
||||
|
||||
class Payapi extends \Phpcmf\Common
|
||||
{
|
||||
|
||||
public function index() {
|
||||
|
||||
$data = \Phpcmf\Service::M()->db->table('member_setting')->where('name', 'payapi')->get()->getRowArray();
|
||||
$data = dr_string2array($data['value']);
|
||||
|
||||
if (IS_AJAX_POST) {
|
||||
$post = \Phpcmf\Service::L('input')->post('data');
|
||||
|
||||
\Phpcmf\Service::M()->db->table('member_setting')->replace([
|
||||
'name' => 'payapi',
|
||||
'value' => dr_array2string($post)
|
||||
]);
|
||||
\Phpcmf\Service::M('cache')->sync_cache('member'); // 自动更新缓存
|
||||
$this->_json(1, dr_lang('操作成功'));
|
||||
}
|
||||
|
||||
$local = dr_dir_map(ROOTPATH.'api/pay/', 1);
|
||||
foreach ($local as $dir) {
|
||||
if ($dir != 'finecms' && is_file(ROOTPATH.'api/pay/'.$dir.'/config.php')) {
|
||||
$config = require ROOTPATH.'api/pay/'.$dir.'/config.php';
|
||||
if ($data[$dir]) {
|
||||
$data[$dir]['config'] = $config;
|
||||
} else {
|
||||
$data[$dir] = [
|
||||
'config' => $config,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
\Phpcmf\Service::V()->assign([
|
||||
'data' => $data,
|
||||
'form' => dr_form_hidden(),
|
||||
'menu' => \Phpcmf\Service::M('auth')->_admin_menu(
|
||||
[
|
||||
'支付接口' => ['pay/payapi/index', 'fa fa-code'],
|
||||
'help' => [387]
|
||||
]
|
||||
),
|
||||
]);
|
||||
\Phpcmf\Service::V()->display('payapi.html');
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测微信退款 API 证书是否可用
|
||||
*/
|
||||
public function check_cert() {
|
||||
|
||||
$cert = trim((string)\Phpcmf\Service::L('input')->get('sslcert_path'));
|
||||
$key = trim((string)\Phpcmf\Service::L('input')->get('sslkey_path'));
|
||||
|
||||
$default_cert = ROOTPATH.'api/pay/weixin/cert/apiclient_cert.pem';
|
||||
$default_key = ROOTPATH.'api/pay/weixin/cert/apiclient_key.pem';
|
||||
|
||||
if ($cert === '') {
|
||||
$row = \Phpcmf\Service::M()->db->table('member_setting')->where('name', 'payapi')->get()->getRowArray();
|
||||
$payapi = dr_string2array($row['value']);
|
||||
if (!empty($payapi['weixin']['sslcert_path'])) {
|
||||
$cert = $payapi['weixin']['sslcert_path'];
|
||||
}
|
||||
}
|
||||
if ($key === '') {
|
||||
if (!isset($payapi)) {
|
||||
$row = \Phpcmf\Service::M()->db->table('member_setting')->where('name', 'payapi')->get()->getRowArray();
|
||||
$payapi = dr_string2array($row['value']);
|
||||
}
|
||||
if (!empty($payapi['weixin']['sslkey_path'])) {
|
||||
$key = $payapi['weixin']['sslkey_path'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($cert === '') {
|
||||
$cert = $default_cert;
|
||||
}
|
||||
if ($key === '') {
|
||||
$key = $default_key;
|
||||
}
|
||||
|
||||
$errors = [];
|
||||
if (!is_file($cert)) {
|
||||
$errors[] = dr_lang('证书文件不存在').':'.$cert;
|
||||
} elseif (!is_readable($cert)) {
|
||||
$errors[] = dr_lang('证书文件不可读').':'.$cert;
|
||||
} else {
|
||||
$cert_body = (string)@file_get_contents($cert);
|
||||
if (strpos($cert_body, 'BEGIN CERTIFICATE') === false) {
|
||||
$errors[] = dr_lang('证书文件不是有效的 PEM 格式').':'.$cert;
|
||||
} elseif (function_exists('openssl_x509_read')) {
|
||||
$x509 = @openssl_x509_read($cert_body);
|
||||
if (!$x509) {
|
||||
$errors[] = dr_lang('证书文件无法被 OpenSSL 解析').':'.$cert;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_file($key)) {
|
||||
$errors[] = dr_lang('密钥文件不存在').':'.$key;
|
||||
} elseif (!is_readable($key)) {
|
||||
$errors[] = dr_lang('密钥文件不可读').':'.$key;
|
||||
} else {
|
||||
$key_body = (string)@file_get_contents($key);
|
||||
if (strpos($key_body, 'PRIVATE KEY') === false) {
|
||||
$errors[] = dr_lang('密钥文件不是有效的 PEM 格式').':'.$key;
|
||||
} elseif (function_exists('openssl_pkey_get_private')) {
|
||||
$pkey = @openssl_pkey_get_private($key_body);
|
||||
if (!$pkey) {
|
||||
$errors[] = dr_lang('密钥文件无法被 OpenSSL 解析').':'.$key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($errors) {
|
||||
$this->_json(0, implode('<br>', $errors));
|
||||
}
|
||||
|
||||
$this->_json(1, dr_lang('证书可用').':'.$cert.' / '.$key);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php namespace Phpcmf\Controllers\Admin;
|
||||
/**
|
||||
* https://www.besyun.com
|
||||
* BESCMS
|
||||
* 本文件是框架系统文件,二次开发时不可以修改本文件
|
||||
**/
|
||||
|
||||
class Payconfig extends \Phpcmf\Common
|
||||
{
|
||||
|
||||
public function index() {
|
||||
|
||||
$data = \Phpcmf\Service::M()->db->table('member_setting')->where('name', 'pay')->get()->getRowArray();
|
||||
$data = dr_string2array($data['value']);
|
||||
|
||||
if (IS_AJAX_POST) {
|
||||
$post = \Phpcmf\Service::L('input')->post('data', true);
|
||||
\Phpcmf\Service::M()->db->table('member_setting')->replace([
|
||||
'name' => 'pay',
|
||||
'value' => dr_array2string($post)
|
||||
]);
|
||||
\Phpcmf\Service::M('cache')->sync_cache('member'); // 自动更新缓存
|
||||
$this->_json(1, dr_lang('操作成功'));
|
||||
}
|
||||
|
||||
$page = intval(\Phpcmf\Service::L('input')->get('page'));
|
||||
|
||||
\Phpcmf\Service::V()->assign([
|
||||
'data' => $data,
|
||||
'page' => $page,
|
||||
'form' => dr_form_hidden(['page' => $page]),
|
||||
'menu' => \Phpcmf\Service::M('auth')->_admin_menu(
|
||||
[
|
||||
'支付设置' => ['pay/payconfig/index', 'fa fa-cog'],
|
||||
'help' => [625],
|
||||
]
|
||||
)
|
||||
]);
|
||||
\Phpcmf\Service::V()->display('payconfig.html');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,228 @@
|
||||
<?php namespace Phpcmf\Controllers\Admin;
|
||||
/**
|
||||
* https://www.besyun.com
|
||||
* BESCMS
|
||||
* 本文件是框架系统文件,二次开发时不可以修改本文件
|
||||
**/
|
||||
|
||||
// 资金流水
|
||||
class Paylog extends \Phpcmf\Table
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
// 支持附表存储
|
||||
$this->is_data = 0;
|
||||
// 模板前缀(避免混淆)
|
||||
$this->my_field = array(
|
||||
'title' => array(
|
||||
'ismain' => 1,
|
||||
'name' => dr_lang('关键字'),
|
||||
'fieldname' => 'title',
|
||||
'fieldtype' => 'Text',
|
||||
'setting' => array(
|
||||
'option' => array(
|
||||
'width' => 200,
|
||||
),
|
||||
)
|
||||
),
|
||||
'touid' => array(
|
||||
'ismain' => 1,
|
||||
'name' => dr_lang('收款人'),
|
||||
'fieldname' => 'touid',
|
||||
'fieldtype' => 'Uid',
|
||||
'setting' => array(
|
||||
'option' => array(
|
||||
'width' => 200,
|
||||
),
|
||||
)
|
||||
),
|
||||
'uid' => array(
|
||||
'ismain' => 1,
|
||||
'isint' => 1,
|
||||
'name' => dr_lang('付款人'),
|
||||
'fieldname' => 'uid',
|
||||
'fieldtype' => 'Uid',
|
||||
'setting' => array(
|
||||
'option' => array(
|
||||
'width' => 200,
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
// 表单显示名称
|
||||
$this->name = dr_lang('资金流水');
|
||||
// 初始化数据表
|
||||
$this->_init([
|
||||
'table' => 'member_paylog',
|
||||
'field' => $this->my_field,
|
||||
'order_by' => 'inputtime desc',
|
||||
'date_field' => 'inputtime',
|
||||
]);
|
||||
\Phpcmf\Service::V()->assign([
|
||||
'field' => $this->my_field,
|
||||
]);
|
||||
}
|
||||
|
||||
// index
|
||||
public function index() {
|
||||
\Phpcmf\Service::M()->set_where_list('`status`=1');
|
||||
$this->_List();
|
||||
\Phpcmf\Service::V()->assign([
|
||||
'not_pay' => 1,
|
||||
'menu' => \Phpcmf\Service::M('auth')->_admin_menu(
|
||||
[
|
||||
'已付流水' => [ 'pay/'.\Phpcmf\Service::L('Router')->class.'/index', 'fa fa-calendar'],
|
||||
'help' => [ 594 ],
|
||||
]
|
||||
),
|
||||
]);
|
||||
\Phpcmf\Service::V()->display('paylog_list.html');
|
||||
}
|
||||
|
||||
// index
|
||||
public function not_index() {
|
||||
\Phpcmf\Service::M()->set_where_list('`status`=0');
|
||||
$this->_List();
|
||||
\Phpcmf\Service::V()->assign([
|
||||
'not_pay' => 1,
|
||||
'menu' => \Phpcmf\Service::M('auth')->_admin_menu(
|
||||
[
|
||||
'未付流水' => ['pay/'.\Phpcmf\Service::L('Router')->class.'/not_index', 'fa fa-calendar'],
|
||||
'help' => [ 595 ],
|
||||
]
|
||||
),
|
||||
]);
|
||||
\Phpcmf\Service::V()->display('paylog_list.html');
|
||||
}
|
||||
|
||||
// edit
|
||||
public function edit() {
|
||||
list($tpl, $data) = $this->_Post((int)\Phpcmf\Service::L('input')->get('id'), [], 1);
|
||||
if (!$data) {
|
||||
$this->_admin_msg(0, dr_lang('支付记录不存在'));
|
||||
}
|
||||
if (!$data['status']) {
|
||||
\Phpcmf\Service::V()->assign([
|
||||
'data' => $data,
|
||||
'menu' => \Phpcmf\Service::M('auth')->_admin_menu(
|
||||
[
|
||||
'未付流水' => [APP_DIR.'/'.\Phpcmf\Service::L('Router')->class.'/not_index', 'fa fa-calendar'],
|
||||
'付款详情' => [APP_DIR.'/'.\Phpcmf\Service::L('Router')->class.'/edit', 'fa fa-edit'],
|
||||
]
|
||||
),
|
||||
'reply_url' => str_replace('m=index', 'm=not_index', \Phpcmf\Service::V()->get_value('reply_url'))
|
||||
]);
|
||||
} else {
|
||||
\Phpcmf\Service::V()->assign([
|
||||
'data' => $data,
|
||||
'menu' => \Phpcmf\Service::M('auth')->_admin_menu(
|
||||
[
|
||||
'已付流水' => [ 'pay/'.\Phpcmf\Service::L('Router')->class.'/index', 'fa fa-calendar'],
|
||||
'help' => [ 594 ],
|
||||
]
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
\Phpcmf\Service::V()->display('paylog_edit.html');
|
||||
}
|
||||
|
||||
// 系统回收
|
||||
public function system_edit() {
|
||||
|
||||
$id = (int)\Phpcmf\Service::L('input')->get('id');
|
||||
$data = \Phpcmf\Service::M('Pay')->table('member_paylog')->get($id);
|
||||
if (!$data) {
|
||||
$this->_json(0, dr_lang('支付记录不存在'));
|
||||
} elseif (1 != $data['status']) {
|
||||
$this->_json(0, dr_lang('支付记录不满足回收条件'));
|
||||
} elseif ($data['value'] < 0) {
|
||||
$this->_json(0, dr_lang('付款金额不满足回收条件'));
|
||||
} elseif ($data['mid'] != 'recharge') {
|
||||
$this->_json(0, dr_lang('只能回收充值金额'));
|
||||
} elseif (\Phpcmf\Service::M()->table('member_paylog')->where('mid', 'system-recovery-'.$id)->counts()) {
|
||||
$this->_json(0, dr_lang('此交易已经被回收过'));
|
||||
}
|
||||
|
||||
$user = \Phpcmf\Service::M('member')->table('member')->get($data['uid']);
|
||||
if (!$user) {
|
||||
$this->_json(0, dr_lang('用户记录不存在'));
|
||||
}
|
||||
|
||||
if (IS_AJAX_POST) {
|
||||
$post = \Phpcmf\Service::L('input')->post('data');
|
||||
if ($user['money'] - $data['value'] < 0) {
|
||||
$this->_json(0, dr_lang('付款账号余额不足'));
|
||||
} elseif (!$post['note']) {
|
||||
$this->_json(0, dr_lang('回收备注一定要填写'), ['field' => 'note']);
|
||||
}
|
||||
// 扣除付款方的钱
|
||||
$rt = \Phpcmf\Service::M('Pay')->add_money($data['uid'], -$data['value']);
|
||||
if (!$rt['code']) {
|
||||
$this->_json(0, $rt['msg']);
|
||||
}
|
||||
// 增加到交易流水
|
||||
$rt = \Phpcmf\Service::M('Pay')->add_paylog([
|
||||
'uid' => $data['uid'],
|
||||
'touid' => 0,
|
||||
'mid' => 'system-recovery-'.$id,
|
||||
'title' => dr_lang('系统回收'),
|
||||
'value' => -$data['value'],
|
||||
'type' => 'finecms',
|
||||
'status' => 1,
|
||||
'result' => $post['note'],
|
||||
'paytime' => SYS_TIME,
|
||||
'inputtime' => SYS_TIME,
|
||||
]);
|
||||
if (!$rt['code']) {
|
||||
$this->_json(0, $rt['msg']);
|
||||
}
|
||||
$this->_json(1, dr_lang('操作成功'));
|
||||
}
|
||||
|
||||
\Phpcmf\Service::V()->assign([
|
||||
'data' => $data,
|
||||
'user' => $user,
|
||||
'form' => dr_form_hidden(),
|
||||
]);
|
||||
\Phpcmf\Service::V()->display('paylog_system.html');exit;
|
||||
}
|
||||
|
||||
// 短信催付
|
||||
public function notice_del() {
|
||||
|
||||
$ids = \Phpcmf\Service::L('input')->get_post_ids();
|
||||
if (!$ids) {
|
||||
$this->_json(0, dr_lang('所选数据不存在'));
|
||||
}
|
||||
|
||||
$sql = 'select phone from `'.\Phpcmf\Service::M()->dbprefix('member').'` where `id` in (select `uid` from `'.\Phpcmf\Service::M()->dbprefix('member_paylog').'` where `id` in ('.implode(',', $ids).') )';
|
||||
$data = \Phpcmf\Service::M()->db->query($sql)->getResultArray();
|
||||
if (!$data) {
|
||||
$this->_json(0, dr_lang('所选数据不存在'));
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
foreach ($data as $t) {
|
||||
$rt = \Phpcmf\Service::M('member')->sendsms_text($t['phone'], dr_lang('您还有未付款的交易,请尽快付款;若已付,请忽略此消息'));
|
||||
if ($rt['code']) {
|
||||
$i ++;
|
||||
}
|
||||
}
|
||||
|
||||
$this->_json(1, dr_lang('已发送给%s个用户', $i));
|
||||
}
|
||||
|
||||
// 删除
|
||||
public function del() {
|
||||
$this->_Del(
|
||||
\Phpcmf\Service::L('input')->get_post_ids(),
|
||||
null,
|
||||
null,
|
||||
\Phpcmf\Service::M()->dbprefix($this->init['table'])
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php namespace Phpcmf\Controllers;
|
||||
|
||||
|
||||
// 交易下单
|
||||
class Buy extends \Phpcmf\Common {
|
||||
|
||||
public function index() {
|
||||
|
||||
$id = (int)\Phpcmf\Service::L('input')->get('id');
|
||||
if (!$id) {
|
||||
$this->_msg(0, dr_lang('商品id参数不能为空'));
|
||||
}
|
||||
|
||||
$fid = (int)\Phpcmf\Service::L('input')->get('fid');
|
||||
if (!$fid) {
|
||||
$this->_msg(0, dr_lang('支付字段fid参数不能为空'));
|
||||
}
|
||||
|
||||
$num = max(1, (int)\Phpcmf\Service::L('input')->get('num'));
|
||||
$sku = dr_safe_replace(\Phpcmf\Service::L('input')->get('sku'), 'undefined');
|
||||
|
||||
$field = $this->get_cache('table-field', $fid);
|
||||
if (!$field) {
|
||||
$this->_msg(0, dr_lang('支付字段[%s]不存在', $fid));
|
||||
}
|
||||
|
||||
// 获取付款价格
|
||||
$rt = \Phpcmf\Service::M('pay', 'pay')->get_pay_info($id, $field, $num, $sku);
|
||||
if (isset($rt['code']) && !$rt['code']) {
|
||||
$this->_msg(0, $rt['msg']);
|
||||
}
|
||||
|
||||
// 挂钩点 购买商品之前
|
||||
\Phpcmf\Hooks::trigger('member_buy_before', $rt);
|
||||
|
||||
\Phpcmf\Service::V()->assign($rt);
|
||||
\Phpcmf\Service::V()->assign([
|
||||
'num' => $rt['num'],
|
||||
'price' => $rt['price'],
|
||||
'total' => $rt['total'],
|
||||
'total_price' => $rt['total'],
|
||||
'payform' => dr_payform($rt['mid'], $rt['total'], $rt['title'].$rt['sku_string'], $rt['url']),
|
||||
'meta_title' => dr_lang('在线付款').SITE_SEOJOIN.SITE_NAME,
|
||||
'meta_keywords' => $this->get_cache('site', SITE_ID, 'config', 'SITE_KEYWORDS'),
|
||||
'meta_description' => $this->get_cache('site', SITE_ID, 'config', 'SITE_DESCRIPTION')
|
||||
]);
|
||||
\Phpcmf\Service::V()->module('pay');
|
||||
if (!is_file(\Phpcmf\Service::V()->get_dir().'buy.html')) {
|
||||
\Phpcmf\Service::V()->module('api');
|
||||
}
|
||||
\Phpcmf\Service::V()->display('buy.html');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
<?php namespace Phpcmf\Controllers;
|
||||
|
||||
class Home extends \Phpcmf\Common
|
||||
{
|
||||
|
||||
// 付款
|
||||
public function index() {
|
||||
|
||||
$id = (int)\Phpcmf\Service::L('input')->get('id');
|
||||
$data = \Phpcmf\Service::M()->table('member_paylog')->get($id);
|
||||
if (!$data) {
|
||||
$this->_msg(0, dr_lang('该账单不存在'));
|
||||
} elseif ($data['status'] == 1) {
|
||||
$this->_msg(0, dr_lang('该账单已被支付'));
|
||||
}
|
||||
|
||||
// 付钱之前再次验证
|
||||
if ($data['mid'] && strpos($data['mid'], 'my-') !== false) {
|
||||
list($rname, $rid, $fid, $num, $sku) = explode('-', $data['mid']);
|
||||
if ($rname == 'my') {
|
||||
list($app, $class) = explode('_', $rid);
|
||||
$classFile = dr_get_app_dir($app).'Models/'.ucfirst($class).'.php';
|
||||
if (is_file($classFile)) {
|
||||
$obj = \Phpcmf\Service::M($class, $app);
|
||||
if (method_exists($obj, 'paylog_before')) {
|
||||
$error = $obj->paylog_before($fid, $num, $sku, $data);
|
||||
if ($error) {
|
||||
$this->_msg(0, $error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 0元支付
|
||||
if (empty($data['value'])) {
|
||||
$rt = \Phpcmf\Service::M('Pay','pay')->paysuccess(
|
||||
\Phpcmf\Service::M('Pay','pay')->get_pay_sn($data),
|
||||
0
|
||||
);
|
||||
if (!$rt['code']) {
|
||||
$this->_msg(0, $rt['msg'], $rt['data']['url']);
|
||||
}
|
||||
dr_redirect(ROOT_URL.'index.php?s=api&c=pay&m=call&id='.$rt['code']);exit;
|
||||
}
|
||||
|
||||
// 支付接口文件
|
||||
$apifile = ROOTPATH.'api/pay/'.$data['type'].'/pay.php';
|
||||
if (!is_file($apifile)) {
|
||||
$this->_msg(0, dr_lang('支付接口文件(%s)不存在', $data['type']));
|
||||
} elseif ($data['type'] != 'finecms' && (!isset($this->member_cache['payapi'][$data['type']]) || !$this->member_cache['payapi'][$data['type']])) {
|
||||
$this->_msg(0, dr_lang('支付接口(%s)未启用', $data['type']));
|
||||
}
|
||||
|
||||
// 发起支付
|
||||
$rt = \Phpcmf\Service::M('pay', 'pay')->dopay($apifile, $data);
|
||||
if (!$rt['code']) {
|
||||
$this->_msg(0, $rt['msg'], $rt['data']['url']);
|
||||
} elseif (isset($rt['data']['rturl']) && strlen($rt['data']['rturl']) > 10) {
|
||||
$this->_msg(1, $rt['msg'], $rt['data']['rturl']);
|
||||
}
|
||||
|
||||
// 请求模式下返回结果
|
||||
if (IS_API_HTTP || (\Phpcmf\Service::L('input')->get('is_ajax') || IS_API_HTTP || IS_AJAX)) {
|
||||
$this->_json(1, $rt['msg'], $rt['data']);
|
||||
}
|
||||
|
||||
// 运行模式直接输出代码
|
||||
switch ($rt['msg']) {
|
||||
case 'html':
|
||||
echo $rt['data'];
|
||||
exit;
|
||||
|
||||
case 'url':
|
||||
dr_redirect($rt['data']);
|
||||
break;
|
||||
}
|
||||
|
||||
$data['html'] = $rt['data'];
|
||||
if (SITE_IS_MOBILE && \Phpcmf\Service::IS_MOBILE_TPL()) {
|
||||
// 开启了移动端时,支付判断模板是否是移动端的
|
||||
\Phpcmf\Service::V()->init('mobile');
|
||||
}
|
||||
|
||||
\Phpcmf\Service::V()->assign([
|
||||
'pay' => $data,
|
||||
'pay_name' => dr_pay_type_html($data['type']),
|
||||
'meta_title' => $data['title']
|
||||
]);
|
||||
|
||||
\Phpcmf\Service::V()->module('pay');
|
||||
if (!is_file(\Phpcmf\Service::V()->get_dir().'pay.html')) {
|
||||
\Phpcmf\Service::V()->module('api');
|
||||
}
|
||||
\Phpcmf\Service::V()->display('pay.html');exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付接口js-ajax回调
|
||||
*/
|
||||
public function ajax() {
|
||||
|
||||
$id = (int)\Phpcmf\Service::L('input')->get('id');
|
||||
$data = \Phpcmf\Service::M()->table('member_paylog')->get($id);
|
||||
if (!$data) {
|
||||
$this->_jsonp(0, dr_lang('支付记录不存在'));
|
||||
} elseif ($data['status']) {
|
||||
$this->_jsonp(1, dr_lang('已经支付完成'));
|
||||
}
|
||||
|
||||
// 调用接口
|
||||
$apifile = ROOTPATH.'api/pay/'.$data['type'].'/notify_js.php';
|
||||
if (!is_file($apifile)) {
|
||||
$this->_jsonp(0, dr_lang('支付接口文件不存在'));
|
||||
}
|
||||
|
||||
$return = [];
|
||||
$result = dr_string2array($data['result']);
|
||||
|
||||
// 接口配置参数
|
||||
$config = $this->member_cache['payapi'][$data['type']];
|
||||
|
||||
require $apifile;
|
||||
|
||||
$this->_jsonp($return['code'], $return['msg']);
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付接口返回
|
||||
*/
|
||||
public function call() {
|
||||
|
||||
$id = (int)\Phpcmf\Service::L('input')->get('id');
|
||||
if (!$id) {
|
||||
$this->_msg(0, dr_lang('支付ID号不存在'));
|
||||
}
|
||||
|
||||
$data = \Phpcmf\Service::M()->table('member_paylog')->get($id);
|
||||
if (!$data) {
|
||||
$this->_msg(0, dr_lang('支付记录[%s]不存在', $id));
|
||||
} elseif (!$data['status']) {
|
||||
$this->_msg(0, dr_lang('支付记录[%s]未完成支付', $id));
|
||||
}
|
||||
|
||||
// 支付回调钩子
|
||||
\Phpcmf\Hooks::trigger('pay_call', $data);
|
||||
|
||||
if (SITE_IS_MOBILE && \Phpcmf\Service::IS_MOBILE_TPL()) {
|
||||
// 开启了移动端时,支付判断模板是否是移动端的
|
||||
\Phpcmf\Service::V()->init('mobile');
|
||||
}
|
||||
|
||||
// 获取支付回调地址
|
||||
$url = \Phpcmf\Service::M('pay')->paycall_url($data);
|
||||
|
||||
$this->_msg(1, dr_lang('支付成功'), $url);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php namespace Phpcmf\Controllers\Member;
|
||||
/**
|
||||
* https://www.besyun.com
|
||||
* BESCMS
|
||||
* 本文件是框架系统文件,二次开发时不可以修改本文件
|
||||
**/
|
||||
|
||||
class Pay extends \Phpcmf\Common
|
||||
{
|
||||
|
||||
/**
|
||||
* 提交支付账单
|
||||
*/
|
||||
public function index() {
|
||||
|
||||
if (IS_POST) {
|
||||
$pay = \Phpcmf\Service::L('input')->post('pay');
|
||||
$pay['uid'] = (int)$this->member['uid'];
|
||||
$pay['username'] = (string)$this->member['username'];
|
||||
$money = floatval($pay['money']);
|
||||
if (!$money) {
|
||||
$this->_msg(0, dr_lang('金额(%s)不正确', $money));
|
||||
exit;
|
||||
}
|
||||
$rt = \Phpcmf\Service::M('Pay')->post($pay);
|
||||
if (!$rt['code']) {
|
||||
$this->_msg(0, $rt['msg'], $rt['data']);
|
||||
}
|
||||
$url = PAY_URL.'index.php?s=pay&id='.$rt['code'];
|
||||
if (IS_API_HTTP || (\Phpcmf\Service::L('input')->get('is_ajax') || IS_API_HTTP || IS_AJAX)) {
|
||||
// 回调页面
|
||||
$this->_json($rt['code'], $url, $rt['data']);
|
||||
} else {
|
||||
// 跳转到支付页面,必须跳转到统一的主域名中付款
|
||||
dr_redirect($url, 'auto');
|
||||
}
|
||||
exit;
|
||||
} else {
|
||||
$this->_msg(0, dr_lang('POST请求错误'));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php namespace Phpcmf\Controllers\Member;
|
||||
|
||||
class Paylog extends \Phpcmf\Table
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
// 支持附表存储
|
||||
$this->is_data = 0;
|
||||
// 表单显示名称
|
||||
$this->name = dr_lang('资金流水');
|
||||
// 初始化数据表
|
||||
$this->_init([
|
||||
'table' => 'member_paylog',
|
||||
'order_by' => 'inputtime desc',
|
||||
'date_field' => 'inputtime',
|
||||
]);
|
||||
}
|
||||
|
||||
// index
|
||||
public function index() {
|
||||
|
||||
$tid = (int)\Phpcmf\Service::L('input')->get('tid');
|
||||
$where = ['`uid`='.$this->uid];
|
||||
switch ($tid) {
|
||||
case 1: // 收入
|
||||
$where[] = '`value` > 0';
|
||||
break;
|
||||
case -1: // 消费
|
||||
$where[] = '`value` < 0';
|
||||
break;
|
||||
default : // 全部
|
||||
break;
|
||||
}
|
||||
|
||||
if (isset($this->member_cache['pay']['year']) && $this->member_cache['pay']['year']) {
|
||||
$year = (int)$this->member_cache['pay']['year'];
|
||||
if ($year) {
|
||||
$where[] = 'inputtime > '.strtotime('-'.$year.' year');
|
||||
}
|
||||
}
|
||||
|
||||
\Phpcmf\Service::M()->set_where_list(implode(' AND ', $where));
|
||||
list($tpl, $data) = $this->_List(['tid' => $tid]);
|
||||
|
||||
// 初始化
|
||||
$data['param']['tid'] = $data['param']['total'] = 0;
|
||||
|
||||
// 列出类别
|
||||
$my = [];
|
||||
$type = ['0' => '全部', '1' => '收入', '-1' => '消费'];
|
||||
foreach ($type as $i => $t) {
|
||||
$data['param']['tid'] = $i;
|
||||
$my[$i] = [
|
||||
'name' => dr_lang($t),
|
||||
'url' => dr_member_url('pay/paylog/index', $data['param'])
|
||||
];
|
||||
}
|
||||
|
||||
\Phpcmf\Service::V()->assign([
|
||||
'tid' => $tid,
|
||||
'type' => $my,
|
||||
]);
|
||||
|
||||
\Phpcmf\Service::V()->display('paylog_index.html');
|
||||
}
|
||||
|
||||
public function show() {
|
||||
|
||||
$id = \Phpcmf\Service::L('input')->get('id');
|
||||
if (strpos($id, '-') !== false) {
|
||||
list($a, $id) = explode('-', $id);
|
||||
}
|
||||
|
||||
list($a, $data) = $this->_Show((int)$id);
|
||||
if (!$data) {
|
||||
$this->_msg(0, dr_lang('交易记录不存在'));exit;
|
||||
} elseif ($data['uid'] != $this->uid) {
|
||||
$this->_msg(0, dr_lang('无权限查看'));exit;
|
||||
}
|
||||
|
||||
\Phpcmf\Service::V()->display('paylog_show.html');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php namespace Phpcmf\Controllers\Member;
|
||||
|
||||
class Recharge extends \Phpcmf\Common {
|
||||
|
||||
/**
|
||||
* 在线充值
|
||||
*/
|
||||
public function index() {
|
||||
define('FC_PAY', 1);
|
||||
$value = max(floatval(\Phpcmf\Service::L('input')->get('value')), floatval($this->member_cache['pay']['min']));
|
||||
\Phpcmf\Service::V()->assign([
|
||||
'payfield' => dr_payform('recharge', $value ? $value : '', '', '', 1),
|
||||
]);
|
||||
\Phpcmf\Service::V()->display('recharge_index.html');
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,59 @@
|
||||
{template "header.html"}
|
||||
<div class="note note-danger">
|
||||
<p>{dr_lang('为指定账户进行充值金额')}</p>
|
||||
</div>
|
||||
<form action="" class="form-horizontal" method="post" name="myform" id="myform">
|
||||
{$form}
|
||||
<div class="portlet bordered light myfbody">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<span class="caption-subject font-green "><i class="fa fa-rmb"></i> {dr_lang('用户充值')}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<div class="form-body">
|
||||
|
||||
<div class="form-group" id="dr_row_unit">
|
||||
<label class="col-md-2 control-label">{dr_lang('充值类型')}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="mt-radio-inline">
|
||||
<label class="mt-radio mt-radio-outline"><input name="data[unit]" checked type="radio" value="2" /> {dr_lang('人民币')} <span></span></label>
|
||||
{if dr_is_app('scorelog')}<label class="mt-radio mt-radio-outline"><input name="data[unit]" type="radio" value="1" /> {SITE_SCORE} <span></span></label>{/if}
|
||||
{if dr_is_app('explog')}<label class="mt-radio mt-radio-outline"><input name="data[unit]" type="radio" value="3" /> {SITE_EXPERIENCE} <span></span></label>{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{$myfield}
|
||||
<div class="form-group" id="dr_row_type">
|
||||
<label class="col-md-2 control-label">{dr_lang('处理方式')}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="mt-radio-inline">
|
||||
<label class="mt-radio mt-radio-outline"><input name="data[type]" checked type="radio" value="1" /> {dr_lang('增加')} <span></span></label>
|
||||
<label class="mt-radio mt-radio-outline"><input name="data[type]" type="radio" value="0" /> {dr_lang('减少')} <span></span></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="dr_row_value">
|
||||
<label class="col-md-2 control-label">{dr_lang('处理金额')}</label>
|
||||
<div class="col-md-9">
|
||||
<label><input type="text" class="form-control input-large" id="dr_value" name="data[value]"></label>
|
||||
<span class="help-block"> {dr_lang('账户余额±处理金额=账户实际金额')} </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="dr_row_note">
|
||||
<label class="col-md-2 control-label">{dr_lang('备注说明')}</label>
|
||||
<div class="col-md-9">
|
||||
<textarea class="form-control" id="dr_note" name="data[note]" rows="4"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form myfooter">
|
||||
<div class="form-actions text-center">
|
||||
<button type="button" onclick="dr_ajax_submit('{dr_now_url()}', 'myform', 2000)" class="btn blue"> <i class="fa fa-save"></i> {dr_lang('确定操作')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{template "footer.html"}
|
||||
@@ -0,0 +1,52 @@
|
||||
{template "header.html"}
|
||||
<div class="note note-danger">
|
||||
<p>{dr_lang('为指定账户进行冻结资金')}</p>
|
||||
</div>
|
||||
<form action="" class="form-horizontal" method="post" name="myform" id="myform">
|
||||
{$form}
|
||||
<div class="portlet bordered light myfbody">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<span class="caption-subject font-green "><i class="bi bi-dash-circle-fill"></i> {dr_lang('资金冻结')}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<div class="form-body">
|
||||
|
||||
{$myfield}
|
||||
<div class="form-group" id="dr_row_type">
|
||||
<label class="col-md-2 control-label">{dr_lang('处理方式')}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="mt-radio-inline">
|
||||
<label class="mt-radio mt-radio-outline"><input name="data[type]" onclick="$('.type_0').hide();$('.type_1').show();$('.type_2').hide();" checked type="radio" value="1" /> {dr_lang('冻结')} <span></span></label>
|
||||
<label class="mt-radio mt-radio-outline"><input name="data[type]" onclick="$('.type_0').show();$('.type_1').hide();$('.type_2').hide();" type="radio" value="0" /> {dr_lang('解冻')} <span></span></label>
|
||||
<label class="mt-radio mt-radio-outline"><input name="data[type]" onclick="$('.type_0').hide();$('.type_1').hide();$('.type_2').show();" type="radio" value="2" /> {dr_lang('指定值')} <span></span></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="dr_row_value">
|
||||
<label class="col-md-2 control-label">{dr_lang('处理金额')}</label>
|
||||
<div class="col-md-9">
|
||||
<label><input type="text" class="form-control input-large" id="dr_value" name="data[value]"></label>
|
||||
<span class="help-block type_1"> {dr_lang('冻结余额增加,账户余额-处理金额=账户实际金额')} </span>
|
||||
<span class="help-block type_0" style="display: none"> {dr_lang('冻结余额减少,账户余额+处理金额=账户实际金额')} </span>
|
||||
<span class="help-block type_2" style="display: none"> {dr_lang('冻结余额设置为处理金额,账户实际金额不变')} </span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="dr_row_note">
|
||||
<label class="col-md-2 control-label">{dr_lang('备注说明')}</label>
|
||||
<div class="col-md-9">
|
||||
<textarea class="form-control" id="dr_note" name="data[note]" rows="4"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form myfooter">
|
||||
<div class="form-actions text-center">
|
||||
<button type="button" onclick="dr_ajax_submit('{dr_now_url()}', 'myform')" class="btn blue"> <i class="fa fa-save"></i> {dr_lang('确定操作')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{template "footer.html"}
|
||||
@@ -0,0 +1,252 @@
|
||||
{template "header.html"}
|
||||
<style>
|
||||
.dr-pay-wrap .portlet-body { padding-top: 0; }
|
||||
.dr-pay-wrap .dr-pay-layout {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.dr-pay-side {
|
||||
width: 200px;
|
||||
flex: 0 0 200px;
|
||||
border-right: 1px solid #eef1f5;
|
||||
padding: 8px 0 20px;
|
||||
min-height: 0;
|
||||
}
|
||||
.dr-pay-side .nav-pills > li { float: none; margin: 0; }
|
||||
.dr-pay-side .nav-pills > li > a {
|
||||
border-radius: 0;
|
||||
color: #666;
|
||||
padding: 11px 12px 11px 14px;
|
||||
border-left: 2px solid transparent;
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
}
|
||||
.dr-pay-side .nav-pills > li > a:hover {
|
||||
background: #f7f9fc;
|
||||
color: #333;
|
||||
}
|
||||
.dr-pay-side .nav-pills > li.active > a,
|
||||
.dr-pay-side .nav-pills > li.active > a:hover,
|
||||
.dr-pay-side .nav-pills > li.active > a:focus {
|
||||
background: #f0f7ff;
|
||||
color: #2890ff;
|
||||
border-left-color: #28b6ff;
|
||||
font-weight: 600;
|
||||
}
|
||||
.dr-pay-side .nav-pills > li > a .dr-pay-icon {
|
||||
margin-right: 4px;
|
||||
color: #8896a6;
|
||||
}
|
||||
.dr-pay-side .nav-pills > li.active > a .dr-pay-icon {
|
||||
color: #2890ff;
|
||||
}
|
||||
.dr-pay-side .badge {
|
||||
float: right;
|
||||
margin-top: 1px;
|
||||
margin-left: 6px;
|
||||
background: #eef1f5;
|
||||
color: #8896a6;
|
||||
font-weight: 500;
|
||||
font-size: 11px;
|
||||
padding: 3px 6px;
|
||||
}
|
||||
.dr-pay-side .badge.dr-pay-on {
|
||||
background: #28b6ff;
|
||||
color: #fff;
|
||||
}
|
||||
.dr-pay-side .ui-sortable-helper {
|
||||
background: #fff;
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,.08);
|
||||
}
|
||||
.dr-pay-side .ui-sortable-placeholder {
|
||||
visibility: visible !important;
|
||||
background: #f0f7ff;
|
||||
border-left: 2px dashed #28b6ff;
|
||||
height: 40px;
|
||||
margin: 0;
|
||||
}
|
||||
.dr-pay-main {
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
margin-left: 0;
|
||||
padding: 8px 10px 20px 20px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.dr-pay-main .dr-pay-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 6px 0 14px;
|
||||
margin-bottom: 10px;
|
||||
border-bottom: 1px solid #eef1f5;
|
||||
}
|
||||
.dr-pay-main .dr-pay-head h4 {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
.dr-pay-main .dr-pay-head .dr-pay-sort-tip {
|
||||
color: #8896a6;
|
||||
font-size: 12px;
|
||||
}
|
||||
/* 配置区拉满右侧宽度;用 flex 避免与侧栏 float/clear 互相影响 */
|
||||
.dr-pay-main .form-body > .form-group {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
.dr-pay-main .form-body > .form-group:before,
|
||||
.dr-pay-main .form-body > .form-group:after {
|
||||
display: none !important;
|
||||
content: none !important;
|
||||
}
|
||||
.dr-pay-main .form-body > .form-group > .control-label.col-md-2 {
|
||||
width: 140px;
|
||||
flex: 0 0 140px;
|
||||
float: none !important;
|
||||
padding-top: 7px;
|
||||
}
|
||||
.dr-pay-main .form-body > .form-group > .col-md-9 {
|
||||
flex: 1 1 auto;
|
||||
width: auto !important;
|
||||
float: none !important;
|
||||
margin-left: 0;
|
||||
padding-left: 15px;
|
||||
padding-right: 0;
|
||||
}
|
||||
.dr-pay-main .form-control,
|
||||
.dr-pay-main .form-control.input-large,
|
||||
.dr-pay-main .form-control.input-xlarge,
|
||||
.dr-pay-main .form-control.input-medium,
|
||||
.dr-pay-main textarea.form-control {
|
||||
width: 100% !important;
|
||||
max-width: 100%;
|
||||
}
|
||||
.dr-pay-tip {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
@media (max-width: 991px) {
|
||||
.dr-pay-wrap .dr-pay-layout {
|
||||
display: block;
|
||||
}
|
||||
.dr-pay-side {
|
||||
width: 100%;
|
||||
flex: none;
|
||||
border-right: 0;
|
||||
border-bottom: 1px solid #eef1f5;
|
||||
margin-bottom: 10px;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.dr-pay-main {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="note note-danger dr-pay-tip">
|
||||
<p><a href="javascript:dr_update_cache('member', '');">{dr_lang('更改数据之后需要更新缓存之后才能生效')}</a></p>
|
||||
</div>
|
||||
|
||||
<form action="" class="form-horizontal" method="post" name="myform" id="myform">
|
||||
{$form}
|
||||
<div class="myfbody">
|
||||
<div class="portlet light bordered dr-pay-wrap">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-credit-card font-green"></i>
|
||||
<span class="caption-subject font-green sbold">{dr_lang('支付接口')}</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
{if !IS_OEM_CMS}
|
||||
<a href="https://www.xunruicms.com/api/xunrui.php?at=pay" class="btn blue btn-sm" target="_blank">
|
||||
<i class="fa fa-cloud-download"></i> {dr_lang('更多支付接口')}
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="dr-pay-layout">
|
||||
<div class="dr-pay-side">
|
||||
<ul class="nav nav-pills nav-stacked field-sort-items" id="dr_pay_nav" role="tablist">
|
||||
{php $dr_pay_n = 0;}
|
||||
{loop $data $dir $t}
|
||||
{if is_file(ROOTPATH.'api/pay/'.$dir.'/setting.php')}
|
||||
<li class="{if !$dr_pay_n}active{/if}" data-dir="{$dir}">
|
||||
<a href="#dr_pay_tab_{$dir}" data-toggle="tab" title="{dr_lang($t.config.name)}">
|
||||
<span class="dr-pay-icon">{$t.config.icon}</span>{dr_lang($t.config.name)}
|
||||
<span class="badge {if $t['use']}dr-pay-on{/if}">{if $t['use']}{dr_lang('启用')}{else}{dr_lang('关闭')}{/if}</span>
|
||||
</a>
|
||||
</li>
|
||||
{php $dr_pay_n++;}
|
||||
{/if}
|
||||
{/loop}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="dr-pay-main">
|
||||
<div class="tab-content" id="dr_pay_content">
|
||||
{php $dr_pay_n = 0;}
|
||||
{loop $data $dir $t}
|
||||
{if is_file(ROOTPATH.'api/pay/'.$dir.'/setting.php')}
|
||||
<div class="tab-pane {if !$dr_pay_n}active{/if}" id="dr_pay_tab_{$dir}" data-dir="{$dir}">
|
||||
<div class="dr-pay-head">
|
||||
<h4>{$t.config.icon} {dr_lang($t.config.name)}</h4>
|
||||
<span class="dr-pay-sort-tip"><i class="fa fa-arrows"></i> {dr_lang('左侧可拖动排序')}</span>
|
||||
</div>
|
||||
<div class="form-body">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('启用')}</label>
|
||||
<div class="col-md-9">
|
||||
<input type="checkbox" name="data[{$dir}][use]" value="1" {if $t['use']}checked{/if} data-on-text="{dr_lang('启用')}" data-off-text="{dr_lang('关闭')}" data-on-color="success" data-off-color="danger" class="make-switch dr-pay-use" data-size="small" data-dir="{$dir}">
|
||||
</div>
|
||||
</div>
|
||||
<?php require ROOTPATH.'api/pay/'.$dir.'/setting.php';?>
|
||||
</div>
|
||||
</div>
|
||||
{php $dr_pay_n++;}
|
||||
{/if}
|
||||
{/loop}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body form myfooter">
|
||||
<div class="form-actions text-center">
|
||||
<button type="button" onclick="dr_ajax_submit('{dr_now_url()}&page='+$('#dr_page').val(), 'myform', '2000')" class="btn green"> <i class="fa fa-save"></i> {dr_lang('保存')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$("#dr_pay_nav").sortable({
|
||||
axis: 'y',
|
||||
helper: 'clone',
|
||||
update: function() {
|
||||
var $content = $('#dr_pay_content');
|
||||
$('#dr_pay_nav > li').each(function() {
|
||||
var id = $(this).find('a').attr('href');
|
||||
$content.append($(id));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('.dr-pay-use').on('switchChange.bootstrapSwitch', function(e, state) {
|
||||
var dir = $(this).data('dir');
|
||||
var $badge = $('#dr_pay_nav > li[data-dir="'+dir+'"] .badge');
|
||||
if (state) {
|
||||
$badge.addClass('dr-pay-on').text('{dr_lang('启用')}');
|
||||
} else {
|
||||
$badge.removeClass('dr-pay-on').text('{dr_lang('关闭')}');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{template "footer.html"}
|
||||
@@ -0,0 +1,92 @@
|
||||
{template "header.html"}
|
||||
<div class="note note-danger">
|
||||
<p><a href="javascript:dr_update_cache('member', '');">{dr_lang('更改数据之后需要更新缓存之后才能生效')}</a></p>
|
||||
</div>
|
||||
<form action="" class="form-horizontal" method="post" name="myform" id="myform">
|
||||
{$form}
|
||||
<div class="portlet bordered light myfbody">
|
||||
<div class="portlet-title tabbable-line">
|
||||
<ul class="nav nav-tabs" style="float:left;">
|
||||
<li class="{if $page==0}active{/if}">
|
||||
<a href="#tab_0" data-toggle="tab" onclick="$('#dr_page').val('0')"> <i class="fa fa-cog"></i> {dr_lang('支付设置')} </a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane {if $page==0}active{/if}" id="tab_0">
|
||||
|
||||
<div class="form-body">
|
||||
|
||||
{if dr_is_app('explog')}
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('经验')}</label>
|
||||
<div class="col-md-9">
|
||||
<label><input class="form-control" type="text" name="data[experience]" value="{htmlspecialchars((string)$data['experience'])}" ></label>
|
||||
<span class="help-block">{dr_lang('例如“经验值”,“升级值”等等')}</span>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if dr_is_app('scorelog')}
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('金币')}</label>
|
||||
<div class="col-md-9">
|
||||
<label><input class="form-control" type="text" name="data[score]" value="{htmlspecialchars((string)$data['score'])}" ></label>
|
||||
<span class="help-block">{dr_lang('例如“积分”,“点”,“金”等等')}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('1元兑换')}</label>
|
||||
<div class="col-md-9">
|
||||
<label><input class="form-control input-small" style="width:75px!important;" type="text" name="data[convert]" value="{htmlspecialchars((string)$data['convert'])}" /></label>
|
||||
<label> {SITE_SCORE}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('最小充值%s', SITE_SCORE)}</label>
|
||||
<div class="col-md-9">
|
||||
<label><input class="form-control" type="text" name="data[score_min]" value="{htmlspecialchars((string)$data['score_min'])}" ></label>
|
||||
<span class="help-block">{dr_lang('用户中心在线充值或兑换%s的最小值', SITE_SCORE)}</span>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('最小充值%s', dr_lang('金额'))}</label>
|
||||
<div class="col-md-9">
|
||||
<label><input class="form-control " type="text" name="data[min]" value="{htmlspecialchars((string)$data['min'])}" /></label>
|
||||
<label> {dr_lang('元')}</label>
|
||||
<span class="help-block">{dr_lang('用户中心在线充值功能的最小充值金额')}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('支付号前缀')}</label>
|
||||
<div class="col-md-9">
|
||||
<label><input class="form-control " type="text" name="data[prefix]" value="{htmlspecialchars((string)$data['prefix'])}" /></label>
|
||||
<span class="help-block">{dr_lang('用于生成唯一支付id前缀,只允许填写字母')}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('最大记录年限')}</label>
|
||||
<div class="col-md-9">
|
||||
<label><input class="form-control " type="text" name="data[year]" value="{intval((string)$data['year'])}" /></label>
|
||||
<span class="help-block">{dr_lang('用户中心查看支付流水时,最大允许查看年限,0表示不限制')}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="portlet-body form myfooter">
|
||||
<div class="form-actions text-center">
|
||||
<button type="button" onclick="dr_ajax_submit('{dr_now_url()}&page='+$('#dr_page').val(), 'myform', '2000')" class="btn green"> <i class="fa fa-save"></i> {dr_lang('保存')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{template "footer.html"}
|
||||
@@ -0,0 +1,159 @@
|
||||
{template "header.html"}
|
||||
<div class="note note-danger">
|
||||
<p>{dr_lang('单笔交易的详细内容')}</p>
|
||||
</div>
|
||||
<form action="" class="form-horizontal" method="post" name="myform" id="myform">
|
||||
{dr_form_hidden()}
|
||||
<input type="hidden" name="is_ajax" value="1" />
|
||||
<input type="hidden" name="ids[]" value="{$data.id}" />
|
||||
<div class="portlet bordered light myfbody">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<span class="caption-subject font-green">{$data.title}</span>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="btn-group">
|
||||
<a class="btn" href="{$reply_url}"> <i class="fa fa-mail-reply"></i> {dr_lang('返回列表')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<div class="form-body">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('识别码')}</label>
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static">
|
||||
{$data.mid}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('流水号')}</label>
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static">
|
||||
{if $data.url}
|
||||
<a href="{$data.url}" target="_blank">{$data.id}</a>
|
||||
{else}
|
||||
{$data.id}
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('交易详情')}</label>
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static">
|
||||
{if $data.url}
|
||||
<a href="{$data.url}" target="_blank">{$data.title}</a>
|
||||
{else}
|
||||
{$data.title}
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('用途类型')}</label>
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static"> {php echo \Phpcmf\Service::M('Pay','pay')->paytype($data.mid)} </p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('交易账号')}</label>
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static"> {if $data.uid}{Function_list::uid($data.uid)}{else} {dr_lang('游客')}{/if}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('对方账号')}</label>
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static"> {if $data.touid}{Function_list::uid($data.touid)} {else} <a>{dr_lang('系统')}</a> {/if} </p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('流水金额')}</label>
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static"> <b>{dr_pay_money_html($data.value)}</b> </p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('付款方式')}</label>
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static"> {dr_lang(dr_pay_type_html($data.type))} </p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('支付状态')}</label>
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static">{php echo \Phpcmf\Service::M('Pay','pay')->paystatus($data)}</p>
|
||||
</div>
|
||||
</div>
|
||||
{if $data.paytime}
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('付款时间')}</label>
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static"> {dr_date($data.paytime)} </p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $data.result}
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('备注信息')}</label>
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static"> {$data.result} </p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{dr_lang('创建时间')}</label>
|
||||
<div class="col-md-9">
|
||||
<p class="form-control-static"> {dr_date($data.inputtime)} </p>
|
||||
</div>
|
||||
</div>
|
||||
{if $is_remit && $data.status == 2 && $data.type == 'remit'}
|
||||
<div class="form-group" id="dr_row_verify">
|
||||
<label class="col-md-2 control-label">{dr_lang('审核状态')}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="mt-radio-inline">
|
||||
<label class="mt-radio mt-radio-outline"><input type="radio" name="post[verify]" value="1" /> {dr_lang('确定')} <span></span></label>
|
||||
<label class="mt-radio mt-radio-outline"><input type="radio" name="post[verify]" value="0" /> {dr_lang('拒绝')} <span></span></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="dr_row_note">
|
||||
<label class="col-md-2 control-label">{dr_lang('审核备注')}</label>
|
||||
<div class="col-md-9">
|
||||
<textarea class="form-control" id="dr_note" name="post[note]" rows="4"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
{else if $is_meet && $data.status == 5 && $data.type == 'meet'}
|
||||
<div class="form-group" id="dr_row_verify">
|
||||
<label class="col-md-2 control-label">{dr_lang('审核状态')}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="mt-radio-inline">
|
||||
<label class="mt-radio mt-radio-outline"><input type="radio" name="post[verify]" value="1" /> {dr_lang('确定收款')} <span></span></label>
|
||||
<label class="mt-radio mt-radio-outline"><input type="radio" name="post[verify]" value="0" /> {dr_lang('关闭')} <span></span></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="dr_row_note">
|
||||
<label class="col-md-2 control-label">{dr_lang('审核备注')}</label>
|
||||
<div class="col-md-9">
|
||||
<textarea class="form-control" id="dr_note" name="post[note]" rows="4"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form myfooter">
|
||||
<div class="form-actions text-center">
|
||||
{if ($is_remit && $data.status == 2 && $data.type == 'remit') || ($is_meet && $data.status == 5 && $data.type == 'meet')}
|
||||
<button type="button" onclick="dr_ajax_submit('{dr_now_url()}&page='+$('#dr_page').val(), 'myform', '2000')" class="btn green"> <i class="fa fa-save"></i> {dr_lang('提交')}</button>
|
||||
{/if}
|
||||
<button type="button" onclick="dr_ajax_option_url('{dr_url('pay/paylog/del')}', '{dr_lang('你确定要删除吗?')}', '{$reply_url}')" class="btn red "> <i class="fa fa-trash"></i> {dr_lang('删除')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{template "footer.html"}
|
||||
@@ -0,0 +1,115 @@
|
||||
{template "header.html"}
|
||||
|
||||
{template "api_list_date_search.html"}
|
||||
|
||||
<div class="right-card-box">
|
||||
<div class="row table-search-tool">
|
||||
<form action="{SELF}" method="get">
|
||||
{dr_form_search_hidden()}
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<label>
|
||||
<select name="field" class="form-control">
|
||||
<option value="id"> {dr_lang('流水号')} </option>
|
||||
{loop $field $t}
|
||||
{if dr_is_admin_search_field($t)}
|
||||
<option value="{$t.fieldname}" {if $param.field==$t.fieldname}selected{/if}>{$t.name}</option>
|
||||
{/if}
|
||||
{/loop}
|
||||
</select>
|
||||
</label>
|
||||
<label><i class="fa fa-caret-right"></i></label>
|
||||
<label><input type="text" class="form-control" placeholder="" value="{$param['keyword']}" name="keyword" /></label>
|
||||
</div>
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<label>
|
||||
<div class="input-group input-medium date-picker input-daterange" data-date="" data-date-format="yyyy-mm-dd">
|
||||
<input type="text" class="form-control" value="{$param.date_form}" name="date_form">
|
||||
<span class="input-group-addon"> {dr_lang('到')} </span>
|
||||
<input type="text" class="form-control" value="{$param.date_to}" name="date_to">
|
||||
</div>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-sm-12">
|
||||
<label><button type="submit" class="btn blue btn-sm onloading" name="submit" > <i class="fa fa-search"></i> {dr_lang('搜索')}</button></label>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<form class="form-horizontal" role="form" id="myform">
|
||||
{dr_form_hidden()}
|
||||
<div class="table-scrollable">
|
||||
<table class="table table-striped table-bordered table-hover table-checkable dataTable">
|
||||
<thead>
|
||||
<tr class="heading">
|
||||
{if $ci->_is_admin_auth('del')}
|
||||
<th class="myselect">
|
||||
<label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
|
||||
<input type="checkbox" class="group-checkable" data-set=".checkboxes" />
|
||||
<span></span>
|
||||
</label>
|
||||
</th>
|
||||
{/if}
|
||||
<th style="text-align:center" width="70" class="{dr_sorting('mid')}" name="mid">{dr_lang('用途')}</th>
|
||||
<th width="110" class="{dr_sorting('uid')}" name="uid">{dr_lang('账号')}</th>
|
||||
<th class="{dr_sorting('title')}" name="title">{dr_lang('说明')}</th>
|
||||
<th width="120" class="{dr_sorting('value')}" name="value" style="padding-left:20px">{dr_lang('金额')}</th>
|
||||
<th width="120" class="{dr_sorting('money')}" name="money" style="text-align:center">{dr_lang('余额')}</th>
|
||||
<th style="text-align:center" width="90" class="{dr_sorting('type')}" name="type">付款</th>
|
||||
<th style="text-align:center" width="80" class="{dr_sorting('status')}" name="status">{dr_lang('状态')}</th>
|
||||
<th width="170" class="{dr_sorting('inputtime')}" name="inputtime">{dr_lang('时间')}</th>
|
||||
<th width="150">{dr_lang('操作')}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{loop $list $t}
|
||||
<tr class="odd gradeX" id="dr_row_{$t.id}">
|
||||
{if $ci->_is_admin_auth('del')}
|
||||
<td class="myselect">
|
||||
<label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
|
||||
<input type="checkbox" class="checkboxes" name="ids[]" value="{$t.id}" />
|
||||
<span></span>
|
||||
</label>
|
||||
</td>
|
||||
{/if}
|
||||
<td style="text-align:center">{php echo \Phpcmf\Service::M('Pay','pay')->paytype($t.mid)}</td>
|
||||
<td>{if $t.uid}{Function_list::uid($t.uid)}{else}{dr_lang('游客')}{/if}</td>
|
||||
<td><a href="javascript:dr_layer_tips('{str_replace('"', '', $t.title)}');" class="tooltips" data-container="body" data-placement="top" data-original-title="{str_replace('"', '', $t.title)}">{dr_strcut($t.title, 30)}</a></td>
|
||||
<td><b>{dr_pay_money_html($t.value)}</b></td>
|
||||
<td style="text-align:center"><b>{dr_price_value($t.money)}</b></td>
|
||||
<td style="text-align:center">{dr_pay_type_html($t.type)}</td>
|
||||
<td style="text-align:center">{php echo \Phpcmf\Service::M('Pay','pay')->paystatus($t)}</td>
|
||||
<td>{dr_date($t.inputtime, null, 'red')}</td>
|
||||
<td>
|
||||
{if $ci->_is_admin_auth('edit')}
|
||||
<label><a href="{dr_url($uriprefix.'/edit', ['id'=>$t.id])}" class="btn btn-xs green"> <i class="fa fa-edit"></i> {dr_lang('详情')}</a></label>
|
||||
{if $t.status && $t.mid=='recharge'}
|
||||
<label><a href="javascript:dr_iframe('{dr_lang('系统回收')}', '{dr_url('pay/paylog/system_edit', ['id'=>$t.id])}');" class="btn btn-xs red"> <i class="fa fa-rmb"></i> {dr_lang('回收')}</a></label>
|
||||
{/if}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="row fc-list-footer table-checkable ">
|
||||
<div class="col-md-5 fc-list-select">
|
||||
{if $ci->_is_admin_auth('del')}
|
||||
<label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
|
||||
<input type="checkbox" class="group-checkable" data-set=".checkboxes" />
|
||||
<span></span>
|
||||
</label>
|
||||
<label><button type="button" onclick="dr_ajax_option('{dr_url('pay/paylog/del')}', '{dr_lang('你确定要删除吗?')}', 1)" class="btn red btn-sm"> <i class="fa fa-trash"></i> {dr_lang('删除')}</button></label>
|
||||
<label><button type="button" onclick="dr_ajax_option('{dr_url('pay/paylog/notice_del')}', '{dr_lang('你确定要通知他们吗?')}', 1)" class="btn green btn-sm"> <i class="fa fa-envelope"></i> {dr_lang('短信催付')}</button></label>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-md-7 fc-list-page">
|
||||
{$mypages}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{template "footer.html"}
|
||||
@@ -0,0 +1,42 @@
|
||||
{template "header.html"}
|
||||
|
||||
<form class="form-horizontal" method="post" role="form" id="myform">
|
||||
{$form}
|
||||
<div class="form-body">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label ajax_name">{dr_lang('付款账号')}</label>
|
||||
<div class="col-xs-7">
|
||||
<p class="form-control-static"> {Function_list::author($user.username)} </p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label ajax_name">{dr_lang('账户余额')}</label>
|
||||
<div class="col-xs-7">
|
||||
<p class="form-control-static"> {$user.money} </p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label ajax_name">{dr_lang('回收金额')}</label>
|
||||
<div class="col-xs-7">
|
||||
<p class="form-control-static"> {dr_pay_money_html($data.value)} </p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="dr_row_note">
|
||||
<label class="col-xs-3 control-label ajax_name">{dr_lang('回收备注')}</label>
|
||||
<div class="col-xs-7">
|
||||
<textarea class="form-control" id="dr_note" name="data[note]" rows="4"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label ajax_name">{dr_lang('操作说明')}</label>
|
||||
<div class="col-xs-7">
|
||||
<p class="form-control-static"> {dr_lang('此功能是将本笔资金从付款账号中扣除')} </p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
{template "footer.html"}
|
||||
Reference in New Issue
Block a user