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
+138
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\common\controller\Api;
|
||||
use think\Db;
|
||||
use think\Config;
|
||||
|
||||
/**
|
||||
* 公共接口
|
||||
*/
|
||||
class Publics extends Api
|
||||
{
|
||||
protected $noNeedLogin = "*";
|
||||
protected $noNeedRight = '*';
|
||||
|
||||
|
||||
//获取相关配置数据
|
||||
public function get_common_data()
|
||||
{
|
||||
$lang = $this->request->request("lang");
|
||||
switch ($lang) {
|
||||
case "zh-cn":
|
||||
$about_us = Config::get("site.about_us");
|
||||
$user_item = Config::get("site.user_item");
|
||||
$privacy_treaty = Config::get("site.privacy_treaty");
|
||||
$agreement = Config::get("site.agreement");
|
||||
break;
|
||||
default:
|
||||
$about_us = Config::get("site.about_us_en");
|
||||
$user_item = Config::get("site.user_item_en");
|
||||
$privacy_treaty = Config::get("site.privacy_treaty_en");
|
||||
$agreement = Config::get("site.agreement_en");
|
||||
break;
|
||||
}
|
||||
$data = [
|
||||
'about_us' => str_replace("src=\"","src=\"".Config::get("site.image_url"), $about_us), //关于我们
|
||||
'user_item' => str_replace("src=\"","src=\"".Config::get("site.image_url"), $user_item), //用户条款
|
||||
'privacy_treaty' => str_replace("src=\"","src=\"".Config::get("site.image_url"), $privacy_treaty), //隐私条约
|
||||
'agreement' => str_replace("src=\"","src=\"".Config::get("site.image_url"), $agreement), //用户协议
|
||||
'web_url' => Config::get("site.web_url"),
|
||||
];
|
||||
$this->success('success',$data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增文案
|
||||
*/
|
||||
public function new_common_data()
|
||||
{
|
||||
$lang = $this->request->request("lang");
|
||||
switch ($lang) {
|
||||
case "zh-cn":
|
||||
$huilv_text = Config::get("site.huilv_text");
|
||||
$api_text = Config::get("site.api_text");
|
||||
$api_sq_text = Config::get("site.api_sq_text");
|
||||
$shouquan_text = Config::get("site.shouquan_text");
|
||||
$refund_text = Config::get("site.refund_text");
|
||||
break;
|
||||
default:
|
||||
$huilv_text = Config::get("site.huilv_text");
|
||||
$api_text = Config::get("site.api_text");
|
||||
$api_sq_text = Config::get("site.api_sq_text");
|
||||
$shouquan_text = Config::get("site.shouquan_text");
|
||||
$refund_text = Config::get("site.refund_text_en");
|
||||
break;
|
||||
}
|
||||
$data = [
|
||||
'exchange_rate' => Config::get("site.exchange_rate"),
|
||||
'huilv_text' => str_replace("src=\"","src=\"".Config::get("site.image_url"), $huilv_text), //汇率文案
|
||||
'api_text' => str_replace("src=\"","src=\"".Config::get("site.image_url"), $api_text), //API文案
|
||||
'api_sq_text' => str_replace("src=\"","src=\"".Config::get("site.image_url"), $api_sq_text), //API申请须知
|
||||
'shouquan_text' => str_replace("src=\"","src=\"".Config::get("site.image_url"), $shouquan_text), //授权管理文案
|
||||
'refund_text' => $refund_text,
|
||||
];
|
||||
$this->success('success',$data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 版本信息
|
||||
*/
|
||||
public function version()
|
||||
{
|
||||
$res = Db::name("version")->where("status","normal")->order("id desc")->find();
|
||||
if($res['type'] == 2){
|
||||
if($this->auth->user_type != 2){
|
||||
$res = Db::name("version")->where("status","normal")->where("type",1)->order("id desc")->find();
|
||||
}
|
||||
}
|
||||
$this->success('success',$res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取平台logo
|
||||
*/
|
||||
public function logo()
|
||||
{
|
||||
$logo = Config::get("site.image_url").Config::get("site.logo");
|
||||
$data = array(
|
||||
"logo" => $logo,
|
||||
);
|
||||
$this->success('返回成功', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片上传
|
||||
*/
|
||||
public function image_upload()
|
||||
{
|
||||
// $this->error("网络延迟,请稍后再试");
|
||||
$file_url = "/uploads/image";
|
||||
controller('Common')->iamge_upload_single($file_url);
|
||||
}
|
||||
|
||||
/**
|
||||
* 官网信息返回
|
||||
*/
|
||||
public function website()
|
||||
{
|
||||
$download_a = Config::get("site.image_url").Config::get("site.download_a");
|
||||
$download_i = Config::get("site.image_url").Config::get("site.download_i");
|
||||
$data = array(
|
||||
"download_a" => $download_a,
|
||||
"download_i" => $download_i,
|
||||
);
|
||||
$this->success('返回成功', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 费率列表
|
||||
*/
|
||||
public function exchange_list()
|
||||
{
|
||||
$list = Db::name("app_exchange_set")->field("id,name,name_sx,exchange")->select();
|
||||
$this->success('返回成功', $list);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user