no message
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
class ShortLinkLog extends BaseModel
|
||||
{
|
||||
protected $name = 'short_link_log';
|
||||
|
||||
/**
|
||||
* @notes 从UA解析平台
|
||||
*/
|
||||
public static function parsePlatform(string $ua): string
|
||||
{
|
||||
$ua = strtolower($ua);
|
||||
if (str_contains($ua, 'micromessenger'))
|
||||
return 'wechat';
|
||||
if (str_contains($ua, 'alipay'))
|
||||
return 'alipay';
|
||||
if (str_contains($ua, 'iphone') || str_contains($ua, 'ipad'))
|
||||
return 'ios';
|
||||
if (str_contains($ua, 'android'))
|
||||
return 'android';
|
||||
if (str_contains($ua, 'windows'))
|
||||
return 'windows';
|
||||
if (str_contains($ua, 'macintosh'))
|
||||
return 'mac';
|
||||
return 'other';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user