用户信息 返回当前iOS的版本号
This commit is contained in:
@@ -8,6 +8,7 @@ use app\common\library\Ems;
|
|||||||
use app\common\library\Sms;
|
use app\common\library\Sms;
|
||||||
use fast\Random;
|
use fast\Random;
|
||||||
use think\Config;
|
use think\Config;
|
||||||
|
use think\Db;
|
||||||
use think\Validate;
|
use think\Validate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -222,7 +223,18 @@ class User extends BaseCom
|
|||||||
public function get_user_info()
|
public function get_user_info()
|
||||||
{
|
{
|
||||||
$reslut = model('user')->get_me($this->uid);
|
$reslut = model('user')->get_me($this->uid);
|
||||||
return V($reslut['code'], $reslut['msg'], $reslut['data']);
|
//版本号
|
||||||
|
$app_version = request()->header('App-Version');
|
||||||
|
$system = request()->header('system');
|
||||||
|
$api_version = 0;
|
||||||
|
if ($system == 'iOS') {
|
||||||
|
$api_versions = db::name('version')->where(['type' => 2, 'status' => 1])->order('id', 'desc')->find();
|
||||||
|
$result = version_compare($api_versions['oldversion'],$app_version);
|
||||||
|
if ($result < 0) {
|
||||||
|
$api_version = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return V($reslut['code'], $reslut['msg'], $reslut['data'],$api_version);
|
||||||
}
|
}
|
||||||
|
|
||||||
//关注(回关)
|
//关注(回关)
|
||||||
|
|||||||
Reference in New Issue
Block a user