刮刮后端接口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
981 B

<?php
declare (strict_types = 1);
namespace app\model;
use think\Model;
/**
* @mixin \think\Model
*/
class WithdrawalRecords extends Model
{
/**
* 用户提现记录
* @param $user_id
* @param $withdrawal_amount
* @param $withdrawal_balance
* @param $status
* @param $trade_type
* @return mixed
*/
public static function createRecords($user_id,$withdrawal_amount,$withdrawal_balance,$status = 0,$trade_type = 1)
{
$Records = new WithdrawalRecords();
$Records->user_id = $user_id;
$Records->withdrawal_amount = $withdrawal_amount;
$Records->withdrawal_balance = $withdrawal_balance;
$Records->trade_type = $trade_type;
$Records->status = $status;
$Records->apply_time = date("Y-m-d H:i:s",time());
if ($status == 1) {
$Records->withdrawal_time = date("Y-m-d H:i:s",time());
}
$Records->save();
return $Records->id;
}
}