用户信息 返回当前iOS的版本号

This commit is contained in:
2025-10-30 16:49:49 +08:00
parent 0eb4f975b9
commit fae8a63a92

View File

@@ -8,6 +8,7 @@ use app\common\library\Ems;
use app\common\library\Sms;
use fast\Random;
use think\Config;
use think\Db;
use think\Validate;
/**
@@ -222,7 +223,18 @@ class User extends BaseCom
public function get_user_info()
{
$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);
}
//关注(回关)