支付优化
parent
d8b69fe7d1
commit
52200d01a2
|
|
@ -219,27 +219,6 @@ class Order extends Common
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单支付展示
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-09-28
|
||||
* @desc description
|
||||
*/
|
||||
public function QrcodePay()
|
||||
{
|
||||
$params = input();
|
||||
if(empty($params['url']) || empty($params['order_no']) || empty($params['name']) || empty($params['msg']))
|
||||
{
|
||||
$this->assign('msg', '参数有误');
|
||||
return $this->fetch('public/tips_error');
|
||||
} else {
|
||||
$this->assign('params', $params);
|
||||
return $this->fetch('qrcode_pay');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付同步返回处理
|
||||
* @author Devil
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\index\controller;
|
||||
|
||||
/**
|
||||
* 支付
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-01T21:51:08+0800
|
||||
*/
|
||||
class Pay extends Common
|
||||
{
|
||||
/**
|
||||
* 构造方法
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-11-30
|
||||
* @desc description
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* 二维码支付展示
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-09-28
|
||||
* @desc description
|
||||
*/
|
||||
public function Qrcode()
|
||||
{
|
||||
$params = input();
|
||||
if(empty($params['url']) || empty($params['order_no']) || empty($params['name']) || empty($params['msg']))
|
||||
{
|
||||
$this->assign('msg', '参数有误');
|
||||
return $this->fetch('public/tips_error');
|
||||
} else {
|
||||
//print_r($params);die;
|
||||
$this->assign('params', $params);
|
||||
return $this->fetch();
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
2
application/index/view/default/order/qrcode_pay.html → application/index/view/default/pay/qrcode.html
Executable file → Normal file
2
application/index/view/default/order/qrcode_pay.html → application/index/view/default/pay/qrcode.html
Executable file → Normal file
|
|
@ -19,7 +19,7 @@
|
|||
<!-- conntent start -->
|
||||
<div class="am-g my-content">
|
||||
<div class="am-u-md-6 am-u-sm-centered">
|
||||
<div class="am-panel am-radius qrcode-pay" data-ajax-url="{{:MyUrl('index/order/paycheck', ['order_no'=>$params['order_no']])}}" data-order-no="{{$params['order_no']}}">
|
||||
<div class="am-panel am-radius qrcode-pay" data-ajax-url="{{:urldecode($params['ajax_url'])}}" data-order-no="{{$params['order_no']}}">
|
||||
<div class="am-panel-bd">
|
||||
<div class="name">{{:urldecode($params['name'])}}</div>
|
||||
<img class="qrcode-images am-img-thumbnail" src="{{:MyUrl('index/qrcode/index', ['content'=>$params['url']])}}">
|
||||
|
|
@ -44,19 +44,21 @@
|
|||
<span data-am-modal-close class="am-close">×</span>
|
||||
</div>
|
||||
<div class="am-popup-bd">
|
||||
<form class="am-form form-validation-plugins-recharge-pay" action="{{:MyUrl('admin/order/pay')}}" method="POST" request-type="ajax-reload">
|
||||
<form class="am-form form-validation-plugins-recharge-pay" action="{{:PluginsHomeUrl('wallet', 'wallet', 'rechargecreate')}}" method="POST" request-type="ajax-fun" request-value="PluginsRechargeFormBack">
|
||||
<!-- 支付方式 -->
|
||||
<div class="business-item am-form-group">
|
||||
<label>选择支付</label>
|
||||
{{if !empty($buy_payment_list)}}
|
||||
<ul class="payment-list" data-type="payment">
|
||||
{{foreach $buy_payment_list as $payment}}
|
||||
<li class="payment-items-{{$payment.id}}" data-value="{{$payment.id}}">
|
||||
{{if !empty($payment.logo)}}
|
||||
<img src="{{$payment.logo}}" />
|
||||
{{/if}}
|
||||
<span>{{$payment.name}}</span>
|
||||
</li>
|
||||
{{if !in_array($payment['payment'], config('shopxo.under_line_list'))}}
|
||||
<li class="payment-items-{{$payment.id}}" data-value="{{$payment.id}}">
|
||||
{{if !empty($payment.logo)}}
|
||||
<img src="{{$payment.logo}}" />
|
||||
{{/if}}
|
||||
<span>{{$payment.name}}</span>
|
||||
</li>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
|
|
@ -82,4 +84,17 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function PluginsRechargeFormBack(e)
|
||||
{
|
||||
if(e.code == 0)
|
||||
{
|
||||
window.location.href = e.data;
|
||||
} else {
|
||||
$('form.form-validation-plugins-recharge-pay').find('button[type="submit"]').button('reset');
|
||||
$.AMUI.progress.done();
|
||||
Prompt(e.msg);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -42,11 +42,13 @@
|
|||
<table class="am-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>操作类型</th>
|
||||
<th class="am-hide-sm-only">描述</th>
|
||||
<th>原始积分</th>
|
||||
<th>最新积分</th>
|
||||
<th class="am-hide-sm-only">时间</th>
|
||||
<th>充值单号</th>
|
||||
<th>充值金额(元)</th>
|
||||
<th>支付方式</th>
|
||||
<th>状态</th>
|
||||
<th class="am-hide-sm-only">支付时间</th>
|
||||
<th class="am-hide-sm-only">创建时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -63,7 +65,7 @@
|
|||
{{/if}}
|
||||
{{if empty($data_list)}}
|
||||
<tr>
|
||||
<td colspan="5">
|
||||
<td colspan="7">
|
||||
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace app\plugins\wallet;
|
|||
use think\Db;
|
||||
use app\service\PluginsService;
|
||||
use app\service\ResourcesService;
|
||||
use app\service\UserService;
|
||||
use app\service\PaymentService;
|
||||
|
||||
/**
|
||||
* 会员等级服务层
|
||||
|
|
@ -36,206 +36,86 @@ class Service
|
|||
];
|
||||
|
||||
/**
|
||||
* 获取等级数据列表
|
||||
* 充值订单创建
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-22
|
||||
* @date 2019-04-29
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function LevelDataList($params = [])
|
||||
{
|
||||
// 数据字段
|
||||
$data_field = 'level_list';
|
||||
|
||||
// 获取数据
|
||||
$ret = PluginsService::PluginsData('wallet', self::$base_config_attachment_field);
|
||||
$data = (empty($ret['data']) || empty($ret['data'][$data_field])) ? [] : $ret['data'][$data_field];
|
||||
|
||||
// 数据处理
|
||||
return self::LevelDataHandle($data, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户等级数据列表处理
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-04-27T01:08:23+0800
|
||||
* @param [array] $data [等级数据]
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function LevelDataHandle($data, $params = [])
|
||||
{
|
||||
if(!empty($data))
|
||||
{
|
||||
$common_is_enable_tips = lang('common_is_enable_tips');
|
||||
foreach($data as &$v)
|
||||
{
|
||||
// 是否启用
|
||||
$v['is_enable_text'] = $common_is_enable_tips[$v['is_enable']]['name'];
|
||||
|
||||
// 图片地址
|
||||
$v['images_url_old'] = $v['images_url'];
|
||||
$v['images_url'] = ResourcesService::AttachmentPathViewHandle($v['images_url']);
|
||||
|
||||
// 时间
|
||||
$v['operation_time_time'] = empty($v['operation_time']) ? '' : date('Y-m-d H:i:s', $v['operation_time']);
|
||||
$v['operation_time_date'] = empty($v['operation_time']) ? '' : date('Y-m-d', $v['operation_time']);
|
||||
}
|
||||
}
|
||||
|
||||
// 是否读取单条
|
||||
if(!empty($params['get_id']) && isset($data[$params['get_id']]))
|
||||
{
|
||||
$data = $data[$params['get_id']];
|
||||
}
|
||||
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取等级数据保存
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-22
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function LevelDataSave($params = [])
|
||||
public static function RechargeCreate($params = [])
|
||||
{
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'length',
|
||||
'key_name' => 'name',
|
||||
'checked_data' => '1,30',
|
||||
'error_msg' => '名称长度 1~30 个字符',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'isset',
|
||||
'key_name' => 'rules_min',
|
||||
'error_msg' => '请填写规则最小值',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'isset',
|
||||
'key_name' => 'rules_max',
|
||||
'error_msg' => '请填写规则最大值',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'max',
|
||||
'key_name' => 'discount_rate',
|
||||
'checked_data' => 0.99,
|
||||
'is_checked' => 1,
|
||||
'error_msg' => '折扣率应输入 0.00~0.99 的数字,小数保留两位',
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'user',
|
||||
'error_msg' => '用户信息有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'fun',
|
||||
'key_name' => 'order_price',
|
||||
'key_name' => 'money',
|
||||
'checked_data' => 'CheckPrice',
|
||||
'is_checked' => 1,
|
||||
'error_msg' => '请输入有效的订单满金额',
|
||||
'error_msg' => '请输入有效的充值金额',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'fun',
|
||||
'key_name' => 'full_reduction_price',
|
||||
'checked_data' => 'CheckPrice',
|
||||
'is_checked' => 1,
|
||||
'error_msg' => '请输入有效的满减金额',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'eq',
|
||||
'key_name' => 'rules_min',
|
||||
'checked_data' => $params['rules_max'],
|
||||
'error_msg' => '规则最小值不能最大值相等',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'eq',
|
||||
'key_name' => 'rules_max',
|
||||
'checked_data' => $params['rules_min'],
|
||||
'error_msg' => '规则最大值不能最小值相等',
|
||||
],
|
||||
];
|
||||
if(intval($params['rules_max']) > 0)
|
||||
{
|
||||
$p[] = [
|
||||
'checked_type' => 'max',
|
||||
'key_name' => 'rules_min',
|
||||
'checked_data' => intval($params['rules_max']),
|
||||
'error_msg' => '规则最小值不能大于最大值['.intval($params['rules_max']).']',
|
||||
];
|
||||
$p[] = [
|
||||
'checked_type' => 'min',
|
||||
'key_name' => 'rules_max',
|
||||
'checked_data' => intval($params['rules_min']),
|
||||
'error_msg' => '规则最大值不能小于最小值['.intval($params['rules_min']).']',
|
||||
];
|
||||
}
|
||||
'key_name' => 'money',
|
||||
'checked_data' => 0.01,
|
||||
'error_msg' => '请输入大于0的充值金额',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 数据字段
|
||||
$data_field = 'level_list';
|
||||
|
||||
// 附件
|
||||
$data_fields = ['images_url'];
|
||||
$attachment = ResourcesService::AttachmentParams($params, $data_fields);
|
||||
|
||||
// 数据
|
||||
// 添加
|
||||
$data = [
|
||||
'name' => $params['name'],
|
||||
'rules_min' => $params['rules_min'],
|
||||
'rules_max' => $params['rules_max'],
|
||||
'images_url' => $attachment['data']['images_url'],
|
||||
'is_enable' => isset($params['is_enable']) ? intval($params['is_enable']) : 0,
|
||||
'discount_rate' => isset($params['discount_rate']) ? $params['discount_rate'] : 0,
|
||||
'order_price' => empty($params['order_price']) ? 0.00 : PriceNumberFormat($params['order_price']),
|
||||
'full_reduction_price' => empty($params['full_reduction_price']) ? 0.00 : PriceNumberFormat($params['full_reduction_price']),
|
||||
'operation_time' => time(),
|
||||
'recharge_no' => date('YmdHis').GetNumberCode(6),
|
||||
'user_id' => $params['user']['id'],
|
||||
'money' => PriceNumberFormat($params['money']),
|
||||
'status' => 0,
|
||||
'add_time' => time(),
|
||||
|
||||
];
|
||||
|
||||
// 原有数据
|
||||
$ret = PluginsService::PluginsData('wallet', self::$base_config_attachment_field, false);
|
||||
|
||||
// 数据id
|
||||
$data['id'] = (empty($params['id']) || empty($ret['data']) || empty($ret['data'][$data_field][$params['id']])) ? date('YmdHis').GetNumberCode(6) : $params['id'];
|
||||
$ret['data'][$data_field][$data['id']] = $data;
|
||||
|
||||
// 保存
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'wallet', 'data'=>$ret['data']]);
|
||||
$params['recharge_id'] = Db::name('PluginsWalletRecharge')->insertGetId($data);
|
||||
if($params['recharge_id'] > 0)
|
||||
{
|
||||
return self::Pay($params);
|
||||
}
|
||||
return DataReturn('添加失败', -100);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据删除
|
||||
* 支付
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-12-18
|
||||
* @date 2019-04-29
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
* @param array $params [description]
|
||||
*/
|
||||
public static function DataDelete($params = [])
|
||||
public static function Pay($params = [])
|
||||
{
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'id',
|
||||
'error_msg' => '操作id有误',
|
||||
'key_name' => 'user',
|
||||
'error_msg' => '用户信息有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'recharge_id',
|
||||
'error_msg' => '充值日志id不能为空',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'payment_id',
|
||||
'error_msg' => '请选择支付方式',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
|
|
@ -244,51 +124,109 @@ class Service
|
|||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 数据字段
|
||||
$data_field = empty($params['data_field']) ? 'data_list' : $params['data_field'];
|
||||
|
||||
// 原有数据
|
||||
$ret = PluginsService::PluginsData('wallet', self::$base_config_attachment_field, false);
|
||||
$ret['data'][$data_field] = (empty($ret['data']) || empty($ret['data'][$data_field])) ? [] : $ret['data'][$data_field];
|
||||
|
||||
// 删除操作
|
||||
if(isset($ret['data'][$data_field][$params['id']]))
|
||||
// 支付方式;
|
||||
$payment = PaymentService::PaymentList(['where'=>['id'=>intval($params['payment_id']), 'is_enable'=>1, 'is_open_user'=>1]]);
|
||||
if(empty($payment[0]))
|
||||
{
|
||||
unset($ret['data'][$data_field][$params['id']]);
|
||||
return DataReturn('支付方式有误', -1);
|
||||
}
|
||||
|
||||
// 保存
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'wallet', 'data'=>$ret['data']]);
|
||||
|
||||
// 支付入口文件检查
|
||||
$pay_checked = PaymentService::EntranceFileChecked($payment[0]['payment'], 'wallet');
|
||||
if($pay_checked['code'] != 0)
|
||||
{
|
||||
// 入口文件不存在则创建
|
||||
$payment_params = [
|
||||
'payment' => $payment[0]['payment'],
|
||||
'business' => [
|
||||
['name' => 'Wallet', 'desc' => '钱包'],
|
||||
],
|
||||
'respond' => '/index/plugins/index/pluginsname/wallet/pluginscontrol/wallet/pluginsaction/respond',
|
||||
'notify' => '/index/plugins/index/pluginsname/wallet/pluginscontrol/wallet/pluginsaction/notify',
|
||||
];
|
||||
$ret = PaymentService::PaymentEntranceCreated($payment_params);
|
||||
if($ret['code'] != 0)
|
||||
{
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
// 非线上支付方式不可用
|
||||
if(in_array($payment[0]['payment'], config('shopxo.under_line_list')))
|
||||
{
|
||||
return DataReturn('不能使用非线上支付方式进行充值', -10);
|
||||
}
|
||||
|
||||
// 获取充值数据
|
||||
$recharge = Db::name('PluginsWalletRecharge')->where(['id'=>intval($params['recharge_id'])])->find();
|
||||
if(empty($recharge))
|
||||
{
|
||||
return DataReturn('充值数据不存在', -1);
|
||||
}
|
||||
if($recharge['status'] == 1)
|
||||
{
|
||||
return DataReturn('该数据已充值,请重新创建充值订单', -2);
|
||||
}
|
||||
|
||||
// 回调地址
|
||||
$url = __MY_URL__.'payment_wallet_'.strtolower($payment[0]['payment']);
|
||||
|
||||
// url模式, pathinfo模式下采用自带url生成url, 避免非index.php多余
|
||||
if(MyC('home_seo_url_model', 0) == 0)
|
||||
{
|
||||
$call_back_url = $url.'_respond.php';
|
||||
} else {
|
||||
$call_back_url = PluginsHomeUrl('wallet', 'wallet', 'respond', ['paymentname'=>$payment[0]['payment']]);
|
||||
if(stripos($call_back_url, '?') !== false)
|
||||
{
|
||||
$call_back_url = $url.'_respond.php';
|
||||
}
|
||||
}
|
||||
|
||||
// 发起支付
|
||||
$pay_data = array(
|
||||
'user' => $params['user'],
|
||||
'out_user' => md5($params['user']['id']),
|
||||
'order_id' => $recharge['id'],
|
||||
'order_no' => $recharge['recharge_no'],
|
||||
'name' => '钱包充值',
|
||||
'total_price' => $recharge['money'],
|
||||
'notify_url' => $url.'_notify.php',
|
||||
'call_back_url' => $call_back_url,
|
||||
'site_name' => MyC('home_site_name', 'ShopXO', true),
|
||||
'ajax_url' => PluginsHomeUrl('wallet', 'wallet', 'paycheck')
|
||||
);
|
||||
$pay_name = 'payment\\'.$payment[0]['payment'];
|
||||
$ret = (new $pay_name($payment[0]['config']))->Pay($pay_data);
|
||||
if(isset($ret['code']) && $ret['code'] == 0)
|
||||
{
|
||||
return $ret;
|
||||
}
|
||||
return DataReturn(empty($ret['msg']) ? '支付接口异常' : $ret['msg'], -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据状态更新
|
||||
* 支付状态校验
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2018-12-18
|
||||
* @date 2019-01-08
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function DataStatusUpdate($params = [])
|
||||
public static function RechargePayCheck($params = [])
|
||||
{
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'id',
|
||||
'error_msg' => '操作id有误',
|
||||
'key_name' => 'order_no',
|
||||
'error_msg' => '充值单号有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'field',
|
||||
'error_msg' => '操作字段有误',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'in',
|
||||
'key_name' => 'state',
|
||||
'checked_data' => [0,1],
|
||||
'error_msg' => '状态有误',
|
||||
'key_name' => 'user',
|
||||
'error_msg' => '用户信息有误',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
|
|
@ -297,161 +235,18 @@ class Service
|
|||
return DataReturn($ret, -1);
|
||||
}
|
||||
|
||||
// 数据字段
|
||||
$data_field = empty($params['data_field']) ? 'data_list' : $params['data_field'];
|
||||
|
||||
// 原有数据
|
||||
$ret = PluginsService::PluginsData('wallet', self::$base_config_attachment_field, false);
|
||||
$ret['data'][$data_field] = (empty($ret['data']) || empty($ret['data'][$data_field])) ? [] : $ret['data'][$data_field];
|
||||
|
||||
// 删除操作
|
||||
if(isset($ret['data'][$data_field][$params['id']]) && is_array($ret['data'][$data_field][$params['id']]))
|
||||
// 获取订单状态
|
||||
$where = ['recharge_no'=>$params['order_no'], 'user_id'=>$params['user']['id']];
|
||||
$recharge = Db::name('PluginsWalletRecharge')->where($where)->field('id,status')->find();
|
||||
if(empty($recharge))
|
||||
{
|
||||
$ret['data'][$data_field][$params['id']][$params['field']] = intval($params['state']);
|
||||
$ret['data'][$data_field][$params['id']]['operation_time'] = time();
|
||||
return DataReturn('充值数据不存在', -400, ['url'=>__MY_URL__]);
|
||||
}
|
||||
|
||||
// 保存
|
||||
return PluginsService::PluginsDataSave(['plugins'=>'wallet', 'data'=>$ret['data']]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 优惠价格计算
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-03-26
|
||||
* @desc description
|
||||
* @param [string] $price [商品展示金额]
|
||||
* @param [int] $plugins_discount [折扣系数]
|
||||
* @param [int] $plugins_price [减金额]
|
||||
*/
|
||||
public static function PriceCalculate($price, $plugins_discount = 0, $plugins_price = 0)
|
||||
{
|
||||
if($plugins_discount <= 0 && $plugins_price <= 0)
|
||||
if($recharge['status'] == 1)
|
||||
{
|
||||
return $price;
|
||||
return DataReturn('支付成功', 0, ['url'=>PluginsHomeUrl('wallet', 'wallet', 'recharge')]);
|
||||
}
|
||||
|
||||
// 折扣
|
||||
if($plugins_discount > 0)
|
||||
{
|
||||
if(stripos($price, '-') !== false)
|
||||
{
|
||||
$text = explode('-', $price);
|
||||
$min_price = $text[0]*$plugins_discount;
|
||||
$max_price = $text[1]*$plugins_discount;
|
||||
$price = ($min_price <= 0) ? '0.00' : PriceNumberFormat($min_price);
|
||||
$price .= '-'.(($max_price <= 0) ? '0.00' : PriceNumberFormat($max_price));
|
||||
} else {
|
||||
$price = (float) $price *$plugins_discount;
|
||||
$price = ($price <= 0) ? '0.00' : PriceNumberFormat($price);
|
||||
}
|
||||
}
|
||||
|
||||
// 减金额
|
||||
if($plugins_price > 0)
|
||||
{
|
||||
if(stripos($price, '-') !== false)
|
||||
{
|
||||
$text = explode('-', $price);
|
||||
$min_price = $text[0]-$plugins_price;
|
||||
$max_price = $text[1]-$plugins_price;
|
||||
$price = ($min_price <= 0) ? '0.00' : PriceNumberFormat($min_price);
|
||||
$price .= '-'.(($max_price <= 0) ? '0.00' : PriceNumberFormat($max_price));
|
||||
} else {
|
||||
$price = (float) $price-$plugins_price;
|
||||
$price = ($price <= 0) ? '0.00' : PriceNumberFormat($price);
|
||||
}
|
||||
}
|
||||
return $price;
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户等级匹配
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-28
|
||||
* @desc description
|
||||
* @param [array] $user [用户信息]
|
||||
*/
|
||||
public static function UserLevelMatching($user = [])
|
||||
{
|
||||
// 未指定用户信息,则从服务层读取
|
||||
if(empty($user))
|
||||
{
|
||||
$user = UserService::LoginUserInfo();
|
||||
}
|
||||
if(!empty($user))
|
||||
{
|
||||
// 缓存key
|
||||
$key = 'plugins_wallet_cache_user_level_'.$user['id'];
|
||||
$level = cache($key);
|
||||
|
||||
// 应用配置
|
||||
if(empty($level) || config('app_debug') == true)
|
||||
{
|
||||
$base = PluginsService::PluginsData('wallet', Service::$base_config_attachment_field);
|
||||
if(!empty($base['data']['level_list']))
|
||||
{
|
||||
// 匹配类型
|
||||
$value = 0;
|
||||
switch($base['data']['level_rules'])
|
||||
{
|
||||
// 积分(可用积分)
|
||||
case 0 :
|
||||
$value = isset($user['integral']) ? intval($user['integral']) : 0;
|
||||
break;
|
||||
|
||||
// 消费总额(已完成订单)
|
||||
// 订单状态(0待确认, 1已确认/待支付, 2已支付/待发货, 3已发货/待收货, 4已完成, 5已取消, 6已关闭)
|
||||
case 1 :
|
||||
$where = ['user_id'=>$user['id'], 'status'=>4];
|
||||
$value = (float) Db::name('Order')->where($where)->sum('total_price');
|
||||
break;
|
||||
}
|
||||
|
||||
// 匹配相应的等级
|
||||
$level_list = self::LevelDataHandle($base['data']['level_list']);
|
||||
foreach($level_list['data'] as $rules)
|
||||
{
|
||||
if(isset($rules['is_enable']) && $rules['is_enable'] == 1)
|
||||
{
|
||||
// 0-*
|
||||
if($rules['rules_min'] <= 0 && $rules['rules_max'] > 0 && $value < $rules['rules_max'])
|
||||
{
|
||||
$level = $rules;
|
||||
break;
|
||||
}
|
||||
|
||||
// *-*
|
||||
if($rules['rules_min'] > 0 && $rules['rules_max'] > 0 && $value >= $rules['rules_min'] && $value < $rules['rules_max'])
|
||||
{
|
||||
$level = $rules;
|
||||
break;
|
||||
}
|
||||
|
||||
// *-0
|
||||
if($rules['rules_max'] <= 0 && $rules['rules_min'] > 0 && $value > $rules['rules_min'])
|
||||
{
|
||||
$level = $rules;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 等级icon
|
||||
if(!empty($level) && empty($level['images_url']))
|
||||
{
|
||||
$level['images_url'] = empty($base['data']['default_level_images']) ? config('shopxo.attachment_host').'/static/plugins/images/wallet/level-default-images.png' : $base['data']['default_level_images'];
|
||||
}
|
||||
cache($key, $level);
|
||||
}
|
||||
}
|
||||
return $level;
|
||||
}
|
||||
return [];
|
||||
return DataReturn('支付中', -300);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -154,69 +154,14 @@ class Wallet extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* 宠物添加/编辑页面
|
||||
* 充值订单创建
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-03-15T23:51:50+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function saveinfo($params = [])
|
||||
{
|
||||
// 是否绑定
|
||||
if(!empty($params['pest_no']))
|
||||
{
|
||||
$data_params = array(
|
||||
'm' => 0,
|
||||
'n' => 1,
|
||||
'where' => ['pest_no' => $params['pest_no']],
|
||||
);
|
||||
$ret = Service::PetsList($data_params);
|
||||
if(!empty($ret['data'][0]['user_id']))
|
||||
{
|
||||
$this->assign('msg', '该宠物已被绑定');
|
||||
return $this->fetch('public/tips_error');
|
||||
}
|
||||
$this->assign('pest_no', $params['pest_no']);
|
||||
unset($params['pest_no']);
|
||||
}
|
||||
|
||||
// 获取数据
|
||||
$data = [];
|
||||
if(!empty($params['id']))
|
||||
{
|
||||
$data_params = array(
|
||||
'm' => 0,
|
||||
'n' => 1,
|
||||
'where' => ['id' => intval($params['id'])],
|
||||
);
|
||||
$ret = Service::PetsList($data_params);
|
||||
if(!empty($ret['data'][0]))
|
||||
{
|
||||
$ret['data'][0]['lose_features'] = str_replace('<br />', "\n", $ret['data'][0]['lose_features']);
|
||||
$data = $ret['data'][0];
|
||||
}
|
||||
unset($params['id']);
|
||||
}
|
||||
|
||||
$this->assign('params', $params);
|
||||
$this->assign('data', $data);
|
||||
$this->assign('pets_attribute_status_list', Service::$pets_attribute_status_list);
|
||||
$this->assign('pets_attribute_is_text_list', Service::$pets_attribute_is_text_list);
|
||||
$this->assign('pets_attribute_gender_list', Service::$pets_attribute_gender_list);
|
||||
$this->assign('pets_attribute_type_list', Service::$pets_attribute_type_list);
|
||||
return $this->fetch('../../../plugins/view/wallet/pets/saveinfo');
|
||||
}
|
||||
|
||||
/**
|
||||
* 宠物添加/编辑
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-03-15T23:51:50+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function save($params = [])
|
||||
public function rechargecreate($params = [])
|
||||
{
|
||||
// 是否ajax请求
|
||||
if(!IS_AJAX)
|
||||
|
|
@ -225,8 +170,78 @@ class Wallet extends Controller
|
|||
}
|
||||
|
||||
// 用户
|
||||
$params['user_id'] = $this->user['id'];
|
||||
return Service::PetsSave($params);
|
||||
$params['user'] = $this->user;
|
||||
return Service::RechargeCreate($params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-03-15T23:51:50+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function pay($params = [])
|
||||
{
|
||||
// 用户
|
||||
$params['user'] = $this->user;
|
||||
$ret = Service::Pay($params);
|
||||
if($ret['code'] == 0)
|
||||
{
|
||||
return redirect($ret['data']['data']);
|
||||
}
|
||||
return $ret['msg'];
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付状态校验
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2019-03-15T23:51:50+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function paycheck($params = [])
|
||||
{
|
||||
if(input('post.'))
|
||||
{
|
||||
$params['user'] = $this->user;
|
||||
return Service::RechargePayCheck($params);
|
||||
} else {
|
||||
$this->assign('msg', '非法访问');
|
||||
return $this->fetch('public/tips_error');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付同步页面
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-29
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function respond($params = [])
|
||||
{
|
||||
$this->assign('msg', '支付失败');
|
||||
return $this->fetch('public/pay_error');
|
||||
}
|
||||
|
||||
/**
|
||||
* 支付异步通知
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2019-04-29
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function notify($params = [])
|
||||
{
|
||||
$this->assign('msg', '支付成功');
|
||||
return $this->fetch('public/pay_success');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
# 充值
|
||||
CREATE TABLE `s_plugins_wallet_recharge` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||
`user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
|
||||
`recharge_no` char(60) NOT NULL DEFAULT '' COMMENT '充值单号',
|
||||
`status` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '状态(0未支付, 1已支付)',
|
||||
`money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '金额',
|
||||
`payment_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '支付方式id',
|
||||
`payment` char(60) NOT NULL DEFAULT '' COMMENT '支付方式标记',
|
||||
`payment_name` char(60) NOT NULL DEFAULT '' COMMENT '支付方式名称',
|
||||
`pay_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '支付时间',
|
||||
`add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `recharge_no` (`recharge_no`),
|
||||
KEY `status` (`status`),
|
||||
KEY `user_id` (`user_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='钱包充值 - 应用';
|
||||
|
|
@ -87,7 +87,15 @@ class OrderService
|
|||
$pay_checked = PaymentService::EntranceFileChecked($payment[0]['payment'], 'order');
|
||||
if($pay_checked['code'] != 0)
|
||||
{
|
||||
return $pay_checked;
|
||||
// 入口文件不存在则创建
|
||||
$payment_params = [
|
||||
'payment' => $payment[0]['payment'],
|
||||
];
|
||||
$ret = PaymentService::PaymentEntranceCreated($payment_params);
|
||||
if($ret['code'] != 0)
|
||||
{
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
// 回调地址
|
||||
|
|
@ -116,6 +124,7 @@ class OrderService
|
|||
'notify_url' => $url.'_notify.php',
|
||||
'call_back_url' => $call_back_url,
|
||||
'site_name' => MyC('home_site_name', 'ShopXO', true),
|
||||
'ajax_url' => MyUrl('index/order/paycheck'),
|
||||
);
|
||||
$pay_name = 'payment\\'.$payment[0]['payment'];
|
||||
$ret = (new $pay_name($payment[0]['config']))->Pay($pay_data);
|
||||
|
|
|
|||
|
|
@ -391,7 +391,7 @@ class PaymentService
|
|||
// 插件权限
|
||||
if(!is_writable(self::$payment_dir))
|
||||
{
|
||||
return DataReturn('目录没有操作权限'.'['.self::$payment_dir.']', -3);
|
||||
return DataReturn('目录没有操作权限'.'['.self::$payment_dir.']', -4);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -497,7 +497,7 @@ class PaymentService
|
|||
if(Db::name('Payment')->insertGetId($data) > 0)
|
||||
{
|
||||
// 入口文件生成
|
||||
$ret = self::PaymentEntranceCreated($payment);
|
||||
$ret = self::PaymentEntranceCreated(['payment' => $payment]);
|
||||
if($ret['code'] == 'code')
|
||||
{
|
||||
// 提交事务
|
||||
|
|
@ -573,7 +573,7 @@ class PaymentService
|
|||
}
|
||||
|
||||
// 删除入口文件
|
||||
self::PaymentEntranceDelete($payment);
|
||||
self::PaymentEntranceDelete(['payment' => $payment]);
|
||||
|
||||
return DataReturn('删除成功');
|
||||
}
|
||||
|
|
@ -603,7 +603,7 @@ class PaymentService
|
|||
if(db('Payment')->where(['payment'=>$payment])->delete())
|
||||
{
|
||||
// 删除入口文件
|
||||
self::PaymentEntranceDelete($payment);
|
||||
self::PaymentEntranceDelete(['payment' => $payment]);
|
||||
|
||||
return DataReturn('卸载成功', 0);
|
||||
}
|
||||
|
|
@ -616,21 +616,47 @@ class PaymentService
|
|||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2018-09-28T23:38:52+0800
|
||||
* @param [string] $payment [支付唯一标记]
|
||||
* @param [array] $params [输入参数]
|
||||
* @param [string] $params['payment'] [支付唯一标记]
|
||||
* @param [array] $params['business'] [处理业务, 默认配置文件读取]
|
||||
* @param [array] $params['not_notify'] [不生成异步入口]
|
||||
* @param [string] $params['respond'] [同步参数值]
|
||||
* @param [string] $params['notify'] [异步参数值]
|
||||
*/
|
||||
private static function PaymentEntranceCreated($payment)
|
||||
public static function PaymentEntranceCreated($params = [])
|
||||
{
|
||||
// 初始化
|
||||
self::Init();
|
||||
|
||||
// 权限
|
||||
$ret = self::PowerCheck();
|
||||
if($ret['code'] != 0)
|
||||
{
|
||||
return $ret;
|
||||
}
|
||||
if(empty($params['payment']))
|
||||
{
|
||||
return '支付唯一标记不能为空';
|
||||
}
|
||||
|
||||
// 不生成异步入口
|
||||
$not_notify = empty($params['not_notify']) ? config('shopxo.under_line_list') : $params['not_notify'];
|
||||
|
||||
// 处理业务
|
||||
$business_all = empty($params['business']) ? self::$payment_business_type_all : $params['business'];
|
||||
|
||||
// 同步参数值
|
||||
$respond_params = empty($params['respond']) ? '/index/{$name}/respond' : $params['respond'];
|
||||
|
||||
// 异步参数值
|
||||
$notify_params = empty($params['notify']) ? '/index/{$name}/notify' : $params['notify'];
|
||||
|
||||
// 批量创建
|
||||
foreach(self::$payment_business_type_all as $v)
|
||||
foreach($business_all as $v)
|
||||
{
|
||||
$name = strtolower($v['name']);
|
||||
$business_name = strtolower($v['name']);
|
||||
$respond_s = str_replace('{$name}', $business_name, $respond_params);
|
||||
$notify_s = str_replace('{$name}', $business_name, $notify_params);
|
||||
|
||||
if(defined('IS_ROOT_ACCESS'))
|
||||
{
|
||||
|
|
@ -643,10 +669,10 @@ $notify=<<<php
|
|||
*/
|
||||
|
||||
// 默认绑定模块
|
||||
\$_GET['s'] = '/api/{$name}notify/notify';
|
||||
\$_GET['s'] = '{$notify_s}';
|
||||
|
||||
// 支付模块标记
|
||||
define('PAYMENT_TYPE', '{$payment}');
|
||||
define('PAYMENT_TYPE', '{$params["payment"]}');
|
||||
|
||||
// 根目录入口
|
||||
define('IS_ROOT_ACCESS', true);
|
||||
|
|
@ -665,10 +691,10 @@ $respond=<<<php
|
|||
*/
|
||||
|
||||
// 默认绑定模块
|
||||
\$_GET['s'] = '/index/{$name}/respond';
|
||||
\$_GET['s'] = '{$respond_s}';
|
||||
|
||||
// 支付模块标记
|
||||
define('PAYMENT_TYPE', '{$payment}');
|
||||
define('PAYMENT_TYPE', '{$params["payment"]}');
|
||||
|
||||
// 根目录入口
|
||||
define('IS_ROOT_ACCESS', true);
|
||||
|
|
@ -689,10 +715,10 @@ $notify=<<<php
|
|||
*/
|
||||
|
||||
// 默认绑定模块
|
||||
\$_GET['s'] = '/api/{$name}notify/notify';
|
||||
\$_GET['s'] = '{$notify_s}';
|
||||
|
||||
// 支付模块标记
|
||||
define('PAYMENT_TYPE', '{$payment}');
|
||||
define('PAYMENT_TYPE', '{$params["payment"]}');
|
||||
|
||||
// 引入入口文件
|
||||
require __DIR__.'/index.php';
|
||||
|
|
@ -708,10 +734,10 @@ $respond=<<<php
|
|||
*/
|
||||
|
||||
// 默认绑定模块
|
||||
\$_GET['s'] = '/index/{$name}/respond';
|
||||
\$_GET['s'] = '{$respond_s}';
|
||||
|
||||
// 支付模块标记
|
||||
define('PAYMENT_TYPE', '{$payment}');
|
||||
define('PAYMENT_TYPE', '{$params["payment"]}');
|
||||
|
||||
// 引入入口文件
|
||||
require __DIR__.'/index.php';
|
||||
|
|
@ -719,12 +745,12 @@ require __DIR__.'/index.php';
|
|||
php;
|
||||
}
|
||||
|
||||
@file_put_contents(self::$dir_root_path.'payment_'.$name.'_'.strtolower($payment).'_respond.php', $respond);
|
||||
@file_put_contents(self::$dir_root_path.'payment_'.$business_name.'_'.strtolower($params['payment']).'_respond.php', $respond);
|
||||
|
||||
// 线下支付不生成异步入口文件
|
||||
if(!in_array($payment, config('shopxo.under_line_list')))
|
||||
if(!in_array($params['payment'], $not_notify))
|
||||
{
|
||||
@file_put_contents(self::$dir_root_path.'payment_'.$name.'_'.strtolower($payment).'_notify.php', $notify);
|
||||
@file_put_contents(self::$dir_root_path.'payment_'.$business_name.'_'.strtolower($params['payment']).'_notify.php', $notify);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -737,28 +763,40 @@ php;
|
|||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2018-09-28T23:38:52+0800
|
||||
* @param [string] $payment [支付唯一标记]
|
||||
* @param [array] $params [输入参数]
|
||||
* @param [string] $params['payment'] [支付唯一标记]
|
||||
* @param [array] $params['business'] [处理业务, 默认配置文件读取]
|
||||
*/
|
||||
private static function PaymentEntranceDelete($payment)
|
||||
public static function PaymentEntranceDelete($params = [])
|
||||
{
|
||||
// 初始化
|
||||
self::Init();
|
||||
|
||||
// 权限
|
||||
$ret = self::PowerCheck();
|
||||
if($ret['code'] != 0)
|
||||
{
|
||||
return $ret;
|
||||
}
|
||||
|
||||
$payment = strtolower($payment);
|
||||
foreach(self::$payment_business_type_all as $v)
|
||||
if(empty($params['payment']))
|
||||
{
|
||||
$name = strtolower($v['name']);
|
||||
if(file_exists(self::$dir_root_path.'payment_'.$name.'_'.$payment.'_notify.php'))
|
||||
return '支付唯一标记不能为空';
|
||||
}
|
||||
|
||||
// 处理业务
|
||||
$business_all = empty($params['business']) ? self::$payment_business_type_all : $params['business'];
|
||||
|
||||
$payment = strtolower($params['payment']);
|
||||
foreach($business_all as $v)
|
||||
{
|
||||
$business_name = strtolower($v['name']);
|
||||
if(file_exists(self::$dir_root_path.'payment_'.$business_name.'_'.$payment.'_notify.php'))
|
||||
{
|
||||
@unlink(self::$dir_root_path.'payment_'.$name.'_'.$payment.'_notify.php');
|
||||
@unlink(self::$dir_root_path.'payment_'.$business_name.'_'.$payment.'_notify.php');
|
||||
}
|
||||
if(file_exists(self::$dir_root_path.'payment_'.$name.'_'.$payment.'_respond.php'))
|
||||
if(file_exists(self::$dir_root_path.'payment_'.$business_name.'_'.$payment.'_respond.php'))
|
||||
{
|
||||
@unlink(self::$dir_root_path.'payment_'.$name.'_'.$payment.'_respond.php');
|
||||
@unlink(self::$dir_root_path.'payment_'.$business_name.'_'.$payment.'_respond.php');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -171,13 +171,18 @@ class Weixin
|
|||
{
|
||||
// web支付
|
||||
case 'NATIVE' :
|
||||
if(empty($params['ajax_url']))
|
||||
{
|
||||
return DataReturn('支付状态校验地址不能为空', -50);
|
||||
}
|
||||
$pay_params = [
|
||||
'url' => urlencode(base64_encode($data['code_url'])),
|
||||
'order_no' => $params['order_no'],
|
||||
'name' => urlencode('微信支付'),
|
||||
'msg' => urlencode('打开微信APP扫一扫进行支付'),
|
||||
'ajax_url' => urlencode($params['ajax_url']),
|
||||
];
|
||||
$url = MyUrl('index/order/qrcodepay', $pay_params);
|
||||
$url = MyUrl('index/pay/qrcode', $pay_params);
|
||||
$result = DataReturn('success', 0, $url);
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -107,21 +107,4 @@ strong.total-price-content { color: #d2364c; font-size: 16px; }
|
|||
.goods-base { margin-left: 45px; }
|
||||
table.data-list td.row-status { border-left: 1px solid #eee; }
|
||||
table.data-ongoing td.row-status { border-left: 1px solid #fff1f5; }
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 订单二维码支付页面
|
||||
*/
|
||||
.qrcode-pay {
|
||||
text-align: center;
|
||||
box-shadow: none;
|
||||
}
|
||||
.qrcode-pay .name {
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
margin: 20px 0 10px 0;
|
||||
}
|
||||
.qrcode-pay .msg {
|
||||
color: #F44336;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
/**
|
||||
* 订单二维码支付页面
|
||||
*/
|
||||
.qrcode-pay {
|
||||
text-align: center;
|
||||
box-shadow: none;
|
||||
}
|
||||
.qrcode-pay .name {
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
margin: 20px 0 10px 0;
|
||||
}
|
||||
.qrcode-pay .msg {
|
||||
color: #F44336;
|
||||
}
|
||||
Loading…
Reference in New Issue