Commit 4354e87b authored by shajiaiming's avatar shajiaiming

fix

parents c0f25112 333cff58
......@@ -94,7 +94,7 @@ class WalletController extends BaseController
$execer = 'coins';
$result = $service->getBalance($address, $execer);
if (0 !== $result['code']) {
$msg = $result['msg'];
$msg = '当前发币人数过多,请客官稍后再试';
$code = -1;
$data = null;
goto doEnd;
......
......@@ -33,20 +33,21 @@ class ExchangeBusiness
4 => 'Bittrex',
5 => 'Zb',
6 => 'Token7',
7 => 'S',
8 => 'Zg',
9 => 'Go',
10 => 'Zhaobi',
11 => 'Gdpro',
12 => 'Ex',
13 => 'Zt',
14 => 'Tsc',
15 => 'Binance',
16 => 'Ceohk',
17 => 'Biki',
18 => 'Bilaxy',
19 => 'Bitnasdaq',
20 => 'Boc'
7 => 'Zg',
8 => 'Go',
9 => 'Zhaobi',
10 => 'Ex',
11 => 'Zt',
12 => 'Tsc',
13 => 'Binance',
14 => 'Biki',
15 => 'Bilaxy',
16 => 'Bitnasdaq',
17 => 'Dag',
18 => 'Boc',
//7 => 'S',//已挂
//11 => 'Gdpro',//已挂
//16 => 'Ceohk', //已挂
];
/**
......@@ -99,7 +100,7 @@ class ExchangeBusiness
goto doEnd;
}
if (strtoupper($tag) == 'GST' || strtoupper($tag) == 'JNTK' || strtoupper($tag) == 'SPT' ||strtoupper($tag) == 'STO' || strtoupper($tag) == 'GM' || strtoupper($tag) == 'BSTC' || strtoupper($tag) == 'RYH' || strtoupper($tag) == 'CNDT' || strtoupper($tag) == 'WL' || strtoupper($tag) == 'ETS' || strtoupper($tag) == 'LIMS' || strtoupper($tag) == 'AT' || strtoupper($tag) == 'BTJ') {
if (strtoupper($tag) == 'GST' || strtoupper($tag) == 'JNTK' || strtoupper($tag) == 'SPT' || strtoupper($tag) == 'STO' || strtoupper($tag) == 'GM' || strtoupper($tag) == 'BSTC' || strtoupper($tag) == 'RYH' || strtoupper($tag) == 'CNDT' || strtoupper($tag) == 'WL' || strtoupper($tag) == 'ETS' || strtoupper($tag) == 'LIMS' || strtoupper($tag) == 'AT' || strtoupper($tag) == 'BTJ') {
$quotation = [
'low' => 0,
'high' => 0,
......@@ -122,6 +123,13 @@ class ExchangeBusiness
goto doEnd;
}
if (in_array(strtoupper($tag), ['DAG'])) {
$exchange = ExchangeFactory::createExchange("Dag");
$quotation = $exchange->getTicker($tag, 'USDT');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']);
goto doEnd;
}
if (in_array(strtoupper($tag), ['GM', 'BSTC'])) {
$exchange = ExchangeFactory::createExchange("Token7");
$quotation = $exchange->getTicker($tag, 'HA');
......
......@@ -130,8 +130,8 @@ class CoinIssueCoin extends CommonActiveRecord
}
$issue_record = CoinIssueCoin::find()->where(['platform_id' => $this->platform_id, 'symbol' => $this->symbol, 'status' => CoinIssueCoin::STATUS_SUCCESS])->sum('total');
$issue_record = empty($issue_record) ? 0 : $issue_record;
if ($issue_record + $this->$attribute > 20) {
$this->addError($attribute, '最大发行量20亿,目前已发行' . $issue_record . '亿');
if ($issue_record + $this->$attribute > 900) {
$this->addError($attribute, '最大发行量900亿,目前已发行' . $issue_record . '亿');
return false;
}
}
......
<?php
/**
* Created by PhpStorm.
* User: rlgyzhcn
* Date: 18-8-7
* Time: 上午11:30
*/
namespace common\service\exchange;
use linslin\yii2\curl\Curl;
class Dag extends Exchange implements ExchangeInterface
{
protected $supported_symbol = 'supported_symbol_dag';
protected $quotation_prefix = 'quotation_dag_';
protected $base_url = 'https://www.7xex.com/m/ticker/DAGUSDT';
public function symbolExists($tag = 'DAG', $aim = "USDT")
{
$supported = $this->redis->smembers($this->supported_symbol);
if (is_array($supported) && in_array($this->formatSymbol($tag, $aim), $supported)) {
return true;
}
return false;
}
/**
* 转化交易对为请求变量
*
* @param string $tag
* @param string $aim
* @return mixed
*/
public function formatSymbol($tag = 'DAG', $aim = 'USDT')
{
return strtoupper($tag . $aim);
}
/**
* 保存支持的交易对到redis数据库,使用crontab定时更新
*
* @return mixed|void
*/
public function setSupportedSymbol()
{
$this->redis->sadd($this->supported_symbol, 'DAGUSDT');
}
/**
* 更新交易对行情保存到redis,使用crontab定时更新
*
* @return mixed|void
*/
public function setQuotation()
{
$curl = new Curl();
$content = $curl->get($this->base_url, false);
if (is_array($content)) {
$key = $this->quotation_prefix . 'DAGUSDT';
$this->redis->hmset($key, 'low', $content['low'], 'high', $content['high'], 'last', $content['close'], 'vol', $content['volume']);
$this->redis->sadd($this->supported_symbol, 'DAGUSDT');
}
}
}
\ No newline at end of file
......@@ -22,6 +22,8 @@ class TickerController extends Controller
$ticker_builder->TickerSort();
});
}
echo date('Y-m-d H:i:s') .'排序更新成功' . PHP_EOL;
return 0;
}
public function actionHot()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment