<?php

namespace Download\Src;

use Dever;

class Data
{
	public function version()
	{
        $where['source_type'] = 'android';
        $version = Dever::db('main/version')->getOne($where);

        if ($version) {
            if (isset($version['link'])) {
                $version['link'] = str_replace('http://', 'https://', $version['link']);
            }

            if (isset($version['file'])) {
                $version['link'] = str_replace('http://', 'https://', $version['file']);
            }
        } else {
        	$version['link'] = '';
        }

        return $version['link'];
	}

	public function info()
	{
		$data['ios'] = 'https://itunes.apple.com/cn/app/jstyle%E7%B2%BE%E7%BE%8E-%E6%97%B6%E5%B0%9A%E5%A8%B1%E4%B9%90%E8%B5%84%E8%AE%AFapp/id1133390422?mt=8';
		$data['android'] = $this->version();
		$data['myapp'] = 'http://t.cn/ELf3Waq';

		return $data;
	}
}