1
This commit is contained in:
parent
06d243d927
commit
670ed19c39
2
third_party/phpcommon
vendored
2
third_party/phpcommon
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 195376f820d8882e8fe10c14f219cebcfd908dcf
|
Subproject commit 9f17c495ec483929d1f6e206e016b20f37dd6686
|
@ -172,6 +172,15 @@ class MarketController extends BaseController {
|
|||||||
myself()->_rspErr(500, 'not white list user');
|
myself()->_rspErr(500, 'not white list user');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$itemMeta = mt\Item::get($itemId);
|
||||||
|
if (!$itemMeta ||
|
||||||
|
empty($itemMeta['nft_image_id']) ||
|
||||||
|
$itemMeta['nft_image_id'] <= 0 ||
|
||||||
|
$itemMeta['nft_image_id'] > 999
|
||||||
|
) {
|
||||||
|
myself()->_rspErr(500, 'server internal error');
|
||||||
|
return;
|
||||||
|
}
|
||||||
$currencyMeta = mt\Currency::get($goodsMeta['currency_id']);
|
$currencyMeta = mt\Currency::get($goodsMeta['currency_id']);
|
||||||
if (!$currencyMeta || $currencyMeta['address'] != $paymentTokenAddress) {
|
if (!$currencyMeta || $currencyMeta['address'] != $paymentTokenAddress) {
|
||||||
myself()->_rspErr(500, 'currency error');
|
myself()->_rspErr(500, 'currency error');
|
||||||
@ -198,7 +207,11 @@ class MarketController extends BaseController {
|
|||||||
return;
|
return;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
$orderId = BuyRecord::genOrderId($gameId, $funcId, myself()->_getNowTime(), $buyerAddress);
|
$orderId = BuyRecord::genOrderId($gameId,
|
||||||
|
$funcId,
|
||||||
|
myself()->_getNowTime(),
|
||||||
|
$itemMeta['nft_image_id'],
|
||||||
|
$buyerAddress);
|
||||||
$tokenId = $orderId;
|
$tokenId = $orderId;
|
||||||
SqlHelper::insert(
|
SqlHelper::insert(
|
||||||
myself()->_getMarketMysql(),
|
myself()->_getMarketMysql(),
|
||||||
|
@ -10,7 +10,7 @@ use phpcommon\SqlHelper;
|
|||||||
|
|
||||||
class BuyRecord extends BaseModel {
|
class BuyRecord extends BaseModel {
|
||||||
|
|
||||||
public static function genOrderId($gameId, $funcId, $time, $buyerAddress)
|
public static function genOrderId($gameId, $funcId, $time, $imgIdx, $buyerAddress)
|
||||||
{
|
{
|
||||||
SqlHelper::insert
|
SqlHelper::insert
|
||||||
(myself()->_getMarketMysql(),
|
(myself()->_getMarketMysql(),
|
||||||
@ -29,7 +29,7 @@ class BuyRecord extends BaseModel {
|
|||||||
'errmsg' => 'server internal error'
|
'errmsg' => 'server internal error'
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
$orderId = phpcommon\genOrderId($gameId, $funcId, $time, $lastIdx);
|
$orderId = phpcommon\genOrderId($gameId, $funcId, $time, $lastIdx, $imgIdx);
|
||||||
if (!phpcommon\isValidOrderId($orderId)) {
|
if (!phpcommon\isValidOrderId($orderId)) {
|
||||||
die(json_encode(array(
|
die(json_encode(array(
|
||||||
'errcode' => 500,
|
'errcode' => 500,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user