Commit b35c8b41 authored by shajiaiming's avatar shajiaiming

推荐币种区分平台

parent fc423284
......@@ -92,8 +92,8 @@ class ServiceController extends BaseController
public function actionCoinIndex()
{
$platform_id = Yii::$app->request->get('platform_id', 6);
//$coinItems = $request->post('names',[]);
$coin_recommendItems = $this->coinRecommendList($platform_id);
$type = Yii::$app->request->get('type', 1);
$coin_recommendItems = $this->coinRecommendList($platform_id, $type);
$fields =['id', 'sid', 'icon', 'name', 'nickname','chain','platform'];
$rows = Coin::getSelectList(1, 999, $fields,[['in','id',$coin_recommendItems]]);
foreach ($rows['data'] as $key => &$value) {
......@@ -107,9 +107,9 @@ class ServiceController extends BaseController
* @return array
* 托管钱包推荐币种
*/
private function coinRecommendList($platform_id)
private function coinRecommendList($platform_id, $type = 1)
{
$recommend_list = CoinRecommend::find()->select('cid')->where(['platform_id' => $platform_id ])->all();
$recommend_list = CoinRecommend::find()->select('cid')->where(['platform_id' => $platform_id ,'type' => $type])->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