This commit is contained in:
songliang 2023-07-10 10:50:48 +08:00
parent 9696773329
commit 1b3ee8765a
3 changed files with 29 additions and 4 deletions

View File

@ -1151,6 +1151,7 @@ CREATE TABLE `t_shop_buy_order` (
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '订单id',
`address` varchar(60) NOT NULL COMMENT '账户id',
`createtime` int(11) NOT NULL COMMENT '订单开始时间',
`id` int(11) NOT NULL COMMENT '商店货物id',
`item_id` int(11) NOT NULL COMMENT '道具id',
`goods_num` int(11) NOT NULL COMMENT '购买个数',
`status` int(11) NOT NULL COMMENT '订单状态 0-客户端申请了订单 1-订单完成 2-订单失败',

View File

@ -0,0 +1,5 @@
begin;
alter table t_bc_order add column `id` int(11) NOT NULL COMMENT '商店货物id',
commit;

View File

@ -111,7 +111,11 @@ class ShopController extends BaseAuthedController
// }
// }
if (getReqVal('a', '') != 'buyGoodsDirect') {
$a = getReqVal('a', '');
if (
$a != 'buyGoodsDirect' &&
$a != 'purchaseDiamonds'
) {
parent::_handlePre();
}
}
@ -189,6 +193,8 @@ class ShopController extends BaseAuthedController
$token_type = getReqVal('token_type', '');
$goods_num = getReqVal('goods_num', 0);
$goods = mt\ShopGoods::get($id);
$conn = myself()->_getMysql('');
$address = myself()->_getAddress();
@ -196,14 +202,14 @@ class ShopController extends BaseAuthedController
$this->_rspErr(1, 'address is empty');
}
$chk = SqlHelper::insert(
$conn,
't_shop_buy_order',
array(
'address' => $address,
'createtime' => myself()->_getNowTime(),
'item_id' => $id,
'id' => $id,
'item_id' => $goods['goods_id'],
'goods_num' => $goods_num,
'status' => 0, // 0-客户端申请了订单 1-订单完成 2-订单失败
)
@ -229,7 +235,7 @@ class ShopController extends BaseAuthedController
$row = SqlHelper::selectOne(
$conn,
't_shop_buy_order',
array('status'),
array('status', 'id'),
array(
'idx' => $order_id,
)
@ -238,6 +244,8 @@ class ShopController extends BaseAuthedController
$this->_rspData(
array(
'status' => $row['status'],
'item_id' => $row['item_id'],
'item_num' => $row['goods_num'],
)
);
} else {
@ -350,6 +358,17 @@ class ShopController extends BaseAuthedController
$this->_rspOk();
}
public function purchaseDiamonds()
{
// 有三种情况:
// 1. 从商城购买钻石,有订单号
// 2. 站外充值钻石,没有订单号
// 3. appstore 退款,没有订单号
$this->_rspOk();
}
public function getPayMethods()
{
$token_type = getReqVal('token_type', 99);