<?php

/**
 * Created by PhpStorm.
 * User: dell
 * Date: 2016/2/29
 * Time: 14:17
 */

class patchControl extends mobileHomeControl
{
    public function __construct()
    {
        parent::__construct();
    }

    public function getpatchOp()
    {
        $version = trim($_GET['version']);
        if (!isset($version) || empty($version)) {
            return joutput_error(errcode::ErrInputParam);
        }

        $condition = array();
        $condition['ver_name'] = $version;
        $condition['enable'] = 1;

        $model = Model('patch');
        $result = $model->getSingleItemByVerName($condition);

        $ret = array();
        if (!empty($result)) {
            $ret['version'] = $version;
            $ret['patch_code'] = $result['patch_code'];
            $ret['patch_url'] = $result['patch_url'];
        } else {
            $ret['version'] = $version;
        }

        self::outsuccess($ret);
    }
}


