<?php
namespace Business\Common;


class SettingServiceModel extends \Business\AbstractModel{

    public function getCurrentVersion($param){
        $type = (int)$param['type'];
        $settingDAO = \DAO\SettingModel::getInstance();
        $type == 0 ? $version = $settingDAO->getListCache(array('android_version','android_apk')) : $version = $settingDAO->getListCache(array('ios_version'));
        if($version['android_version']) {
            $host = 'http://testadmin.shenbd.com';
            return array('version'=>$version['android_version'],'url'=>$host . '/mall/index.php?act=desc&op=upload&file_name='.$version['android_apk']);
        }
        return array('version'=>$version['ios_version']);
    }

    public function getServicePhone(){
        $settingDAO = \DAO\SettingModel::getInstance();
        $phone = $settingDAO->getListCache(array('qm_service_phone'))['qm_service_phone'];
        return array('servicePhone'=>$phone);
    }
    private static $_instance = null;

    /**
     * 单例模式获取类实例
     *
     */
    public static function getInstance() {
        if (!(self::$_instance instanceof self)) {
            self::$_instance = new self();
        }

        return self::$_instance;
    }
}