Files
li 1b24994e74 feat: 后端全量更新 - 含所有本次需求
- Contract.php: 返回合约账户余额(balance_contract)
- My.php: 地址管理增加BTC/ETH
- AppContract.php: 一键平仓(closeall)
- AppProxy.php: 代理专属注册链接 + 分级权限(L1/L2)
- site.php: 手续费减半(0.018→0.009)
- agent_permission_setup.sql: 代理权限SQL
- crypto_news_crawler.py: 新闻自动采集脚本
2026-03-30 20:16:32 +08:00

196 lines
5.3 KiB
PHP
Executable File

<?php
namespace app\admin\model\app;
use think\Model;
class Baobiao extends Model
{
// 表名
protected $name = 'user';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
'prevtime_text',
'logintime_text',
'jointime_text',
'update_time_text',
'listentime_text',
'lh_act_text',
'last_level_time_text',
'apy_pay_text',
'auth_text',
'early_auth_text',
'high_auth_text',
'user_type_text'
];
public function getLhActList()
{
return ['1' => __('Lh_act 1'), '0' => __('Lh_act 0')];
}
public function getApyPayList()
{
return ['0' => __('Apy_pay 0'), '1' => __('Apy_pay 1')];
}
public function getAuthList()
{
return ['1' => __('Auth 1'), '0' => __('Auth 0'), '2' => __('Auth 2')];
}
public function getEarlyAuthList()
{
return ['0' => __('Early_auth 0'), '1' => __('Early_auth 1')];
}
public function getHighAuthList()
{
return ['0' => __('High_auth 0'), '1' => __('High_auth 1')];
}
public function getUserTypeList()
{
return ['1' => __('User_type 1'), '2' => __('User_type 2')];
}
public function getPrevtimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['prevtime']) ? $data['prevtime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getLogintimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['logintime']) ? $data['logintime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getJointimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['jointime']) ? $data['jointime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getUpdateTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['update_time']) ? $data['update_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getListentimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['listentime']) ? $data['listentime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getLhActTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['lh_act']) ? $data['lh_act'] : '');
$list = $this->getLhActList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getLastLevelTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['last_level_time']) ? $data['last_level_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getApyPayTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['apy_pay']) ? $data['apy_pay'] : '');
$list = $this->getApyPayList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getAuthTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['auth']) ? $data['auth'] : '');
$list = $this->getAuthList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getEarlyAuthTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['early_auth']) ? $data['early_auth'] : '');
$list = $this->getEarlyAuthList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getHighAuthTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['high_auth']) ? $data['high_auth'] : '');
$list = $this->getHighAuthList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getUserTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['user_type']) ? $data['user_type'] : '');
$list = $this->getUserTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
protected function setPrevtimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setLogintimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setJointimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setUpdateTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setListentimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setLastLevelTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
}