This commit is contained in:
songliang 2023-07-03 15:22:35 +08:00
parent 8aef9f16c0
commit c4353583e5
2 changed files with 12 additions and 9 deletions

View File

@ -181,12 +181,11 @@ class ShopController extends BaseAuthedController
$conn = myself()->_getMysql('');
$address = myself()->_getAddress();
if (empty($address)) {
$address = myself()->_getAccountId();
if (!$address) {
$this->_rspErr(1, 'address is empty');
}
$chk = SqlHelper::insert(
$conn,
't_shop_buy_order',
@ -819,10 +818,10 @@ class ShopController extends BaseAuthedController
public function getChestItems()
{
$address = $this->_getAddress();
// if (!$address) {
// $this->_rspErr(2, 'address is invalid');
// return;
// }
if (!$address) {
$this->_rspErr(2, 'address is invalid');
return;
}
$id = getReqVal('id', 0);
$goods = mt\ShopGoods::get($id);

View File

@ -132,11 +132,15 @@ class BuyShopGoodsCbService
$itemService = new ShopAddItemService();
$item_id = $goods['goods_id'];
$goods_num = $goods['goods_num'];
$id = $goods['id'];
error_log(json_encode($goods));
error_log('_addGoods ' . $address . ' item_id ' . $item_id . ' goods_num ' . $goods_num . ' id ' . $id);
$itemService->addItem($address, $item_id, $goods_num);
ShopBuyRecord::addWithAddress($address, $id, $goods_num);
if ($id) {
ShopBuyRecord::addWithAddress($address, $id, $goods_num);
}
}
private function getAccountId($address){