31 lines
592 B
PHP
31 lines
592 B
PHP
<?php
|
|
namespace App\Domains\Real\Services;
|
|
|
|
class CommonService
|
|
{
|
|
|
|
|
|
/**
|
|
* 将字符串转换为数字
|
|
*
|
|
* @param string $companyId
|
|
* @return int
|
|
*/
|
|
public static function parseCompanyId($companyId)
|
|
{
|
|
return intval(str_replace('No', '', $companyId));
|
|
}
|
|
|
|
/**
|
|
* 将数字转换为字符串
|
|
*
|
|
* @param string $companyId
|
|
* @return int
|
|
*/
|
|
public static function stringifyCompanyId($companyId)
|
|
{
|
|
return sprintf('No%011d', $companyId);
|
|
return intval(str_replace('No', '', $companyId));
|
|
}
|
|
}
|