1
This commit is contained in:
parent
153c9262fe
commit
bb84a010ef
@ -37,4 +37,18 @@ class OutAppOrder extends BaseModel {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function markFailed($orderId)
|
||||||
|
{
|
||||||
|
SqlHelper::update(
|
||||||
|
myself()->_get(),
|
||||||
|
't_outapp_order',
|
||||||
|
array(
|
||||||
|
'order_id' => $orderId,
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'state' => self::FAILED_STATE,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -21,12 +21,7 @@ use models\OutAppOrder;
|
|||||||
|
|
||||||
use services\LogService;
|
use services\LogService;
|
||||||
|
|
||||||
class OutAppPurchase {
|
/*
|
||||||
|
|
||||||
public function process()
|
|
||||||
{
|
|
||||||
error_log("OutAppPurchase --- " . json_encode($_REQUEST));
|
|
||||||
|
|
||||||
// let repdata = {
|
// let repdata = {
|
||||||
// account_id: string
|
// account_id: string
|
||||||
// order_id: string
|
// order_id: string
|
||||||
@ -43,6 +38,14 @@ class OutAppPurchase {
|
|||||||
// TRANSFER_FAIL = 98, // 转账错误
|
// TRANSFER_FAIL = 98, // 转账错误
|
||||||
// FAIL = 99, // 也是错误
|
// FAIL = 99, // 也是错误
|
||||||
//
|
//
|
||||||
|
*/
|
||||||
|
|
||||||
|
class OutAppPurchase {
|
||||||
|
|
||||||
|
public function process()
|
||||||
|
{
|
||||||
|
error_log("OutAppPurchase --- " . json_encode($_REQUEST));
|
||||||
|
|
||||||
if (!$this->verifySign()) {
|
if (!$this->verifySign()) {
|
||||||
error_log("verifySign error --- " . json_encode($_REQUEST));
|
error_log("verifySign error --- " . json_encode($_REQUEST));
|
||||||
myself()->_rspErr(1, 'verifySign error');
|
myself()->_rspErr(1, 'verifySign error');
|
||||||
@ -74,14 +77,6 @@ class OutAppPurchase {
|
|||||||
myself()->_rspErr(0, 'order is finished');
|
myself()->_rspErr(0, 'order is finished');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$conn = myself()->_getMysql('');
|
|
||||||
|
|
||||||
$id = $order['id'];
|
|
||||||
$goods_num = $order['goods_num'];
|
|
||||||
$o_status = $order['status'];
|
|
||||||
$address = $order['address'];
|
|
||||||
|
|
||||||
$buyStatus = 0; // 1: 成功, 2: 失败
|
$buyStatus = 0; // 1: 成功, 2: 失败
|
||||||
switch ($status) {
|
switch ($status) {
|
||||||
case "9":
|
case "9":
|
||||||
@ -99,8 +94,6 @@ class OutAppPurchase {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SqlHelper::update($conn, 't_shop_buy_order', array('order_id' => $order_id), array('status' => $buyStatus));
|
|
||||||
|
|
||||||
if ($buyStatus == 2) {
|
if ($buyStatus == 2) {
|
||||||
$this->_rspErr(2, "buyStatus error, buyStatus: {$buyStatus}");
|
$this->_rspErr(2, "buyStatus error, buyStatus: {$buyStatus}");
|
||||||
return;
|
return;
|
||||||
@ -139,24 +132,6 @@ class OutAppPurchase {
|
|||||||
$this->_rspOk();
|
$this->_rspOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function _addGoods($address, $goods)
|
|
||||||
{
|
|
||||||
$itemService = new ShopAddItemService();
|
|
||||||
$item_id = $goods['goods_id'];
|
|
||||||
$goods_num = $goods['goods_num'];
|
|
||||||
|
|
||||||
$id = null;
|
|
||||||
if ($goods['id']) {
|
|
||||||
$id = $goods['id'];
|
|
||||||
}
|
|
||||||
|
|
||||||
error_log('_addGoods ' . $address . ' item_id ' . $item_id . ' goods_num ' . $goods_num . ' id ' . $id);
|
|
||||||
$itemService->addItem($address, $item_id, $goods_num);
|
|
||||||
if ($id) {
|
|
||||||
ShopBuyRecord::addWithAddress($address, $id, $goods_num);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function beginFirstTupop($address)
|
private function beginFirstTupop($address)
|
||||||
{
|
{
|
||||||
$conn = myself()->_getMysql('');
|
$conn = myself()->_getMysql('');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user