Commit ce361c42 authored by shajiaiming's avatar shajiaiming

Merge branch 'develop' into 'master'

Develop See merge request !51
parents 98edb9e3 3ffb6416
......@@ -160,11 +160,13 @@ class CoinController extends BaseController
$value['high'] = $coin_quotations[$temp_key]['high'];
$value['last'] = $coin_quotations[$temp_key]['last'];
$value['rmb'] = $coin_quotations[$temp_key]['rmb'];
$value['usd'] = $coin_quotations[$temp_key]['usd'] ?? 0;
} else {
$value['low'] = 0;
$value['high'] = 0;
$value['last'] = 0;
$value['rmb'] = 0;
$value['usd'] = 0;
}
}
$value['id'] = $value['cid'];
......
......@@ -186,6 +186,7 @@
<select name="platform_type" >
<option value="1">币钱包</option>
<option value="2">托管账户</option>
<option value="3">通用</option>
</select>
</div>
</div>
......
......@@ -188,6 +188,7 @@
<select name="platform_type" >
<option value="1" <?php if($item['platform_type'] ==1) echo "selected"?>>币钱包</option>
<option value="2" <?php if($item['platform_type'] ==2) echo "selected"?>>托管账户</option>
<option value="3" <?php if($item['platform_type'] ==3) echo "selected"?>>通用</option>
</select>
</div>
</div>
......
......@@ -97,12 +97,12 @@ class ApplicationBusiness
$app_cate_Model = CoinAppCate::find();
if(array_key_exists('platform_id', $condition)){
$query = $app_cate_Model->JoinWith(['application'], false)
->select('cate_id,app_id,name,icon,type,native_url,native_login_url,h5_url,android_url,ios_url,app_store_url,advertise,redirect_type,open_type_app,'.CoinAppCate::tableName().'.sort')
->select('cate_id,app_id,name,icon,type,native_url,native_login_url,h5_url,android_url,ios_url,app_store_url,advertise,redirect_type,open_type_app,platform_type,'.CoinAppCate::tableName().'.sort')
->where($condition)
->orderBy(CoinAppCate::tableName().'.sort asc');
} else {
$query = $app_cate_Model->JoinWith(['application'], false)
->select('cate_id,app_id,name,icon,type,native_url,native_login_url,h5_url,android_url,ios_url,app_store_url,advertise,redirect_type,open_type_app,'.CoinAppCate::tableName().'.sort')
->select('cate_id,app_id,name,icon,type,native_url,native_login_url,h5_url,android_url,ios_url,app_store_url,advertise,redirect_type,open_type_app,platform_type,'.CoinAppCate::tableName().'.sort')
->orderBy(CoinAppCate::tableName().'.sort asc');
}
......
......@@ -205,7 +205,7 @@ class CoinBusiness
$quotation = ExchangeBusiness::getquatation($row['name']);
if($quotation){
$tikerdata['price'] = $quotation['rmb'];
$tikerdata['dollar'] = $quotation['last'];
$tikerdata['dollar'] = $quotation['usd'];
}else{
$tikerdata['price'] = 0;
$tikerdata['dollar'] = 0;
......
......@@ -59,7 +59,7 @@ class ExchangeBusiness
$quotation['low'] = 1.00;
$quotation['high'] = 1.00;
$quotation['last'] = (float)sprintf("%0.4f", $quotation['rmb']/$rate);
return $quotation;
goto doEnd;
}
if(strtoupper($tag) == 'BOSS'){
$quotation = [
......@@ -68,7 +68,7 @@ class ExchangeBusiness
'last' => 2000,
'rmb' => 2000,
];
return $quotation;
goto doEnd;
}
if(strtoupper($tag) == 'CPF'){
......@@ -78,7 +78,7 @@ class ExchangeBusiness
'last' => 3.4,
'rmb' => 3.4,
];
return $quotation;
goto doEnd;
}
if(in_array($tag,$coin_quotation_disable_items)){
......@@ -91,42 +91,54 @@ class ExchangeBusiness
$exchange = ExchangeFactory::createExchange("Token7");
$quotation = $exchange->getTicker($tag, 'HA');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']);
return $quotation;
goto doEnd;
}
if(in_array(strtoupper($tag),['BECC'])){
$exchange = ExchangeFactory::createExchange("S");
$quotation = $exchange->getTicker($tag, 'ST');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']);
return $quotation;
goto doEnd;
}
if(in_array(strtoupper($tag),['GHP'])){
$exchange = ExchangeFactory::createExchange("Zg");
$quotation = $exchange->getTicker($tag, 'CNZ');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']);
return $quotation;
goto doEnd;
}
if(in_array(strtoupper($tag),['SFT'])){
$exchange = ExchangeFactory::createExchange("Zhaobi");
$quotation = $exchange->getTicker($tag, 'CNY');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']);
return $quotation;
goto doEnd;
}
if(in_array(strtoupper($tag),['CTG'])){
$exchange = ExchangeFactory::createExchange("Gdpro");
$quotation = $exchange->getTicker($tag, 'CNY');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']);
return $quotation;
goto doEnd;
}
if(in_array(strtoupper($tag),['USDT'])){
$exchange = ExchangeFactory::createExchange("Go");
$quotation = $exchange->getTicker('CNY', 'USD');
$quotation['rmb'] = (float)sprintf("%0.2f", $quotation['last']);
return $quotation;
goto doEnd;
}
if(in_array(strtoupper($tag),['SJPY'])){
$exchange = ExchangeFactory::createExchange("Boc");
$quotation = $exchange->getTicker('CNY', 'JPY');
$quotation = [
'low' => (float)sprintf("%0.4f", $quotation['low']/100),
'high' => (float)sprintf("%0.4f", $quotation['high']/100),
'last' => (float)sprintf("%0.4f", $quotation['last']/100),
'rmb' => (float)sprintf("%0.4f", $quotation['last']/100),
];
goto doEnd;
}
foreach (self::$exchanges as $exchange) {
......@@ -182,6 +194,11 @@ class ExchangeBusiness
}
$quotation['rmb'] = (float)sprintf("%0.4f", $rate * $quotation['last']);
doEnd :
$exchange = ExchangeFactory::createExchange("Go");
$rate = $exchange->getTicker("CNY", "USD");
$cny_usd_rate = 1 / $rate['last'];
$quotation['usd'] = (float)sprintf("%0.4f", $quotation['rmb'] * $cny_usd_rate);
return $quotation;
}
......@@ -253,6 +270,7 @@ class ExchangeBusiness
$rows[$key]['last'] = 0;
$rows[$key]['low'] = 0;
$rows[$key]['high'] = 0;
$rows[$key]['usd'] = 0;
}
}
if (strtoupper($row['platform']) == 'GUODUN') {
......
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