<?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']) {
            return array('version'=>$version['android_version'],'url'=>'http://qm.22ca.com/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;
    }
}