game2006api/webapp/models/ActivationCode.php
hujiabin d67479e07b 1
2024-08-29 10:42:36 +08:00

56 lines
1.4 KiB
PHP

<?php
namespace models;
use mt;
use phpcommon\SqlHelper;
class ActivationCode extends BaseModel
{
public static function verifyCode($code){
$row = SqlHelper::ormSelectOne(
myself()->_getAccountMysql(),
't_activation_code',
array(
'activation_code' => $code,
)
);
if ($row){
return true;
}
return false;
}
public static function addBindCode($code){
SqlHelper::upsert(
myself()->_getAccountMysql(),
't_activation_code_bind',
array(
'account_id' => myself()->_getAccountId(),
),
array(
),
array(
'account_id' => myself()->_getAccountId(),
'activation_code' =>$code,
'createtime' =>myself()->_getNowTime(),
'modifytime' =>myself()->_getNowTime(),
)
);
}
public static function verifyAccountBind(){
$row = SqlHelper::ormSelectOne(
myself()->_getAccountMysql(),
't_activation_code_bind',
array(
'account_id' => myself()->_getAccountId(),
)
);
if ($row){
return true;
}
return false;
}
}