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

67 lines
1.8 KiB
PHP
Executable File

<?php
namespace app\admin\controller\app;
use app\common\controller\Backend;
use think\Db;
/**
* 货币汇率管理
*
* @icon fa fa-circle-o
*/
class AppRate extends Backend
{
/**
* AppRate模型对象
* @var \app\admin\model\app\AppRate
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\app\AppRate;
$this->view->assign("isZqtradeList", $this->model->getIsZqtradeList());
$this->view->assign("isHytradeList", $this->model->getIsHytradeList());
}
public function import()
{
parent::import();
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
public function get_ctrl($ids = null)
{
$row = $this->model->get($ids);
if (!$row) {
$this->error(__('No Results were found'));
}
if ($this->request->isPost()) {
$params = $this->request->post("row/a");
if ($params) {
$result = Db::name('app_rate')
->where('id',$row['id'])->update(['tradectrl_json'=>$params['tradectrl_json'],'updatetime'=>time()]);
if($result)
{
$this->success('ok');
}else{
$this->error('系统繁忙');
}
}
}
$this->view->assign("row", $row);
return $this->view->fetch();
}
}