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:
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/*
|
||||
* @link http://kodcloud.com/
|
||||
* @author warlee | e-mail:kodcloud@qq.com
|
||||
* @copyright warlee 2014.(Shanghai)Co.,Ltd
|
||||
* @license http://kodcloud.com/tools/license/license.txt
|
||||
*/
|
||||
|
||||
class fav extends Controller{
|
||||
private $sql;
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
$this->sql=new FileCache(USER.'data/fav.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取收藏夹json
|
||||
*/
|
||||
public function get() {
|
||||
show_json($this->sql->get());
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
public function add() {
|
||||
$name = $this->in['name'];
|
||||
$path = $this->in['path'];
|
||||
if($this->sql->get($name)){//已存在则自动重命名
|
||||
$index = 0;
|
||||
while ($this->sql->get($name.'('.$index.')')) {
|
||||
$index ++;
|
||||
}
|
||||
$name = $name.'('.$index.')';
|
||||
}
|
||||
$res=$this->sql->set(
|
||||
$name,
|
||||
array(
|
||||
'name' => $name,
|
||||
'path' => $path,
|
||||
'ext' => $this->in['ext'],
|
||||
'type' => $this->in['type']
|
||||
)
|
||||
);
|
||||
show_json(LNG('success'));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit() {
|
||||
$this->in['name'] = $this->in['name'];
|
||||
$this->in['path'] = $this->in['path'];
|
||||
$this->in['nameTo'] = $this->in['nameTo'];
|
||||
$newFav = $this->sql->get($this->in['name']);
|
||||
if(!isset($newFav['type'])){
|
||||
$newFav['type'] = 'folder';
|
||||
}
|
||||
//查找到一条记录,修改为该数组
|
||||
$toArray=array(
|
||||
'name'=>$this->in['nameTo'],
|
||||
'path'=>$this->in['pathTo'],
|
||||
'type'=>$newFav['type']
|
||||
);
|
||||
$this->sql->remove($this->in['name']);
|
||||
if($this->sql->set($this->in['nameTo'],$toArray)){
|
||||
show_json(LNG('success'));
|
||||
}
|
||||
show_json(LNG('error_repeat'),false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del() {
|
||||
$this->in['name'] = $this->in['name'];
|
||||
if($this->sql->remove($this->in['name'])){
|
||||
show_json(LNG('success'));
|
||||
}
|
||||
show_json(LNG('error'),false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user