_getSelfMysql(), 't_transaction', array( 'account_id' => myself()->_getAccountId() ) ); return $rows; } public static function find($transId) { $row = SqlHelper::ormSelectOne( myself()->_getSelfMysql(), 't_transaction', array( 'account_id' => myself()->_getAccountId(), 'trans_id' => $transId, ) ); return $row; } public static function add($transId, $action, $tokenId, $tokenType, $itemUniId, $itemId) { SqlHelper::insert( myself()->_getSelfMysql(), 't_transaction', array( 'account_id' => myself()->_getAccountId(), 'trans_id' => $transId, 'action' => $action, 'token_id' => $tokenId, 'token_type' => $tokenType, 'item_uniid' => $itemUniId, 'item_id' => $itemId, 'status' => self::CREATED_STATUS, 'createtime' => myself()->_getNowTime(), 'modifytime' => myself()->_getNowTime(), ) ); } public static function getActionDesc($transDb) { switch ($transDb['action']) { case self::MINT_721_ACTION_TYPE: case self::MINT_1155_ACTION_TYPE: { return 'Mint'; } break; case self::EVOLVE_721_ACTION_TYPE: { return 'Advance'; } break; case self::EVOLVE_CHIP_ACTION_TYPE: { return 'Upgrade'; } break; case self::MINT_SHARD_BATCH_ACTION_TYPE: { return 'Mint'; } break; case self::SHARD_MIX_BY_USER_ACTION_TYPE: { return 'Synthesis'; } break; default: { return 'None'; } } } public static function getStatusDesc($transDb) { switch ($transDb['status']) { case self::CREATED_STATUS: case self::REPORTED_STATUS: { return 'Pending'; } break; case self::COMPLETED_STATUS: { return 'Complete'; } break; default: { return 'None'; } } } public static function reportResult($transId, $result) { SqlHelper::update( myself()->_getSelfMysql(), 't_transaction', array( 'account_id' => myself()->_getAccountId(), 'trans_id' => $transId ), array( 'client_result' => $result, 'modifytime' => myself()->_getNowTime() ) ); } }