game2006api/webapp/models/BigData.php
aozhiwei 4fc4b6dc3d 1
2022-02-24 11:01:29 +08:00

48 lines
1.1 KiB
PHP

<?php
namespace models;
use mt;
use phpcommon\SqlHelper;
class BigData extends BaseModel {
public static function getData($type)
{
$row = SqlHelper::ormSelectOne(
myself()->_getSelfMysql(),
't_bigdata',
array(
'account_id' => myself()->_getAccountId(),
'type' => $type,
)
);
return $row ? $row['data'] : null;
}
public static function setData($type, $data)
{
SqlHelper::upsert
(myself()->_getSelfMysql(),
't_bigdata',
array(
'account_id' => myself()->_getAccountId(),
'type' => $type
),
array(
'data' => $data,
'modifytime' => myself()->_getNowTime()
),
array(
'account_id' => myself()->_getAccountId(),
'type' => $type,
'data' => $data,
'createtime' => myself()->_getNowTime(),
'modifytime' => myself()->_getNowTime()
)
);
}
}