|
@@ -616,3 +616,17 @@ if (!function_exists('getMillisecond')) {
|
|
|
return (float)sprintf('%.0f', (floatval($t1) + floatval($t2)) * 1000);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+//创建订单号
|
|
|
+function createUniqueNo($prifix = 'P',$id = 0)
|
|
|
+{
|
|
|
+ $s = 0;
|
|
|
+ $ms = 0;
|
|
|
+ list($ms, $s) = explode(' ', microtime());
|
|
|
+
|
|
|
+ $ms = substr($ms, 2, 6); //获取微妙
|
|
|
+
|
|
|
+ $rt = $prifix.date('YmdHis', $s).$ms.rand(10, 99).$id; //年月日时分秒.用户id对10取余.微秒
|
|
|
+
|
|
|
+ return $rt;
|
|
|
+}
|