Commit 21a718a9 authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/trade-node' into 'master'

托管币种参数 See merge request !18
parents 5dbb1273 452c240f
...@@ -91,9 +91,9 @@ class ServiceController extends BaseController ...@@ -91,9 +91,9 @@ class ServiceController extends BaseController
*/ */
public function actionCoinIndex() public function actionCoinIndex()
{ {
//$request = Yii::$app->request; $platform_id = Yii::$app->request->get('platform_id', 6);
//$coinItems = $request->post('names',[]); //$coinItems = $request->post('names',[]);
$coin_recommendItems = $this->coinRecommendList(); $coin_recommendItems = $this->coinRecommendList($platform_id);
$fields =['id', 'sid', 'icon', 'name', 'nickname','chain','platform']; $fields =['id', 'sid', 'icon', 'name', 'nickname','chain','platform'];
$rows = Coin::getSelectList(1, 999, $fields,[['in','id',$coin_recommendItems]]); $rows = Coin::getSelectList(1, 999, $fields,[['in','id',$coin_recommendItems]]);
return ['code' => 0,'data' => $rows,'msg' => '币种列表获取成功']; return ['code' => 0,'data' => $rows,'msg' => '币种列表获取成功'];
...@@ -103,9 +103,9 @@ class ServiceController extends BaseController ...@@ -103,9 +103,9 @@ class ServiceController extends BaseController
* @return array * @return array
* 托管钱包推荐币种 * 托管钱包推荐币种
*/ */
private function coinRecommendList() private function coinRecommendList($platform_id)
{ {
$recommend_list = CoinRecommend::find()->select('cid')->where(['platform_id' => 6 ])->all(); $recommend_list = CoinRecommend::find()->select('cid')->where(['platform_id' => $platform_id ])->all();
if($recommend_list){ if($recommend_list){
$coin_ids = array_column($recommend_list,'cid'); $coin_ids = array_column($recommend_list,'cid');
return $coin_ids; return $coin_ids;
......
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