mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-12-03 04:19:37 +08:00
订单
This commit is contained in:
parent
5bcd240c0b
commit
5879403dfe
@ -92,7 +92,12 @@ class CommonController extends Controller
|
||||
{
|
||||
if(empty($_SESSION['admin']))
|
||||
{
|
||||
$this->error(L('common_login_invalid'), U('Admin/Admin/LoginInfo'));
|
||||
if(IS_AJAX)
|
||||
{
|
||||
$this->ajaxReturn(L('common_login_invalid'), -400);
|
||||
} else {
|
||||
die('<script type="text/javascript">if(self.frameElement && self.frameElement.tagName == "IFRAME"){parent.location.reload();}else{window.location.href="'.U('Admin/Admin/LoginInfo').'";}</script>');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -330,7 +330,7 @@ class OrderController extends CommonController
|
||||
{
|
||||
$params = $_POST;
|
||||
$params['user'] = $this->admin;
|
||||
$params['user']['user_name_view'] = L('common_admin_name').':'.$this->admin['username'];
|
||||
$params['user']['user_name_view'] = L('common_admin_name').'-'.$this->admin['username'];
|
||||
$ret = OrderService::AdminPay($params);
|
||||
$this->ajaxReturn($ret['msg'], $ret['code'], $ret['data']);
|
||||
}
|
||||
|
@ -40,5 +40,7 @@ return array(
|
||||
'order_pay_popup_title' => '支付操作',
|
||||
'order_business_pay_title' => '选择支付',
|
||||
'order_payment_not_data_tips' => '没有支付方式',
|
||||
|
||||
'order_user_is_delete_text' => '用户已删除',
|
||||
);
|
||||
?>
|
@ -17,9 +17,9 @@ return array(
|
||||
'paylog_busines_type_name' => '业务类型',
|
||||
'paylog_order_id_name' => '业务订单id',
|
||||
'paylog_trade_no_name' => '支付平台交易号',
|
||||
'paylog_platform_user_name' => '支付平台用户帐号',
|
||||
'paylog_total_fee_name' => '支付金额',
|
||||
'paylog_amount_name' => '订单实际金额',
|
||||
'paylog_platform_buyer_user_name' => '支付平台用户帐号',
|
||||
'paylog_pay_price_name' => '支付金额',
|
||||
'paylog_total_price_name' => '订单实际金额',
|
||||
'paylog_subject_name' => '订单名称',
|
||||
'paylog_add_time_name' => '支付时间',
|
||||
);
|
||||
|
@ -33,4 +33,10 @@
|
||||
|
||||
<!-- footer start -->
|
||||
<include file="Public/Footer" />
|
||||
<!-- footer end -->
|
||||
<!-- footer end -->
|
||||
<script type="text/javascript">
|
||||
if (self.frameElement && self.frameElement.tagName == "IFRAME")
|
||||
{
|
||||
parent.location.reload();
|
||||
}
|
||||
</script>
|
@ -52,7 +52,6 @@
|
||||
<th class="am-hide-sm-only th-receive-address">{{:L('order_receive_text')}}</th>
|
||||
<th class="am-hide-sm-only">{{:L('order_express_text')}}</th>
|
||||
<th>{{:L('common_order_status_name')}}</th>
|
||||
<th class="am-hide-sm-only">{{:L('common_pay_status_name')}}</th>
|
||||
<th>{{:L('order_price_th_text')}}</th>
|
||||
<th>{{:L('common_more_name')}}</th>
|
||||
<th>{{:L('common_operation_name')}}</th>
|
||||
@ -103,12 +102,17 @@
|
||||
</td>
|
||||
<td>
|
||||
<span class="block">{{$v.status_text}}</span>
|
||||
<if condition="$v['user_is_delete_time'] neq 0">
|
||||
<span class="block cr-red fs-12">用户已删除</span>
|
||||
|
||||
<if condition="$v['pay_status'] eq 1">
|
||||
<span class="block cr-green fs-12">{{$v.pay_status_text}}</span>
|
||||
<elseif condition="$v['pay_status'] eq 2" />
|
||||
<span class="block cr-yellow fs-12">{{$v.pay_status_text}}</span>
|
||||
<else />
|
||||
<span class="block fs-12">{{$v.pay_status_text}}</span>
|
||||
</if>
|
||||
<if condition="$v['user_is_delete_time'] neq 0">
|
||||
<span class="block cr-red fs-12">{{:L('order_user_is_delete_text')}}</span>
|
||||
</if>
|
||||
</td>
|
||||
<td class="am-hide-sm-only">
|
||||
<span class="block">{{$v.pay_status_text}}</span>
|
||||
</td>
|
||||
<td>
|
||||
{{:L('order_price_text')}}:{{$v.price}}<br />
|
||||
|
@ -54,9 +54,9 @@
|
||||
<th>{{:L('paylog_busines_type_name')}}</th>
|
||||
<th class="am-hide-sm-only">{{:L('paylog_order_id_name')}}</th>
|
||||
<th class="am-hide-sm-only">{{:L('paylog_trade_no_name')}}</th>
|
||||
<th class="am-hide-sm-only">{{:L('paylog_platform_user_name')}}</th>
|
||||
<th>{{:L('paylog_total_fee_name')}}</th>
|
||||
<th>{{:L('paylog_amount_name')}}</th>
|
||||
<th class="am-hide-sm-only">{{:L('paylog_platform_buyer_user_name')}}</th>
|
||||
<th>{{:L('paylog_pay_price_name')}}</th>
|
||||
<th>{{:L('paylog_total_price_name')}}</th>
|
||||
<th class="am-hide-sm-only">{{:L('paylog_subject_name')}}</th>
|
||||
<th class="am-hide-sm-only">{{:L('paylog_add_time_name')}}</th>
|
||||
</tr>
|
||||
@ -88,22 +88,22 @@
|
||||
<if condition="empty($v['order_id'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.order_id}}</if>
|
||||
</td>
|
||||
<td class="am-hide-sm-only">
|
||||
<if condition="empty($v['trade_no'])"><span class="cr-ddd">{{:L('common_not_set_text')}}</span><else />{{$v.trade_no}}</if>
|
||||
<if condition="empty($v['trade_no'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.trade_no}}</if>
|
||||
</td>
|
||||
<td class="am-hide-sm-only">
|
||||
<if condition="empty($v['user'])"><span class="cr-ddd">{{:L('common_not_set_text')}}</span><else />{{$v.user}}</if>
|
||||
<if condition="empty($v['buyer_user'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.buyer_user}}</if>
|
||||
</td>
|
||||
<td>
|
||||
<if condition="empty($v['total_fee'])"><span class="cr-ddd">{{:L('common_not_set_text')}}</span><else />{{$v.total_fee}}</if>
|
||||
<if condition="empty($v['pay_price'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.pay_price}}</if>
|
||||
</td>
|
||||
<td>
|
||||
<if condition="empty($v['amount'])"><span class="cr-ddd">{{:L('common_not_set_text')}}</span><else />{{$v.amount}}</if>
|
||||
<if condition="empty($v['total_price'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.total_price}}</if>
|
||||
</td>
|
||||
<td class="am-hide-sm-only">
|
||||
<if condition="empty($v['subject'])"><span class="cr-ddd">{{:L('common_not_set_text')}}</span><else />{{$v.subject}}</if>
|
||||
<if condition="empty($v['subject'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.subject}}</if>
|
||||
</td>
|
||||
<td class="am-hide-sm-only">
|
||||
<if condition="empty($v['add_time'])"><span class="cr-ddd">{{:L('common_not_set_text')}}</span><else />{{$v.add_time}}</if>
|
||||
<if condition="empty($v['add_time'])"><span class="cr-ddd">{{:L('common_on_fill_in_the_text')}}</span><else />{{$v.add_time}}</if>
|
||||
</td>
|
||||
</tr>
|
||||
</foreach>
|
||||
|
@ -427,10 +427,34 @@ class Alipay
|
||||
case 'TRADE_SUCCESS':
|
||||
case 'TRADE_FINISHED':
|
||||
case 'success':
|
||||
return DataReturn('支付成功', 0, $data);
|
||||
return DataReturn('支付成功', 0, $this->ReturnData($data));
|
||||
break;
|
||||
}
|
||||
return DataReturn('处理异常错误', -100);
|
||||
}
|
||||
|
||||
/**
|
||||
* [ReturnData 返回数据统一格式]
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @datetime 2018-10-06T16:54:24+0800
|
||||
* @param [array] $data [返回数据]
|
||||
*/
|
||||
private function ReturnData($data)
|
||||
{
|
||||
// 兼容web版本支付参数
|
||||
$buyer_user = isset($data['buyer_logon_id']) ? $data['buyer_logon_id'] : (isset($data['buyer_email']) ? $data['buyer_email'] : '');
|
||||
$pay_price = isset($data['total_amount']) ? $data['total_amount'] : (isset($data['total_fee']) ? $data['total_fee'] : '');
|
||||
|
||||
// 返回数据固定基础参数
|
||||
$data['trade_no'] = $data['trade_no']; // 支付平台 - 订单号
|
||||
$data['buyer_user'] = $buyer_user; // 支付平台 - 用户
|
||||
$data['out_trade_no'] = $data['out_trade_no']; // 本系统发起支付的 - 订单号
|
||||
$data['subject'] = $data['subject']; // 本系统发起支付的 - 商品名称
|
||||
$data['pay_price'] = $pay_price; // 本系统发起支付的 - 总价
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
?>
|
File diff suppressed because one or more lines are too long
@ -180,9 +180,9 @@ class OrderService
|
||||
'payment' => $params['payment'],
|
||||
'pay' => [
|
||||
'trade_no' => '',
|
||||
'subject' => isset($params['params']['subject']) ? $params['params']['subject'] : '',
|
||||
'buyer_email' => $params['user']['user_name_view'],
|
||||
'total_amount' => $params['order']['total_price'],
|
||||
'subject' => isset($params['params']['subject']) ? $params['params']['subject'] : '订单支付',
|
||||
'buyer_user' => '用户-'.$params['user']['user_name_view'],
|
||||
'pay_price' => $params['order']['total_price'],
|
||||
],
|
||||
];
|
||||
return self::OrderPayHandle($pay_params);
|
||||
@ -273,10 +273,6 @@ class OrderService
|
||||
$where = ['order_no'=>$ret['data']['out_trade_no'], 'is_delete_time'=>0, 'user_is_delete_time'=>0];
|
||||
$order = M('Order')->where($where)->find();
|
||||
|
||||
// 兼容web版本支付参数
|
||||
$buyer_email = isset($ret['data']['buyer_logon_id']) ? $ret['data']['buyer_logon_id'] : (isset($ret['data']['buyer_email']) ? $ret['data']['buyer_email'] : '');
|
||||
$total_amount = isset($ret['data']['total_amount']) ? $ret['data']['total_amount'] : (isset($ret['data']['total_fee']) ? $ret['data']['total_fee'] : '');
|
||||
|
||||
// 支付处理
|
||||
$pay_params = [
|
||||
'order' => $order,
|
||||
@ -284,8 +280,8 @@ class OrderService
|
||||
'pay' => [
|
||||
'trade_no' => $ret['data']['trade_no'],
|
||||
'subject' => $ret['data']['subject'],
|
||||
'buyer_email' => $buyer_email,
|
||||
'total_amount' => $total_amount,
|
||||
'buyer_user' => $ret['data']['buyer_user'],
|
||||
'pay_price' => $ret['data']['pay_price'],
|
||||
],
|
||||
];
|
||||
return self::OrderPayHandle($pay_params);
|
||||
@ -319,16 +315,16 @@ class OrderService
|
||||
}
|
||||
|
||||
// 支付参数
|
||||
$total_amount = isset($params['pay']['total_amount']) ? $params['pay']['total_amount'] : 0;
|
||||
$pay_price = isset($params['pay']['pay_price']) ? $params['pay']['pay_price'] : 0;
|
||||
|
||||
// 写入支付日志
|
||||
$pay_log_data = [
|
||||
'user_id' => $params['order']['user_id'],
|
||||
'order_id' => $params['order']['id'],
|
||||
'amount' => $params['order']['total_price'],
|
||||
'total_price' => $params['order']['total_price'],
|
||||
'trade_no' => isset($params['pay']['trade_no']) ? $params['pay']['trade_no'] : '',
|
||||
'user' => isset($params['pay']['buyer_email']) ? $params['pay']['buyer_email'] : '',
|
||||
'total_fee' => $total_amount,
|
||||
'buyer_user' => isset($params['pay']['buyer_user']) ? $params['pay']['buyer_user'] : '',
|
||||
'pay_price' => $pay_price,
|
||||
'subject' => isset($params['pay']['subject']) ? $params['pay']['subject'] : '订单支付',
|
||||
'payment' => $params['payment']['payment'],
|
||||
'payment_name' => $params['payment']['name'],
|
||||
@ -349,7 +345,7 @@ class OrderService
|
||||
$upd_data = array(
|
||||
'status' => 2,
|
||||
'pay_status' => 1,
|
||||
'pay_price' => $total_amount,
|
||||
'pay_price' => $pay_price,
|
||||
'payment_id' => $params['payment']['id'],
|
||||
'pay_time' => time(),
|
||||
'upd_time' => time(),
|
||||
|
Loading…
Reference in New Issue
Block a user