Commit 452c240f authored by shajiaiming's avatar shajiaiming

托管币种参数

parent 39f44bdd
......@@ -91,9 +91,9 @@ class ServiceController extends BaseController
*/
public function actionCoinIndex()
{
//$request = Yii::$app->request;
$platform_id = Yii::$app->request->get('platform_id', 6);
//$coinItems = $request->post('names',[]);
$coin_recommendItems = $this->coinRecommendList();
$coin_recommendItems = $this->coinRecommendList($platform_id);
$fields =['id', 'sid', 'icon', 'name', 'nickname','chain','platform'];
$rows = Coin::getSelectList(1, 999, $fields,[['in','id',$coin_recommendItems]]);
return ['code' => 0,'data' => $rows,'msg' => '币种列表获取成功'];
......@@ -103,9 +103,9 @@ class ServiceController extends BaseController
* @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){
$coin_ids = array_column($recommend_list,'cid');
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