public function getZBConfig() { //获取配置简单加密 $key = $this->data['key']; if (md5($this->key) != $key) { return $this->rd('', '认证失败', 1); } $chongzhi_info = model('Xdata')->get('admin_Config:charge'); $info['cash_exchange_ratio_list'] = getExchangeConfig('cash'); $info['charge_ratio'] = $chongzhi_info['charge_ratio'] ?: '100'; //1人民币等于多少积分 $info['charge_description'] = $chongzhi_info['description'] ?: '充值描述'; //充值描述 $field = $this->data['field']; //关键字 不传为全部 if ($field) { $field = explode(',', $field); foreach ($info as $key => $value) { if (!in_array($key, $field)) { unset($info[$key]); } } } return $this->rd($info); }
function setLatestpolo() { //high, low, bid, ask, volume global $polo_latest; $config = getExchangeConfig("polo"); $data = file_get_contents($config["apiUrl"]); $json = json_decode($data, true); $polo_latest = array('last' => $json['last_price'], 'high' => $json['high'], 'low' => $json['low'], 'bid' => $json['bid'], 'ask' => $json['ask'], 'volume' => $json['volume'], 'currency' => 'USD', 'exchange' => 'Poloniex'); //lost data: mid //'Mid: '.$json['mid'] }
function setLatestOKCOIN() { global $okc_latest; $config = getExchangeConfig("okc"); $data = file_get_contents($config["apiUrl"]); $json = json_decode($data, true); $okc_latest = array('last' => $json['ticker']['last'], 'high' => $json['ticker']['high'], 'low' => $json['ticker']['low'], 'bid' => $json['ticker']['buy'], 'ask' => $json['ticker']['sell'], 'volume' => $json['ticker']['vol'], 'currency' => 'USD', 'exchange' => 'OKCoin'); // lost data: date // $json['date'] }