Files
im/app/model/Withdrawl.php
commie c153975eed 7
2026-01-08 05:42:44 +08:00

71 lines
1.8 KiB
PHP
Executable File

<?php
namespace app\model;
use app\model\Base;
/**
* @property integer $id 主键(ID) - 无注释
* @property integer $user_id 用户ID
* @property float $deduction_amount 提现金额
* @property float $recive_amount 到账金额
* @property float $fee 后续费
* @property string $title 姓名
* @property string $network 方式
* @property string $address 地址
* @property integer $transfer_at 转账时间
* @property string $txid 凭证
* @property string $memo 备注
* @property integer $created_at 创建时间
* @property integer $updated_at 更新时间
* @property integer $status 状态
*/
class Withdrawl extends Base
{
protected function getOptions(): array
{
// 所有的参数配置统一返回
return array_merge(parent::getOptions(),[
'append' => ['status_text']
]);
}
function getStatusTextAttr($v,$row){
if($v){
return \app\enum\WithdrawlStatus::tryFromValue($row['status'])->getDescription();
}
}
function setTransferAtAttr($v){
if($v && strpos($v,'-')){
return strtotime($v);
}
}
function setCreatedAtAttr($v){
if($v && strpos($v,'-')){
return strtotime($v);
}
}
function setUpdatedAtAttr($v){
if($v && strpos($v,'-')){
return strtotime($v);
}
}
function getNetworkList(){
return [
"BEP-20"=>"BEP-20",
"TRC-20"=>"TRC-20",
"WECHAT"=>"微信",
"ALIPAY"=>"支付宝"
];
}
function getStatusList(){
return \app\enum\WithdrawlStatus::toArray();
}
public function user()
{
return $this->belongsTo('User', 'user_id', 'id');//->setEagerlyType(0);
}
}