50 lines
1.1 KiB
PHP
50 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace models;
|
|
|
|
use mt;
|
|
use phpcommon\SqlHelper;
|
|
|
|
class UserWalletRecord extends BaseModel {
|
|
|
|
public static function find($conn, $txHash)
|
|
{
|
|
$row = SqlHelper::ormSelectOne(
|
|
$conn,
|
|
't_user_wallet_record',
|
|
array(
|
|
'txhash' => $txHash,
|
|
)
|
|
);
|
|
return $row;
|
|
}
|
|
|
|
public static function add($conn, $txHash, $dir, $accountId, $type, $value)
|
|
{
|
|
SqlHelper::insert(
|
|
$conn,
|
|
't_user_wallet_record',
|
|
array(
|
|
'txhash' => $txHash,
|
|
'dir' => $dir,
|
|
'account_id' => $accountId,
|
|
'type' => $type,
|
|
'value' => $value,
|
|
'createtime' => myself()->_getNowTime(),
|
|
'modifytime' => myself()->_getNowTime()
|
|
));
|
|
}
|
|
|
|
public static function update($conn, $txHash, $fieldKv)
|
|
{
|
|
SqlHelper::update(
|
|
$conn,
|
|
't_user_wallet_record',
|
|
array(
|
|
'txhash' => $txHash,
|
|
),
|
|
$fieldKv);
|
|
}
|
|
|
|
}
|