Showing
1 changed file
with
21 additions
and
0 deletions
| @@ -17,6 +17,27 @@ class Api{ | @@ -17,6 +17,27 @@ class Api{ | ||
| 17 | } | 17 | } |
| 18 | //获取最新版本 | 18 | //获取最新版本 |
| 19 | public function compareVersion() { | 19 | public function compareVersion() { |
| 20 | + //2020-05-25 获取flutter版最新版本号 | ||
| 21 | + if(input('get.flag') == 4 && input('get.make')){ | ||
| 22 | + //获取IOS 或者 安卓目前最新版本 | ||
| 23 | + $version = db('android')->where(array('flag'=>input('get.flag'),'make'=>input('get.make')))->order('version desc')->limit(1)->select(); | ||
| 24 | + if(input('get.versionCode') < $version[0]['version']){ | ||
| 25 | + $str = "http://xt03.colorcun.com".$version[0]['file_url']; | ||
| 26 | + $version[0]['file_url'] = input('get.make') == 4 ? "" : $str; | ||
| 27 | + $result['ret'] = 200; | ||
| 28 | + $result['data'] = $version; | ||
| 29 | + $result['msg'] = 'success'; | ||
| 30 | + | ||
| 31 | + return json_encode($result); | ||
| 32 | + }else{ | ||
| 33 | + | ||
| 34 | + $result['ret'] = 0; | ||
| 35 | + $result['data'] = ''; | ||
| 36 | + $result['msg'] = '当前已是最新版本'; | ||
| 37 | + | ||
| 38 | + return json_encode($result); | ||
| 39 | + } | ||
| 40 | + } | ||
| 20 | //2019-05-24 主动更新需要判断当前设备是否为灰度用户 | 41 | //2019-05-24 主动更新需要判断当前设备是否为灰度用户 |
| 21 | //识别是否为灰度用户 | 42 | //识别是否为灰度用户 |
| 22 | $limit = '&sid='.input('get.sid').'&device='.input('get.deviceId').'&version='.input('get.versionCode'); | 43 | $limit = '&sid='.input('get.sid').'&device='.input('get.deviceId').'&version='.input('get.versionCode'); |
-
Please register or login to post a comment