41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace models;
|
|
|
|
require_once('models/BuyRecord.php');
|
|
|
|
use phpcommon\SqlHelper;
|
|
|
|
class Recharge
|
|
{
|
|
|
|
public static function addOrder($goodsId){
|
|
$orderId = BuyRecord::genOrderId
|
|
(
|
|
GAME_ID,
|
|
1,
|
|
myself()->_getNowTime(),
|
|
myself()->_getAddress()
|
|
);
|
|
SqlHelper::insert
|
|
(myself()->_getSelfMysql(),
|
|
't_recharge_order',
|
|
array(
|
|
'order_id' => $orderId,
|
|
'account_id' => myself()->_getAccountId(),
|
|
'account_address' => myself()->_getAddress(),
|
|
'currency_address' => '0xfd42bfb03212da7e1a4608a44d7658641d99cf34',
|
|
'currency_name' => 'TestToken',
|
|
'status' => 0,
|
|
'item_id' => $goodsId,
|
|
'item_num' => 1,
|
|
'price' => 1,
|
|
'createtime' => myself()->_getNowTime(),
|
|
'modifytime' => myself()->_getNowTime(),
|
|
)
|
|
);
|
|
return $orderId;
|
|
}
|
|
|
|
}
|