12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- /**
- * 更新
- */
- defined('InShopNC') or exit('Access Invalid!');
- class app_updateControl extends mobileHomeControl
- {
- public function __construct()
- {
- parent::__construct();
- }
- public function check_verOp()
- {
- return $this->checkVersionOp();
- }
- public function checkVersionOp()
- {
- $ver_code = $_GET['ver_code'];
- if($this->android() == false || !isset($ver_code) || empty($ver_code) || intval($ver_code) <= 0) {
- return self::outerr(errcode::ErrParamter,"需要带入手机及版本信息");
- }
- $verinfo = rkcache('android_version',true);
- $result = array();
- if ($ver_code == $verinfo['ver_code']) {
- $result['latest'] = 0; //设计协议设计反了,0 表示目前是最新版本,1 表示不是最新版本
- }
- else
- {
- $result['latest'] = 1;
- $lowest_compatible_version = intval($verinfo['lowest_compatible_version']);
- if ($lowest_compatible_version > intval($ver_code)) {
- $result['force_update'] = 1;
- } else {
- $result['force_update'] = 0;
- }
- $update_info = array();
- $update_info['ver_code'] = $verinfo['ver_code'];
- $update_info['app_path'] = $verinfo['app_path'];
- $update_info['release_note'] = $verinfo['release_note'];
- $update_info['remind_time'] = $verinfo['remind_time'];
- $update_info['md5_file'] = $verinfo['md5_file'];
- $update_info['app_path'] = BASE_SITE_URL . $verinfo['app_path'];
- $result['update_info'] = $update_info;
- }
- self::outsuccess($result);
- }
- }
|