game2006api/webapp/models/FragmentRecord.php
2023-03-08 17:12:06 +08:00

53 lines
1.3 KiB
PHP

<?php
namespace models;
use mt;
use phpcommon\SqlHelper;
class FragmentRecord extends BaseModel {
const HERO_FRAGMENT = 1111;
const GUN_FRAGMENT = 2222;
public static function getGamesNum($param)
{
$row = SqlHelper::ormSelectOne
(myself()->_getSelfMysql(),
't_fragment_record',
array(
'account_id' => myself()->_getAccountId(),
'param' => $param,
)
);
$num = 0;
if ($row) {
$num = $row['value'];
}
return $num;
}
public static function upsertGamesNum($param,$value){
SqlHelper::upsert
(myself()->_getSelfMysql(),
't_fragment_record',
array(
'account_id' => myself()->_getAccountId(),
'param' => $param
),
array(
'value' => $value,
'modifytime' => myself()->_getNowDaySeconds()
),
array(
'account_id' => myself()->_getAccountId(),
'param' => $param,
'value' => 1,
'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowDaySeconds()
)
);
}
}