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: 新闻自动采集脚本
This commit is contained in:
Executable
+67
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\app;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Order extends Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 表名
|
||||
protected $name = 'order';
|
||||
|
||||
// 自动写入时间戳字段
|
||||
protected $autoWriteTimestamp = 'int';
|
||||
|
||||
// 定义时间戳字段名
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = false;
|
||||
protected $deleteTime = false;
|
||||
|
||||
// 追加属性
|
||||
protected $append = [
|
||||
'symbol_text',
|
||||
'rise_or_fall_text'
|
||||
];
|
||||
|
||||
|
||||
|
||||
public function getSymbolList()
|
||||
{
|
||||
return ['btcusdt' => __('Symbol btcusdt'), 'bchusdt' => __('Symbol bchusdt'), 'ethusdt' => __('Symbol ethusdt'), 'ltcusdt' => __('Symbol ltcusdt'), 'eosusdt' => __('Symbol eosusdt')];
|
||||
}
|
||||
|
||||
public function getRiseOrFallList()
|
||||
{
|
||||
return ['rise' => __('Rise_or_fall rise'), 'fall' => __('Rise_or_fall fall')];
|
||||
}
|
||||
public function getSetLossList()
|
||||
{
|
||||
return ['0' => __('默认'), '1' => __('盈'), '2' => __('亏')];
|
||||
}
|
||||
|
||||
|
||||
public function getSymbolTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['symbol']) ? $data['symbol'] : '');
|
||||
$list = $this->getSymbolList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
public function getRiseOrFallTextAttr($value, $data)
|
||||
{
|
||||
$value = $value ? $value : (isset($data['rise_or_fall']) ? $data['rise_or_fall'] : '');
|
||||
$list = $this->getRiseOrFallList();
|
||||
return isset($list[$value]) ? $list[$value] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user