Commit 9666555d authored by shajiaiming's avatar shajiaiming

solve conflict

parents 618aefbd b4735183
......@@ -31,15 +31,15 @@ class AirDropController extends BaseController
goto doEnd;
}
$miner_address = $data['miner_address'] ?? null;
if (!empty($miner_address)) {
$exist = AirDrop::find()->where(['identifier' => $identifier, 'miner_address' => $miner_address])->one();
if (false == $exist) {
$this->code = -1;
$this->msg = '设备号和矿工地址不匹配,请重新确认.';
goto doEnd;
}
}
// $miner_address = $data['miner_address'] ?? null;
// if (!empty($miner_address)) {
// $exist = AirDrop::find()->where(['identifier' => $identifier, 'miner_address' => $miner_address])->one();
// if (false == $exist) {
// $this->code = -1;
// $this->msg = '设备号和矿工地址不匹配,请重新确认.';
// goto doEnd;
// }
// }
doEnd :
return ['code' => $this->code, 'msg' => $this->msg, 'data' => $this->data];
......
......@@ -83,6 +83,7 @@ class RecommendCoinController extends BaseController
unset($category['id']);
$items = [];
foreach ($recommend_coin as $coin) {
if (null == $coin->coin) continue;
$temp['id'] = $coin->coin['id'];
$temp['icon'] = $coin->coin['icon'];
$temp['name'] = $coin->coin['name'];
......
......@@ -182,6 +182,10 @@ class TickerController extends BaseController
if ('BCH' == strtoupper($tag_first)) {
$tag_first = 'BCC';
}
if ('USAT' == strtoupper($tag_second)) {
$tag_second = 'USDT';
}
$exchange = ExchangeFactory::createExchange($exchange);
$quotation = $exchange->getTicker(strtolower($tag_first), strtolower($tag_second));
if (empty($quotation)) continue;
......
......@@ -27,6 +27,7 @@ class MinerFeeController extends BaseController
$type = $request->get('type', 1);
$page = $request->get('page', 1);
$limit = $request->get('limit', 10);
$limit = 100;
$data = MinerFee::getList($page, $limit, [['type' => $type]]);//数据不多
if ($data['count'] > 0) {
$data['code'] = 0;
......
......@@ -191,7 +191,7 @@ class ExchangeBusiness
goto doEnd;
}
if (in_array(strtoupper($tag), ['GST', 'JNTK', 'SPT', 'STO', 'GM', 'BSTC', 'RYH', 'CNDT', 'WL', 'ETS', 'LIMS', 'AT', 'BTJ', 'WXB'])) {
if (in_array(strtoupper($tag), ['GST', 'JNTK', 'SPT', 'STO', 'GM', 'BSTC', 'RYH', 'CNDT', 'WL', 'ETS', 'LIMS', 'AT', 'BTJ', 'WXB', 'GFCC'])) {
$quotation = [
'low' => 0,
'high' => 0,
......@@ -348,6 +348,15 @@ class ExchangeBusiness
goto doEnd;
}
if (in_array(strtoupper($tag), ['BBD'])) {
$quotation = [
'low' => 0.2,
'high' => 0.2,
'last' => 0.2,
];
goto doEnd;
}
if (in_array(strtoupper($tag), ['LFT'])) {
$quotation = [
'low' => 100,
......@@ -460,7 +469,7 @@ class ExchangeBusiness
$exchange = ExchangeFactory::createExchange("Go");
$rate = $exchange->getTicker("CNY", "USD");
$cny_usd_rate = 1 / $rate['last'];
if (in_array(strtoupper($tag), ['FOLI', 'CIC', 'ZYC', 'MC', 'KPC8', 'BVA', 'DAG', 'BNC', 'GHP', 'DRA', 'ETC', 'PAX', 'STH', 'XJH', 'SFT', 'TSC', 'SUM', 'USDW', 'FUT', 'MBTC', 'METH', 'GLCW', 'HDC', 'LELE', 'ZUE'])) {
if (in_array(strtoupper($tag), ['FOLI', 'CIC', 'ZYC', 'MC', 'KPC8', 'BBD', 'BVA', 'DAG', 'BNC', 'GHP', 'DRA', 'ETC', 'PAX', 'STH', 'XJH', 'SFT', 'TSC', 'SUM', 'USDW', 'FUT', 'MBTC', 'METH', 'GLCW', 'HDC', 'LELE', 'ZUE'])) {
$quotation['usd'] = (float)sprintf("%0.4f", $quotation['last']);
$quotation['rmb'] = (float)sprintf("%0.4f", $quotation['last'] / $cny_usd_rate);
$quotation['low'] = (float)sprintf("%0.4f", $quotation['low']);
......
......@@ -18,19 +18,19 @@ class ExploreAppController extends BaseController
$data = null;
$page = Yii::$app->request->get('page', 1);
$size = Yii::$app->request->get('size', 10);
$platform_id = Yii::$app->request->getPlatformId();
if (1 == $platform_id) {
$param_platform_id = Yii::$app->request->get('platform_id', '');
if (false != $param_platform_id) {
$platform_id = $param_platform_id;
}
}
$group = Yii::$app->request->getGroup();
if (Yii::$app->request->isPost) {
$params = Yii::$app->request->post();
if ('administrator' == $group) {
$params['platform_id'] = isset($params['platform_id']) ? $params['platform_id'] : Yii::$app->request->getPlatformId();
} else {
$params['platform_id'] = Yii::$app->request->getPlatformId();
}
$model = new ExploreAppCategory();
$model->setScenario(ExploreAppCategory::SCENARIOS_CREATE);
$params = Yii::$app->request->post();
$params['platform_id'] = $platform_id;
$name_arr = $params['name'];
$name = [];
......@@ -48,6 +48,11 @@ class ExploreAppController extends BaseController
}
if (Yii::$app->request->isGet) {
$platform_id = Yii::$app->request->getPlatformId();
if ('administrator' == $group) {
$platform_id = Yii::$app->request->get('platform_id', 1);
}
$query = ExploreAppCategory::find()->where(['platform_id' => $platform_id])->asArray();
$app_category_model = $query->offset(($page - 1) * $size)->orderBy('sort')->limit($size)->asArray()->all();
foreach ($app_category_model as &$val) {
......@@ -94,7 +99,8 @@ class ExploreAppController extends BaseController
}
$model = ExploreAppCategory::findOne($id);
if ($model->platform_id != $platform_id) {
$group = Yii::$app->request->getGroup();
if ('administrator' != $group && $model->platform_id != $platform_id) {
$msg = '无权修改';
$code = -1;
goto doEnd;
......@@ -141,9 +147,10 @@ class ExploreAppController extends BaseController
$code = -1;
goto doEnd;
}
$model = ExploreAppCategory::find()->where(['id' => $id, 'platform_id' => $platform_id])->one();
$model = ExploreAppCategory::find()->where(['id' => $id])->one();
if ($model->platform_id != $platform_id) {
$group = Yii::$app->request->getGroup();
if ('administrator' != $group && $model->platform_id != $platform_id) {
$msg = '无权修改';
$code = -1;
goto doEnd;
......@@ -201,7 +208,8 @@ class ExploreAppController extends BaseController
$model = new ExploreApp();
$model->setScenario(ExploreApp::SCENARIOS_CREATE);
$params = Yii::$app->request->post();
$params['platform_id'] = $platform_id;
$AppCategory = ExploreAppCategory::find()->select('platform_id')->where(['id' => $params['app_category_id']])->asArray()->one();
$params['platform_id'] = (int)$AppCategory['platform_id'] ?? 0;
$params['email'] = isset($params['email']) ? $params['email'] : 0;
$params['phone'] = isset($params['phone']) ? $params['phone'] : 0;
$params['real_name'] = isset($params['real_name']) ? $params['real_name'] : 0;
......@@ -249,7 +257,8 @@ class ExploreAppController extends BaseController
}
$model = ExploreApp::findOne($id);
if ($model->platform_id != $platform_id) {
$group = Yii::$app->request->getGroup();
if ('administrator' != $group && $model->platform_id != $platform_id) {
$msg = '无权修改';
$code = -1;
goto doEnd;
......@@ -293,9 +302,10 @@ class ExploreAppController extends BaseController
goto doEnd;
}
if (Yii::$app->request->isDelete) {
$model = ExploreApp::find()->where(['id' => $id, 'platform_id' => $platform_id])->one();
$model = ExploreApp::find()->where(['id' => $id])->one();
if ($model->platform_id != $platform_id) {
$group = Yii::$app->request->getGroup();
if ('administrator' != $group && $model->platform_id != $platform_id) {
$msg = '无权修改';
$code = -1;
goto doEnd;
......
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