This commit is contained in:
aozhiwei 2021-11-26 14:24:31 +08:00
parent cef4576d09
commit 4f3a51cc68
2 changed files with 21 additions and 21 deletions

View File

@ -13,10 +13,10 @@ class Hero extends BaseModel {
public static function find($heroId)
{
$row = SqlHelper::ormSelectOne(
myself()->getSelfMysql(),
myself()->_getSelfMysql(),
't_hero',
array(
'accountid' => myself()->getAccountId(),
'accountid' => myself()->_getAccountId(),
'hero_id' => $heroId,
)
);
@ -40,16 +40,16 @@ class Hero extends BaseModel {
{
$defSkin = mt\Hero::getDefaultSkin($heroMeta);
SqlHelper::upsert(
myself()->getSelfMysql(),
myself()->_getSelfMysql(),
't_hero',
array(
'accountid' => myself()->getAccountId(),
'accountid' => myself()->_getAccountId(),
'hero_id' => $heroMeta['id']
),
array(
),
array(
'accountid' => myself()->getAccountId(),
'accountid' => myself()->_getAccountId(),
'hero_id' => $heroMeta['id'],
'hero_lv' => 1,
'skin_id' => $defSkin,
@ -57,8 +57,8 @@ class Hero extends BaseModel {
'skill1_lv2' => 1,
'yoke_lv' => 0,
'yoke_exp' => 0,
'createtime' => myself()->getNowTime(),
'modifytime' => myself()->getNowTime()
'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime()
)
);
if ($defSkin) {
@ -69,15 +69,15 @@ class Hero extends BaseModel {
public static function takeonSkin($heroId, $skinId)
{
SqlHelper::update(
myself()->getSelfMysql(),
myself()->_getSelfMysql(),
't_hero',
array(
'accountid' => myself()->getAccountId(),
'accountid' => myself()->_getAccountId(),
'hero_id' => $heroMeta['id']
),
array(
'skin_id' => $skinId,
'modifytime' => myself()->getNowTime()
'modifytime' => myself()->_getNowTime()
)
);
}
@ -89,17 +89,17 @@ class Hero extends BaseModel {
}
$fieldName = 'skill1_lv' . ($skillIdx + 1);
SqlHelper::update(
myself()->getSelfMysql(),
myself()->_getSelfMysql(),
't_hero',
array(
'accountid' => myself()->getAccountId(),
'accountid' => myself()->_getAccountId(),
'hero_id' => $heroId
),
array(
$fieldName => function () use($fieldName) {
return "${fieldName} + 1";
},
'modifytime' => myself()->getNowTime()
'modifytime' => myself()->_getNowTime()
)
);
}

View File

@ -12,10 +12,10 @@ class HeroSkin extends BaseModel {
public static function find($skinId)
{
$row = SqlHelper::ormSelectOne(
myself()->getSelfMysql(),
myself()->_getSelfMysql(),
't_hero_skin',
array(
'accountid' => myself()->getAccountId(),
'accountid' => myself()->_getAccountId(),
'skin_id' => $skinId
)
);
@ -36,25 +36,25 @@ class HeroSkin extends BaseModel {
public static function addSkin($skinId)
{
SqlHelper::upsert(
myself()->getSelfMysql(),
myself()->_getSelfMysql(),
't_hero_skin',
array(
'accountid' => myself()->getAccountId(),
'accountid' => myself()->_getAccountId(),
'skin_id' => $skinId
),
array(
'skin_state' => 3,
'modifytime' => myself()->getNowTime()
'modifytime' => myself()->_getNowTime()
),
array(
'accountid' => myself()->getAccountId(),
'accountid' => myself()->_getAccountId(),
'skin_id' => $skinId,
'skin_state' => 0,
'get_from' => 0,
'consume_num' => 0,
'trytime' => 0,
'createtime' => myself()->getNowTime(),
'modifytime' => myself()->getNowTime()
'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime()
)
);
}