李帅

1.打印苹果日志

......@@ -45,8 +45,19 @@ class Order extends Model
*/
static public function get_sn($prefix = '')
{
$Sn = $prefix . strtoupper(dechex(date('m'))) . date('d') . substr(time(), -5) . substr(microtime(), 2, 5) . sprintf('%02d', rand(0, 99));
return $Sn;
$chars = md5(uniqid(mt_rand(), true));
$len = strlen($prefix);
if ($len > 5) $prefix = substr($prefix, 0, 5);
$uuid = $prefix . dechex(date('m')) . date('d') . substr(time(), -5 + $len) . '-'
. substr(microtime(), 2, 4) . '-'
. substr($chars, 12, 4) . '-'
. substr($chars, 16, 4) . '-'
. substr($chars, 20, 12);
return strtoupper($uuid);
}
}
\ No newline at end of file
......