1
This commit is contained in:
parent
d6af108018
commit
6d5be57626
@ -89,7 +89,7 @@ DROP TABLE IF EXISTS `confirmed_order`;
|
||||
CREATE TABLE `confirmed_order` (
|
||||
`idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||
`orderid` varchar(60) DEFAULT '' COMMENT '订单id',
|
||||
`status` int(11) NOT NULL DEFAULT '0' COMMENT '0: 新添加订单 1:已经完成订单',
|
||||
`status` int(11) NOT NULL DEFAULT '0' COMMENT '0: 未确认 1:已确认',
|
||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
KEY `orderid` (`orderid`)
|
||||
|
@ -53,6 +53,7 @@ class PayNotifyController {
|
||||
if ($sign_info != $_REQUEST['SignInfo']) {
|
||||
die('sign error');
|
||||
}
|
||||
$nowtime = time();
|
||||
$conn = $this->getMysql($_REQUEST['OrderNo']);
|
||||
$conn->execScript("INSERT INTO notify_his(orderid, request_data, ipv4, createtime)" .
|
||||
"VALUES(:orderid, :request_data, :ipv4, :createtime);",
|
||||
@ -71,6 +72,16 @@ class PayNotifyController {
|
||||
);
|
||||
if ($row) {
|
||||
if ($row['status'] == 0 && $row['sp_pay_result'] == 0) {
|
||||
$ret = $conn->execScript('INSERT INTO confirmed_order(orderid, status, createtime)' .
|
||||
'VALUES(:orderid, :status, :createtime);',
|
||||
array(
|
||||
':orderid' => $_REQUEST['OrderNo'],
|
||||
':status' => 0,
|
||||
':createtime' => 0,
|
||||
));
|
||||
if (!$ret) {
|
||||
die('dberror');
|
||||
}
|
||||
$ret = $conn->execScript('UPDATE orderinfo SET ' .
|
||||
' sp_pay_result = 1, ' .
|
||||
' sp_confirm_time = :sp_confirm_time, ' .
|
||||
@ -79,7 +90,7 @@ class PayNotifyController {
|
||||
array(
|
||||
'orderid' => $_REQUEST['OrderNo'],
|
||||
'sp_orderid' => $_REQUEST['BillNo'],
|
||||
'sp_confirm_time' => time()
|
||||
'sp_confirm_time' => $nowtime
|
||||
));
|
||||
if ($ret) {
|
||||
die('ok');
|
||||
|
Loading…
x
Reference in New Issue
Block a user