<?php

/**
 * ////
 */

/**
 * 小区获取积分或成长值方式类
 *
 * @author Administrator
 */
class WayBlock {
    private $blockLevelInfo;
    private $blockLevelHeat;
    private $blockLevelSetting;
    public function __construct() {
        $this->blockLevelInfo = new BlockLevelInfo();
        $this->blockLevelHeat = new BlockLevelHeat();
        $this->blockLevelSetting = new BlockLevelInfoFullSetting();
    }
    
    /**
     * 通过小区id和完善类型 获得对应的积分获取方式的别名
     * @param int $blockid 小区id
     * @param int $type 1,表示完善资料，2表示完善图片
     */
    public function getInfoLevelWayAlias($blockid,$type=1) {
        $bLevel = $this->blockLevelInfo->findByBlockId($blockid);
        if($bLevel) {
            $level = $bLevel['level'];
            return $alias = $this->blockLevelSetting->getCreditWayAlias($level,$type);
        } else {
            return null;
        }
    }
    
    /**
     * 通过小区id和完善类型 活动对应的积分获取方式的别名
     * @param int $blockid 小区id
     * @param int $type 1,表示完善资料，2表示完善图片
     */
    public function getHeatLevelWayAlias($blockid,$type=1) {
        $bLevel = $this->blockLevelInfo->findByBlockId($blockid);
        if($bLevel) {
            $level = $bLevel['level'];
            return $alias = $this->blockLevelSetting->getCreditWayAlias($level,$type);
        } else {
            return null;
        }
    }
    
    public function getBlockExpertWayAlias($blockId) {
        $bLevel = $this->blockLevelHeat->findByBlockId($blockId);
        if($bLevel) {
            $level = $bLevel['level'];
            return "bid".$level."Experts";
            //return $alias = $this->blockLevelSetting->getCreditWayAlias($level,$type);
        } else {
            return null;
        }
    }
}

?>
