修改订单逻辑和订单ID生成方式
This commit is contained in:
parent
9c1d2dd62e
commit
a98895c01a
@ -56,7 +56,7 @@ class OrderLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
$order = [
|
$order = [
|
||||||
'time' => time(),
|
'time' => time(),
|
||||||
'number' => static::getNewOrderId('PF'),
|
'number' => getNewOrderId('PF'),
|
||||||
'total' => self::$total,
|
'total' => self::$total,
|
||||||
'pay_type' => $params['pay_type'] ?? 0,
|
'pay_type' => $params['pay_type'] ?? 0,
|
||||||
'cart_id' => implode(',', $cartId),
|
'cart_id' => implode(',', $cartId),
|
||||||
|
@ -324,7 +324,7 @@ if (!function_exists('getNewOrderId')) {
|
|||||||
{
|
{
|
||||||
list($msec, $sec) = explode(' ', microtime());
|
list($msec, $sec) = explode(' ', microtime());
|
||||||
$msectime = number_format((floatval($msec) + floatval($sec)) * 1000, 0, '', '');
|
$msectime = number_format((floatval($msec) + floatval($sec)) * 1000, 0, '', '');
|
||||||
$orderId = $type . $msectime . mt_rand(10000, max(intval($msec * 10000) + 10000, 98369));
|
$orderId = $type . $msectime . mt_rand(100, max(intval($msec * 10) + 100, 983));
|
||||||
return $orderId;
|
return $orderId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user