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:
+124
@@ -0,0 +1,124 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\controller\app;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use think\Db;
|
||||
|
||||
/**
|
||||
* 收支明细-法币
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
class AppDetailedFb extends Backend
|
||||
{
|
||||
|
||||
/**
|
||||
* AppDetailedFb模型对象
|
||||
* @var \app\admin\model\app\AppDetailedFb
|
||||
*/
|
||||
protected $model = null;
|
||||
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\admin\model\app\AppDetailedFb;
|
||||
$this->view->assign("cartList", $this->model->getCartList());
|
||||
$this->view->assign("typeList", $this->model->getTypeList());
|
||||
}
|
||||
|
||||
public function import()
|
||||
{
|
||||
parent::import();
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
/**
|
||||
* 查看
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
//设置过滤方法
|
||||
$this->request->filter(['strip_tags']);
|
||||
if ($this->request->isAjax())
|
||||
{
|
||||
//如果发送的来源是Selectpage,则转发到Selectpage
|
||||
if ($this->request->request('keyField'))
|
||||
{
|
||||
return $this->selectpage();
|
||||
}
|
||||
// list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||
$offset = $this->request->get("offset", 0);
|
||||
$limit = $this->request->get("limit", 0);
|
||||
$params = json_decode(input('filter'),true);
|
||||
$op = json_decode(input('op'),true);
|
||||
if(count($params) > 0){
|
||||
$new_params = $new_op = [];
|
||||
foreach ($params as $key => $value) {
|
||||
if($key == 'mobile')
|
||||
{
|
||||
$new_params['u.' . $key] = $value;
|
||||
$new_op['u.' . $key] = $op[$key];
|
||||
}else if($key == 'user_name'){
|
||||
$new_params['u.nickname'] = $value;
|
||||
$new_op['u.nickname'] = $op[$key];
|
||||
}else if($key == 'coinname'){
|
||||
$new_params['b.name'] = $value;
|
||||
$new_op['b.name'] = $op[$key];
|
||||
}else {
|
||||
$new_params['a.' . $key] = $value;
|
||||
$new_op['a.' . $key] = $op[$key];
|
||||
}
|
||||
}
|
||||
$w = $this->rewriteQuery($new_params, $new_op);
|
||||
}else{
|
||||
$w['a.id'] = array('>', 0);
|
||||
}
|
||||
$w['u.path'] = ['like','|1|%'];
|
||||
if($this->auth->id != 1) {
|
||||
$admin_id = $this->auth->id;
|
||||
$proxy = Db::name('app_proxy a')
|
||||
->field('a.*,b.path')
|
||||
->where('admin_id',$admin_id)
|
||||
->join('user b','a.user_id = b.id','left')
|
||||
->find();
|
||||
$w['u.path'] = ['like',$proxy['path']."%"];
|
||||
}
|
||||
|
||||
$total = Db::name('app_detailed_fb')
|
||||
->alias('a')
|
||||
->field('a.*,u.nickname as user_name,b.name as coinname')
|
||||
->join('fa_user u', 'a.user_id = u.id')
|
||||
->join('fa_app_currency b', 'b.id = a.curr_id')
|
||||
->where($w)
|
||||
->count();
|
||||
$list = Db::name('app_detailed_fb')
|
||||
->alias('a')
|
||||
->field('a.*,u.nickname as user_name,b.name as coinname')
|
||||
->join('fa_user u', 'a.user_id = u.id')
|
||||
->join('fa_app_currency b', 'b.id = a.curr_id')
|
||||
->where($w)
|
||||
->order('a.id', 'desc')
|
||||
->limit($offset, $limit)
|
||||
->select();
|
||||
$count_price = Db::name('app_detailed_fb')
|
||||
->alias('a')
|
||||
->field('a.*,u.nickname as user_name,b.name as coinname')
|
||||
->join('fa_user u', 'a.user_id = u.id')
|
||||
->join('fa_app_currency b', 'b.id = a.curr_id')
|
||||
->where($w)
|
||||
->sum("a.price");
|
||||
$result = array("total" => $total, "rows" => $list,"count_price"=>$count_price);
|
||||
|
||||
return json($result);
|
||||
}
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user