55 lines
1.3 KiB
PHP
55 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace models;
|
|
|
|
use mt;
|
|
use phpcommon\SqlHelper;
|
|
|
|
class GunTalent extends BaseModel {
|
|
|
|
public static function find($talentId)
|
|
{
|
|
$row = SqlHelper::ormSelectOne(
|
|
myself()->_getSelfMysql(),
|
|
't_gun_talent',
|
|
array(
|
|
'account_id' => myself()->_getAccountId(),
|
|
'talent_id' => $talentId
|
|
)
|
|
);
|
|
return $row;
|
|
}
|
|
|
|
public static function toDto($row)
|
|
{
|
|
return array(
|
|
'talent_id' => $row['talent_id'],
|
|
'talent_lv' => $row['talent_lv'],
|
|
);
|
|
}
|
|
|
|
public static function upgradeLv($talentId, $talentLv)
|
|
{
|
|
SqlHelper::upsert(
|
|
myself()->_getSelfMysql(),
|
|
't_gun_talent',
|
|
array(
|
|
'account_id' => myself()->_getAccountId(),
|
|
'talent_id' => $talentId
|
|
),
|
|
array(
|
|
'talent_lv' => $talentLv,
|
|
'modifytime' => myself()->_getNowTime()
|
|
),
|
|
array(
|
|
'account_id' => myself()->_getAccountId(),
|
|
'talent_id' => $talentId,
|
|
'talent_lv' => $talentLv,
|
|
'createtime' => myself()->_getNowTime(),
|
|
'modifytime' => myself()->_getNowTime()
|
|
)
|
|
);
|
|
}
|
|
|
|
}
|