44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
namespace models;
|
|
|
|
use mt;
|
|
use phpcommon;
|
|
use phpcommon\SqlHelper;
|
|
class Pass extends BaseModel
|
|
{
|
|
|
|
public static function find($seasonId){
|
|
$row = SqlHelper::ormSelectOne(
|
|
myself()->_getSelfMysql(),
|
|
't_user_pass',
|
|
array(
|
|
'account_id' => myself()->_getAccountId(),
|
|
'season_id' => $seasonId,
|
|
)
|
|
);
|
|
return $row ? $row : null;
|
|
}
|
|
|
|
public static function upsert($seasonId,$fieldKv){
|
|
SqlHelper::upsert(
|
|
myself()->_getSelfMysql(),
|
|
't_user_pass',
|
|
array(
|
|
'account_id' => myself()->_getAccountId(),
|
|
'season_id' => $seasonId,
|
|
|
|
),
|
|
array(
|
|
'data' => $fieldKv,
|
|
'modifytime' => myself()->_getNowTime()
|
|
),
|
|
array(
|
|
'account_id' => myself()->_getAccountId(),
|
|
'season_id' => $seasonId,
|
|
'data' => $fieldKv,
|
|
'createtime' => myself()->_getNowTime(),
|
|
'modifytime' => myself()->_getNowTime()
|
|
)
|
|
);
|
|
}
|
|
} |