mirror of
https://gitee.com/technical-laohu/mpay.git
synced 2025-09-20 10:46:38 +08:00
插件管理更新
This commit is contained in:
parent
b4c2229cc1
commit
94de61fbda
@ -2,9 +2,9 @@ APP_DEBUG = true
|
|||||||
|
|
||||||
DB_TYPE = mysql
|
DB_TYPE = mysql
|
||||||
DB_HOST = 127.0.0.1
|
DB_HOST = 127.0.0.1
|
||||||
DB_NAME = mpay
|
DB_NAME = test
|
||||||
DB_USER = admin
|
DB_USER = test
|
||||||
DB_PASS = Aa123456
|
DB_PASS = 123456
|
||||||
DB_PORT = 3306
|
DB_PORT = 3306
|
||||||
DB_CHARSET = utf8
|
DB_CHARSET = utf8
|
||||||
DB_PREFIX = mpay_
|
DB_PREFIX = mpay_
|
6
.env
6
.env
@ -2,9 +2,9 @@ APP_DEBUG = true
|
|||||||
|
|
||||||
DB_TYPE = mysql
|
DB_TYPE = mysql
|
||||||
DB_HOST = 127.0.0.1
|
DB_HOST = 127.0.0.1
|
||||||
DB_NAME = test
|
DB_NAME = mpay
|
||||||
DB_USER = test
|
DB_USER = admin
|
||||||
DB_PASS = 123456
|
DB_PASS = Aa123456
|
||||||
DB_PORT = 3306
|
DB_PORT = 3306
|
||||||
DB_CHARSET = utf8
|
DB_CHARSET = utf8
|
||||||
DB_PREFIX = mpay_
|
DB_PREFIX = mpay_
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace app\controller;
|
namespace app\controller;
|
||||||
|
|
||||||
use think\facade\View;
|
use think\facade\View;
|
||||||
|
use payclient\LaKaLa;
|
||||||
|
|
||||||
class IndexController
|
class IndexController
|
||||||
{
|
{
|
||||||
@ -16,6 +17,8 @@ class IndexController
|
|||||||
}
|
}
|
||||||
public function test()
|
public function test()
|
||||||
{
|
{
|
||||||
return request()->domain();
|
$key = "0383d7088b6947b68e4a626af119e2bd";
|
||||||
|
|
||||||
|
return $key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,8 @@ class UserController extends BaseController
|
|||||||
$userinfo = User::find(\session('userid'))->toArray();
|
$userinfo = User::find(\session('userid'))->toArray();
|
||||||
View::assign($userinfo);
|
View::assign($userinfo);
|
||||||
View::assign('url', $this->request->domain());
|
View::assign('url', $this->request->domain());
|
||||||
|
$sign = md5($userinfo['pid'] . $userinfo['secret_key']);
|
||||||
|
View::assign('orderurl', $this->request->domain() . "/checkOrder/{$userinfo['pid']}/{$sign}");
|
||||||
return View::fetch();
|
return View::fetch();
|
||||||
}
|
}
|
||||||
// 登陆视图
|
// 登陆视图
|
||||||
|
@ -112,9 +112,9 @@ class PayManageController extends BaseController
|
|||||||
// 生成账号配置
|
// 生成账号配置
|
||||||
private function createAccountConfig($acc)
|
private function createAccountConfig($acc)
|
||||||
{
|
{
|
||||||
$platform = Platform::where('platform', $acc->getData('platform'))->find();
|
$platform = \app\controller\api\PluginController::getPluginInfo($acc->getData('platform'));
|
||||||
$user = User::where('pid', $acc->pid)->find();
|
$user = User::where('pid', $acc->pid)->find();
|
||||||
$query = var_export(\unserialize($platform->query), \true);
|
$query = var_export($platform['query'], \true);
|
||||||
$config = <<<EOF
|
$config = <<<EOF
|
||||||
<?php
|
<?php
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
@ -125,7 +125,7 @@ return [
|
|||||||
// 用户账号配置
|
// 用户账号配置
|
||||||
'user' => [
|
'user' => [
|
||||||
'pid' => {$user->pid},
|
'pid' => {$user->pid},
|
||||||
'key' => '$user->secret_key'
|
'key' => '{$user->secret_key}'
|
||||||
],
|
],
|
||||||
// 收款平台账号配置
|
// 收款平台账号配置
|
||||||
'pay' => [
|
'pay' => [
|
||||||
@ -134,7 +134,7 @@ return [
|
|||||||
// 收款平台
|
// 收款平台
|
||||||
'platform' => '{$acc->getData('platform')}',
|
'platform' => '{$acc->getData('platform')}',
|
||||||
// 插件类名
|
// 插件类名
|
||||||
'payclass' => '{$platform->class_name}',
|
'payclass' => '{$platform['class_name']}',
|
||||||
// 账号
|
// 账号
|
||||||
'account' => '{$acc->account}',
|
'account' => '{$acc->account}',
|
||||||
// 密码
|
// 密码
|
||||||
|
@ -13,7 +13,7 @@ class PluginController extends BaseController
|
|||||||
// 获取插件列表
|
// 获取插件列表
|
||||||
public function getPluginList()
|
public function getPluginList()
|
||||||
{
|
{
|
||||||
$plugin_config = $this->getPluginConfig();
|
$plugin_config = self::getPluginConfig();
|
||||||
if ($plugin_config) {
|
if ($plugin_config) {
|
||||||
return json(['code' => 0, 'msg' => 'OK', 'count' => \count($plugin_config), 'data' => $plugin_config]);
|
return json(['code' => 0, 'msg' => 'OK', 'count' => \count($plugin_config), 'data' => $plugin_config]);
|
||||||
} else {
|
} else {
|
||||||
@ -38,7 +38,7 @@ class PluginController extends BaseController
|
|||||||
$config[$key] = $value;
|
$config[$key] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$plugin_config = $this->getPluginConfig();
|
$plugin_config = self::getPluginConfig();
|
||||||
$plugin_platform = $config['platform'] ?: '';
|
$plugin_platform = $config['platform'] ?: '';
|
||||||
foreach ($plugin_config as $value) {
|
foreach ($plugin_config as $value) {
|
||||||
if ($plugin_platform == $value['platform']) {
|
if ($plugin_platform == $value['platform']) {
|
||||||
@ -52,7 +52,7 @@ class PluginController extends BaseController
|
|||||||
// 删除插件
|
// 删除插件
|
||||||
public function delPlugin($plugin_name = '')
|
public function delPlugin($plugin_name = '')
|
||||||
{
|
{
|
||||||
$plugin_config = $this->getPluginConfig();
|
$plugin_config = self::getPluginConfig();
|
||||||
$keys = [];
|
$keys = [];
|
||||||
foreach ($plugin_config as $index => $value) {
|
foreach ($plugin_config as $index => $value) {
|
||||||
if ($value['platform'] == $plugin_name) {
|
if ($value['platform'] == $plugin_name) {
|
||||||
@ -69,12 +69,12 @@ class PluginController extends BaseController
|
|||||||
// 修改插件
|
// 修改插件
|
||||||
public function setPlugin($platform = '', $option = [])
|
public function setPlugin($platform = '', $option = [])
|
||||||
{
|
{
|
||||||
$config = $this->getPluginConfig();
|
$config = self::getPluginConfig();
|
||||||
if (!$platform) {
|
if (!$platform) {
|
||||||
return 1; //'请选择插件'
|
return 1; // 请选择插件
|
||||||
}
|
}
|
||||||
if (!$option) {
|
if (!$option) {
|
||||||
return 2; //请添加插件配置
|
return 2; // 请添加插件配置
|
||||||
}
|
}
|
||||||
foreach ($config as $index => $options) {
|
foreach ($config as $index => $options) {
|
||||||
if ($options['platform'] == $platform) {
|
if ($options['platform'] == $platform) {
|
||||||
@ -103,39 +103,35 @@ class PluginController extends BaseController
|
|||||||
public function pluginOption()
|
public function pluginOption()
|
||||||
{
|
{
|
||||||
// 加载平台配置
|
// 加载平台配置
|
||||||
$config = $this->getPluginConfig();
|
$config = self::getPluginConfig();
|
||||||
$option = [];
|
$option = [];
|
||||||
foreach ($config as $value) {
|
foreach ($config as $value) {
|
||||||
$option[] = ['platform' => $value['platform'], 'name' => $value['name']];
|
$option[] = ['platform' => $value['platform'], 'name' => $value['name']];
|
||||||
}
|
}
|
||||||
return json($option);
|
return json($option);
|
||||||
}
|
}
|
||||||
// 生成插件配置
|
// 获取指定插件配置
|
||||||
public function crtPlfConfig()
|
public static function getPluginInfo($platform = '')
|
||||||
{
|
{
|
||||||
$info = Platform::where('state', 1)->field('platform, name')->select()->toArray();
|
$config = self::getPluginConfig();
|
||||||
$data = [];
|
$info = [];
|
||||||
foreach ($info as $value) {
|
foreach ($config as $item) {
|
||||||
$data[$value['platform']] = $value['name'];
|
if ($item['platform'] == $platform) {
|
||||||
}
|
$info = $item;
|
||||||
$config = View::fetch('tpl/platform_config', $data);
|
break;
|
||||||
$path = "../config/extendconfig/platform.php";
|
}
|
||||||
$res = \file_put_contents($path, $config);
|
|
||||||
if ($res) {
|
|
||||||
return \json(\backMsg(msg: '创建成功'));
|
|
||||||
} else {
|
|
||||||
return \json(\backMsg(1, '创建成功'));
|
|
||||||
}
|
}
|
||||||
|
return $info;
|
||||||
}
|
}
|
||||||
// 获取插件配置
|
// 获取插件配置
|
||||||
private function getPluginConfig(): array
|
private static function getPluginConfig(): array
|
||||||
{
|
{
|
||||||
$payplugin_path = config_path() . '/extendconfig/payplugin.php';
|
$payplugin_path = config_path() . '/extendconfig/payplugin.php';
|
||||||
if (!file_exists($payplugin_path)) {
|
if (!file_exists($payplugin_path)) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
// 加载插件配置
|
// 加载插件配置
|
||||||
$payplugin_config = require_once $payplugin_path;
|
$payplugin_config = require $payplugin_path;
|
||||||
return $payplugin_config;
|
return $payplugin_config;
|
||||||
}
|
}
|
||||||
// 保存插件配置
|
// 保存插件配置
|
||||||
|
@ -32,7 +32,7 @@ class PayAccount extends BaseModel
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
// 加载插件配置
|
// 加载插件配置
|
||||||
$payplugin_config = require_once $payplugin_path;
|
$payplugin_config = require $payplugin_path;
|
||||||
$option = [];
|
$option = [];
|
||||||
foreach ($payplugin_config as $config) {
|
foreach ($payplugin_config as $config) {
|
||||||
$option[$config['platform']] = $config['name'];
|
$option[$config['platform']] = $config['name'];
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
// | 支付插件列表
|
// | 支付插件列表
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
return array (
|
return array(
|
||||||
0 =>
|
0 =>
|
||||||
array (
|
array(
|
||||||
'platform' => 'sqbpay',
|
'platform' => 'sqbpay',
|
||||||
'name' => '收钱吧',
|
'name' => '收钱吧',
|
||||||
'class_name' => 'ShouQianBa',
|
'class_name' => 'ShouQianBa',
|
||||||
@ -13,10 +13,20 @@ return array (
|
|||||||
'describe' => '主流移动支付全能收 信用卡,花呗都能用,生意帮手收钱吧,移动收款就用它!',
|
'describe' => '主流移动支付全能收 信用卡,花呗都能用,生意帮手收钱吧,移动收款就用它!',
|
||||||
'website' => 'https://www.shouqianba.com/',
|
'website' => 'https://www.shouqianba.com/',
|
||||||
'state' => 1,
|
'state' => 1,
|
||||||
'query' => 'a:8:{s:8:"date_end";N;s:10:"date_start";N;s:4:"page";i:1;s:9:"page_size";i:10;s:13:"upayQueryType";i:0;s:6:"status";s:4:"2000";s:8:"store_sn";s:0:"";s:4:"type";s:2:"30";}',
|
'query' =>
|
||||||
|
array(
|
||||||
|
'date_end' => NULL,
|
||||||
|
'date_start' => NULL,
|
||||||
|
'page' => 1,
|
||||||
|
'page_size' => 10,
|
||||||
|
'upayQueryType' => 0,
|
||||||
|
'status' => '2000',
|
||||||
|
'store_sn' => '',
|
||||||
|
'type' => '30',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
1 =>
|
1 =>
|
||||||
array (
|
array(
|
||||||
'platform' => 'storepay',
|
'platform' => 'storepay',
|
||||||
'name' => '数字门店',
|
'name' => '数字门店',
|
||||||
'class_name' => 'ZhiHuiJingYing',
|
'class_name' => 'ZhiHuiJingYing',
|
||||||
@ -24,10 +34,19 @@ return array (
|
|||||||
'describe' => '数字门店',
|
'describe' => '数字门店',
|
||||||
'website' => 'https://store.zhihuijingyingba.com/',
|
'website' => 'https://store.zhihuijingyingba.com/',
|
||||||
'state' => 1,
|
'state' => 1,
|
||||||
'query' => 'a:7:{s:6:"pageNo";i:1;s:8:"pageSize";i:10;s:9:"payClient";i:4;s:6:"status";i:2;s:2:"_t";N;s:16:"createTime_begin";N;s:14:"createTime_end";N;}',
|
'query' =>
|
||||||
|
array(
|
||||||
|
'pageNo' => 1,
|
||||||
|
'pageSize' => 10,
|
||||||
|
'payClient' => 4,
|
||||||
|
'status' => 2,
|
||||||
|
'_t' => NULL,
|
||||||
|
'createTime_begin' => NULL,
|
||||||
|
'createTime_end' => NULL,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
2 =>
|
2 =>
|
||||||
array (
|
array(
|
||||||
'platform' => 'ysepay',
|
'platform' => 'ysepay',
|
||||||
'name' => '小Y经营',
|
'name' => '小Y经营',
|
||||||
'class_name' => 'Ysepay',
|
'class_name' => 'Ysepay',
|
||||||
@ -35,10 +54,22 @@ return array (
|
|||||||
'describe' => '为商户和消费者提供安全、便捷、高效的支付产品与服务助力商户提升运营效率,实现数字化运营',
|
'describe' => '为商户和消费者提供安全、便捷、高效的支付产品与服务助力商户提升运营效率,实现数字化运营',
|
||||||
'website' => 'https://xym.ysepay.com/',
|
'website' => 'https://xym.ysepay.com/',
|
||||||
'state' => 1,
|
'state' => 1,
|
||||||
'query' => 'a:10:{s:7:"storeNo";s:0:"";s:7:"bizType";i:3;s:7:"payType";s:0:"";s:11:"orderStatus";i:3;s:5:"trmNo";s:0:"";s:12:"operatorUser";s:0:"";s:13:"codeBoardCode";s:0:"";s:8:"pageSize";i:10;s:6:"pageNo";i:1;s:7:"orderNo";s:0:"";}',
|
'query' =>
|
||||||
|
array(
|
||||||
|
'storeNo' => '',
|
||||||
|
'bizType' => 3,
|
||||||
|
'payType' => '',
|
||||||
|
'orderStatus' => 3,
|
||||||
|
'trmNo' => '',
|
||||||
|
'operatorUser' => '',
|
||||||
|
'codeBoardCode' => '',
|
||||||
|
'pageSize' => 10,
|
||||||
|
'pageNo' => 1,
|
||||||
|
'orderNo' => '',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
3 =>
|
3 =>
|
||||||
array (
|
array(
|
||||||
'platform' => 'mqpay',
|
'platform' => 'mqpay',
|
||||||
'name' => '码钱',
|
'name' => '码钱',
|
||||||
'class_name' => 'MaQian',
|
'class_name' => 'MaQian',
|
||||||
@ -46,10 +77,24 @@ return array (
|
|||||||
'describe' => '码钱商管平台',
|
'describe' => '码钱商管平台',
|
||||||
'website' => 'https://m.hkrt.cn/',
|
'website' => 'https://m.hkrt.cn/',
|
||||||
'state' => 1,
|
'state' => 1,
|
||||||
'query' => 'a:12:{s:12:"terminalType";s:0:"";s:7:"payType";s:0:"";s:7:"payMode";s:0:"";s:11:"tradeStatus";s:1:"1";s:7:"tradeNo";s:0:"";s:7:"storeId";s:0:"";s:4:"page";i:1;s:4:"rows";i:10;s:7:"endDate";N;s:7:"endTime";N;s:9:"startDate";N;s:9:"startTime";N;}',
|
'query' =>
|
||||||
|
array(
|
||||||
|
'terminalType' => '',
|
||||||
|
'payType' => '',
|
||||||
|
'payMode' => '',
|
||||||
|
'tradeStatus' => '1',
|
||||||
|
'tradeNo' => '',
|
||||||
|
'storeId' => '',
|
||||||
|
'page' => 1,
|
||||||
|
'rows' => 10,
|
||||||
|
'endDate' => NULL,
|
||||||
|
'endTime' => NULL,
|
||||||
|
'startDate' => NULL,
|
||||||
|
'startTime' => NULL,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
4 =>
|
4 =>
|
||||||
array (
|
array(
|
||||||
'platform' => 'lklpay',
|
'platform' => 'lklpay',
|
||||||
'name' => '拉卡拉',
|
'name' => '拉卡拉',
|
||||||
'class_name' => 'LaKaLa',
|
'class_name' => 'LaKaLa',
|
||||||
@ -57,10 +102,37 @@ return array (
|
|||||||
'describe' => '数字支付,更安全,更高效',
|
'describe' => '数字支付,更安全,更高效',
|
||||||
'website' => 'https://customer.lakala.com/',
|
'website' => 'https://customer.lakala.com/',
|
||||||
'state' => 1,
|
'state' => 1,
|
||||||
'query' => '',
|
'query' =>
|
||||||
|
array(
|
||||||
|
'requestTime' => NULL,
|
||||||
|
'systemCode' => 'MERDASH',
|
||||||
|
'version' => '1.0',
|
||||||
|
'openEntity' => NULL,
|
||||||
|
'requestId' => NULL,
|
||||||
|
'pageSize' => 10,
|
||||||
|
'pageNum' => 1,
|
||||||
|
'startTime' => NULL,
|
||||||
|
'timeOption' => NULL,
|
||||||
|
'tranSts' => 'SUCCESS',
|
||||||
|
'orderNo' => NULL,
|
||||||
|
'srefno' => NULL,
|
||||||
|
'ornNo' => NULL,
|
||||||
|
'endTime' => NULL,
|
||||||
|
'startDate' => NULL,
|
||||||
|
'endDate' => NULL,
|
||||||
|
'page' => 1,
|
||||||
|
'size' => 10,
|
||||||
|
'merchantNos' => NULL,
|
||||||
|
'merInnerNos' => NULL,
|
||||||
|
),
|
||||||
|
'param' => [
|
||||||
|
'openEntity' => '822581058121GYW',
|
||||||
|
'merchantNos' => '822581058121GYW',
|
||||||
|
'merInnerNos' => '4002022071722760372',
|
||||||
|
],
|
||||||
),
|
),
|
||||||
5 =>
|
5 =>
|
||||||
array (
|
array(
|
||||||
'platform' => 'sftpay',
|
'platform' => 'sftpay',
|
||||||
'name' => '盛付通',
|
'name' => '盛付通',
|
||||||
'class_name' => 'ShengPay',
|
'class_name' => 'ShengPay',
|
||||||
@ -70,17 +142,4 @@ return array (
|
|||||||
'state' => 0,
|
'state' => 0,
|
||||||
'query' => '',
|
'query' => '',
|
||||||
),
|
),
|
||||||
6 =>
|
|
||||||
array (
|
|
||||||
'platform' => 'haopay',
|
|
||||||
'name' => '好支付',
|
|
||||||
'class_name' => 'Haopay',
|
|
||||||
'price' => 99,
|
|
||||||
'describe' => '好支付',
|
|
||||||
'website' => 'https://store.zhihuijingyingba.com/',
|
|
||||||
'state' => 0,
|
|
||||||
'query' =>
|
|
||||||
array (
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
48
config/payconfig/1001_7.php
Normal file
48
config/payconfig/1001_7.php
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
// | 支付监听配置,一个文件,一个账号
|
||||||
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
|
return [
|
||||||
|
// 用户账号配置
|
||||||
|
'user' => [
|
||||||
|
'pid' => 1001,
|
||||||
|
'key' => '953c4d682d9ab148277b76a06e215ce7'
|
||||||
|
],
|
||||||
|
// 收款平台账号配置
|
||||||
|
'pay' => [
|
||||||
|
// 账号id
|
||||||
|
'aid' => 7,
|
||||||
|
// 收款平台
|
||||||
|
'platform' => 'lklpay',
|
||||||
|
// 插件类名
|
||||||
|
'payclass' => 'LaKaLa',
|
||||||
|
// 账号
|
||||||
|
'account' => '13822254817',
|
||||||
|
// 密码
|
||||||
|
'password' => 'n8omf1FNqK+Irq9IlOPZJA==',
|
||||||
|
// 订单查询参数配置
|
||||||
|
'query' => array (
|
||||||
|
'requestTime' => NULL,
|
||||||
|
'systemCode' => 'MERDASH',
|
||||||
|
'version' => '1.0',
|
||||||
|
'openEntity' => '822581058121GYW',
|
||||||
|
'requestId' => NULL,
|
||||||
|
'pageSize' => 10,
|
||||||
|
'pageNum' => 1,
|
||||||
|
'startTime' => NULL,
|
||||||
|
'timeOption' => NULL,
|
||||||
|
'tranSts' => 'SUCCESS',
|
||||||
|
'orderNo' => NULL,
|
||||||
|
'srefno' => NULL,
|
||||||
|
'ornNo' => NULL,
|
||||||
|
'endTime' => NULL,
|
||||||
|
'startDate' => NULL,
|
||||||
|
'endDate' => NULL,
|
||||||
|
'page' => 1,
|
||||||
|
'size' => 10,
|
||||||
|
'merchantNos' => '822581058121GYW',
|
||||||
|
'merInnerNos' => '4002022071722760372',
|
||||||
|
),
|
||||||
|
]
|
||||||
|
];
|
@ -97,45 +97,49 @@ class ShouQianBa
|
|||||||
public function payQuery(array $query): array
|
public function payQuery(array $query): array
|
||||||
{
|
{
|
||||||
$token = $this->getToken();
|
$token = $this->getToken();
|
||||||
$url = $this->host . $this->find_transactions . '?client_version=7.0.0&token=' . $token;
|
if ($token) {
|
||||||
$header = ['Content-Type: application/json;charset=UTF-8'];
|
$url = $this->host . $this->find_transactions . '?client_version=7.0.0&token=' . $token;
|
||||||
// 构建订单查询
|
$header = ['Content-Type: application/json;charset=UTF-8'];
|
||||||
$now = time();
|
// 构建订单查询
|
||||||
$begin_time = ($now - 175) * 1000;
|
$now = time();
|
||||||
$end_time = $now * 1000;
|
$begin_time = ($now - 175) * 1000;
|
||||||
$query['date_start'] = $begin_time;
|
$end_time = $now * 1000;
|
||||||
$query['date_end'] = $end_time;
|
$query['date_start'] = $begin_time;
|
||||||
// 查询订单列表
|
$query['date_end'] = $end_time;
|
||||||
$res_order = $this->getHttpResponse($url, $header, json_encode($query));
|
// 查询订单列表
|
||||||
$arr_res = json_decode($res_order, true);
|
$res_order = $this->getHttpResponse($url, $header, json_encode($query));
|
||||||
$list = [];
|
$arr_res = json_decode($res_order, true);
|
||||||
if ($arr_res['code'] === 50000) {
|
$list = [];
|
||||||
$list = $arr_res['data']['records'];
|
if ($arr_res['code'] === 50000) {
|
||||||
}
|
$list = $arr_res['data']['records'];
|
||||||
// 重构订单流水,返回数组
|
|
||||||
$moneyList = [];
|
|
||||||
if ($list) {
|
|
||||||
$order_no = [];
|
|
||||||
$payway = [];
|
|
||||||
$price = [];
|
|
||||||
$channel = [];
|
|
||||||
$payways = [2 => 'alipay', 3 => 'wxpay'];
|
|
||||||
foreach ($list as $value) {
|
|
||||||
// 平台订单流水号
|
|
||||||
$order_no[] = $value['order_sn'];
|
|
||||||
// 支付类型
|
|
||||||
$payway[] = $payways[$value['payway']];
|
|
||||||
// 收款金额
|
|
||||||
$price[] = $value['original_amount'] / 100;
|
|
||||||
// 收款渠道(二维码编号)
|
|
||||||
$channel[] = $value['terminal_device_fingerprint'];
|
|
||||||
}
|
}
|
||||||
$moneyList['order_no'] = $order_no;
|
// 重构订单流水,返回数组
|
||||||
$moneyList['payway'] = $payway;
|
$moneyList = [];
|
||||||
$moneyList['price'] = $price;
|
if ($list) {
|
||||||
$moneyList['channel'] = $channel;
|
$order_no = [];
|
||||||
|
$payway = [];
|
||||||
|
$price = [];
|
||||||
|
$channel = [];
|
||||||
|
$payways = [2 => 'alipay', 3 => 'wxpay'];
|
||||||
|
foreach ($list as $value) {
|
||||||
|
// 平台订单流水号
|
||||||
|
$order_no[] = $value['order_sn'];
|
||||||
|
// 支付类型
|
||||||
|
$payway[] = $payways[$value['payway']];
|
||||||
|
// 收款金额
|
||||||
|
$price[] = $value['original_amount'] / 100;
|
||||||
|
// 收款渠道(二维码编号)
|
||||||
|
$channel[] = $value['terminal_device_fingerprint'];
|
||||||
|
}
|
||||||
|
$moneyList['order_no'] = $order_no;
|
||||||
|
$moneyList['payway'] = $payway;
|
||||||
|
$moneyList['price'] = $price;
|
||||||
|
$moneyList['channel'] = $channel;
|
||||||
|
}
|
||||||
|
return $moneyList;
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
}
|
}
|
||||||
return $moneyList;
|
|
||||||
}
|
}
|
||||||
// 请求外部资源
|
// 请求外部资源
|
||||||
private function getHttpResponse($url, $header = [], $post = null, $timeout = 10)
|
private function getHttpResponse($url, $header = [], $post = null, $timeout = 10)
|
||||||
|
Binary file not shown.
@ -106,6 +106,7 @@
|
|||||||
{ title: '密 码', field: 'password', align: 'center' },
|
{ title: '密 码', field: 'password', align: 'center' },
|
||||||
{ title: '启用状态', field: 'state', align: 'center', templet: '#account-state' },
|
{ title: '启用状态', field: 'state', align: 'center', templet: '#account-state' },
|
||||||
{ title: '监听模式', field: 'pattern', align: 'center' },
|
{ title: '监听模式', field: 'pattern', align: 'center' },
|
||||||
|
{ title: '监听地址', field: 'payurl', align: 'center', templet: `<div>{{# return window.location.origin + '/checkPayResult?pid='+d.pid+'&aid='+d.id }}</div>` },
|
||||||
{ title: '终端数量', field: 'channel', align: 'center', templet: '<div><a href="javascript:;" lay-event="channelList"><span class="layui-badge layui-bg-green">{{= d.channel }}</span></a></div>' },
|
{ title: '终端数量', field: 'channel', align: 'center', templet: '<div><a href="javascript:;" lay-event="channelList"><span class="layui-badge layui-bg-green">{{= d.channel }}</span></a></div>' },
|
||||||
{ title: '操作', align: 'center', fixed: 'right', templet: '<div><a href="javascript:;" class="layui-font-green" lay-event="edit"><strong>编辑</strong></a></div>' }
|
{ title: '操作', align: 'center', fixed: 'right', templet: '<div><a href="javascript:;" class="layui-font-green" lay-event="edit"><strong>编辑</strong></a></div>' }
|
||||||
]]
|
]]
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
<body class="pear-container">
|
<body class="pear-container">
|
||||||
<div style="padding: 8px;">
|
<div style="padding: 8px;">
|
||||||
<div class="layui-row layui-col-space16">
|
<div class="layui-row layui-col-space16">
|
||||||
<div class="layui-col-md4">
|
<div class="layui-col-md6">
|
||||||
<div class="layui-card">
|
<div class="layui-card">
|
||||||
<div class="userset"><a href="javascript:;" lay-on="setUser" title="设置">
|
<div class="userset"><a href="javascript:;" lay-on="setUser" title="设置">
|
||||||
<span class="icon pear-icon pear-icon-setting" style="font-size: 20px;"></span></a></div>
|
<span class="icon pear-icon pear-icon-setting" style="font-size: 20px;"></span></a></div>
|
||||||
@ -81,11 +81,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="layui-form-item" pane>
|
||||||
|
<label class="layui-form-label">订单监控</label>
|
||||||
|
<div class="layui-input-block">
|
||||||
|
<div class="layui-form-mid layui-elip" style="margin-left: 10px;color: #5f5f5f;float: none;">
|
||||||
|
<?php echo $orderurl ?>
|
||||||
|
<a href="javascript:;" lay-on="copyinfo" data-info="<?php echo $orderurl ?>"
|
||||||
|
style="float: right;" title="复制"><span
|
||||||
|
class="icon pear-icon pear-icon-survey"></span></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="layui-col-md8">
|
<div class="layui-col-md6">
|
||||||
<div class="layui-card">
|
<div class="layui-card">
|
||||||
<div class="layui-card-header">
|
<div class="layui-card-header">
|
||||||
我的文章
|
我的文章
|
||||||
|
Loading…
Reference in New Issue
Block a user