1
This commit is contained in:
parent
c7cd736412
commit
c0ae79dd0c
@ -39,6 +39,11 @@ class BaseAuthedController extends BaseController {
|
||||
return $this->accountId;
|
||||
}
|
||||
|
||||
public function _getOpenId()
|
||||
{
|
||||
return phpcommon\extractOpenId($this->_getAccountId());
|
||||
}
|
||||
|
||||
public function _getChannel()
|
||||
{
|
||||
return phpcommon\extractChannel($this->_getAccountId());
|
||||
|
@ -9,6 +9,7 @@ require_once('services/NftService.php');
|
||||
|
||||
use mt;
|
||||
use phpcommon\SqlHelper;
|
||||
use services\NftService;
|
||||
|
||||
class Bag extends BaseModel {
|
||||
|
||||
@ -69,16 +70,16 @@ class Bag extends BaseModel {
|
||||
public static function getItemList($cb)
|
||||
{
|
||||
SqlHelper::ormSelect(
|
||||
$this->_getSelfMysql(),
|
||||
myself()->_getSelfMysql(),
|
||||
't_bag',
|
||||
array(
|
||||
'account_id' => $this->_getAccountId()
|
||||
'account_id' => myself()->_getAccountId()
|
||||
),
|
||||
function ($row) use($cb) {
|
||||
$cb($row);
|
||||
}
|
||||
);
|
||||
foreach (services\NftService::getChips() as $nftDb) {
|
||||
foreach (NftService::getChips() as $nftDb) {
|
||||
$row = SqlHelper::ormSelectOne(
|
||||
myself()->_getSelfMysql(),
|
||||
't_bag',
|
||||
|
@ -10,6 +10,7 @@ require_once('services/NftService.php');
|
||||
|
||||
use mt;
|
||||
use phpcommon\SqlHelper;
|
||||
use services\NftService;
|
||||
|
||||
class Gun extends BaseModel {
|
||||
|
||||
@ -32,7 +33,7 @@ class Gun extends BaseModel {
|
||||
if ($row) {
|
||||
$row['gun_uniid'] = $row['idx'];
|
||||
if ($row['account_id'] != myself()->_getAccountId()) {
|
||||
if (!services\NftService::isEquipOwner($row['token_id'])) {
|
||||
if (!NftService::isEquipOwner($row['token_id'])) {
|
||||
$row = null;
|
||||
}
|
||||
}
|
||||
@ -54,16 +55,16 @@ class Gun extends BaseModel {
|
||||
public static function getGunList($cb)
|
||||
{
|
||||
SqlHelper::ormSelect(
|
||||
$this->_getSelfMysql(),
|
||||
myself()->_getSelfMysql(),
|
||||
't_gun',
|
||||
array(
|
||||
'account_id' => $this->_getAccountId()
|
||||
'account_id' => myself()->_getAccountId()
|
||||
),
|
||||
function ($row) use($cb) {
|
||||
$cb($row);
|
||||
}
|
||||
);
|
||||
foreach (services\NftService::getEquips() as $nftDb) {
|
||||
foreach (NftService::getEquips() as $nftDb) {
|
||||
$row = SqlHelper::ormSelectOne(
|
||||
myself()->_getSelfMysql(),
|
||||
't_gun',
|
||||
|
@ -12,6 +12,7 @@ require_once('services/NftService.php');
|
||||
|
||||
use mt;
|
||||
use phpcommon\SqlHelper;
|
||||
use services\NftService;
|
||||
|
||||
class Hero extends BaseModel {
|
||||
|
||||
@ -34,7 +35,7 @@ class Hero extends BaseModel {
|
||||
if ($row) {
|
||||
$row['hero_uniid'] = $row['idx'];
|
||||
if ($row['account_id'] != myself()->_getAccountId()) {
|
||||
if (!services\NftService::isHeroOwner($row['token_id'])) {
|
||||
if (!NftService::isHeroOwner($row['token_id'])) {
|
||||
$row = null;
|
||||
}
|
||||
}
|
||||
@ -56,16 +57,16 @@ class Hero extends BaseModel {
|
||||
public static function getHeroList($cb)
|
||||
{
|
||||
SqlHelper::ormSelect(
|
||||
$this->_getSelfMysql(),
|
||||
myself()->_getSelfMysql(),
|
||||
't_hero',
|
||||
array(
|
||||
'account_id' => $this->_getAccountId()
|
||||
'account_id' => myself()->_getAccountId()
|
||||
),
|
||||
function ($row) use($cb) {
|
||||
$cb($row);
|
||||
}
|
||||
);
|
||||
foreach (services\NftService::getHeros() as $nftDb) {
|
||||
foreach (NftService::getHeros() as $nftDb) {
|
||||
$row = SqlHelper::ormSelectOne(
|
||||
myself()->_getSelfMysql(),
|
||||
't_hero',
|
||||
|
Loading…
x
Reference in New Issue
Block a user