This commit is contained in:
aozhiwei 2023-08-02 12:53:57 +08:00
parent 537ddb960c
commit d76d663e04

View File

@ -260,30 +260,6 @@ class ShopController extends BaseAuthedController {
}
$orderId = OrderId::gen();
$chk = SqlHelper::insert($conn, 't_web2_order', array(
'status' => 0,
'createtime' => $self->_getNowTime(),
'account_id' => $account_id,
'address' => $address,
'item_id' => $item_id,
'item_num' => $item_num,
'id' => $id,
'goods_num' => $goodsNum,
'price' => $goods['price'],
));
if (!$chk) {
$this->_rspErr(5, "start purchase failed");
return;
}
$lastId = $this->lastInsertId($conn);
$order_id = $this->genOrderId($lastId);
$test = SqlHelper::update($conn, 't_web2_order', array('idx' => $lastId), array('order_id' => $order_id));
if (!$test) {
$this->_rspErr(6, "start purchase failed");
return;
}
$this->_rspData(array(
'order_id' => $order_id,
));