46 lines
1.1 KiB
PHP
46 lines
1.1 KiB
PHP
<?php
|
|
|
|
|
|
namespace models;
|
|
|
|
|
|
use phpcommon\SqlHelper;
|
|
class HashRateBattleData extends BaseModel
|
|
{
|
|
|
|
|
|
public static function getMyBattleData()
|
|
{
|
|
$row = SqlHelper::ormSelectOne(
|
|
myself()->_getSelfMysql(),
|
|
't_hash_rate_battle_data',
|
|
array(
|
|
'account_id' => myself()->_getAccountId(),
|
|
)
|
|
);
|
|
return $row ? json_decode($row['battle_data'], true) : array();
|
|
}
|
|
|
|
public static function add($battleData)
|
|
{
|
|
SqlHelper::upsert
|
|
(myself()->_getSelfMysql(),
|
|
't_hash_rate_battle_data',
|
|
array(
|
|
'account_id' => myself()->_getAccountId(),
|
|
),
|
|
array(
|
|
'battle_data' => $battleData,
|
|
'modifytime' => myself()->_getNowTime(),
|
|
),
|
|
array(
|
|
'account_id' => myself()->_getAccountId(),
|
|
'battle_data' => $battleData,
|
|
'createtime' => myself()->_getNowTime(),
|
|
'modifytime' => myself()->_getNowTime()
|
|
)
|
|
);
|
|
}
|
|
|
|
|
|
} |