master
elf 3 years ago
parent 745a72e19f
commit fb2fa72e82

@ -196,14 +196,14 @@ class XlqyClient
return $this->getCommonResult($result, 200); return $this->getCommonResult($result, 200);
} }
private function generateOrderNumber($order, $index = 0) protected function generateOrderNumber($order, $index = 0)
{ {
$length = 8 - strlen(strval($order['id'])); $length = 8 - strlen(strval($order['id']));
$indexLength = 3 - strlen(strval($index)); $indexLength = 3 - strlen(strval($index));
return date('Ymd') . str_repeat('0', $length) . $order['id'] . str_repeat('0', $indexLength) . $index; return date('Ymd') . str_repeat('0', $length) . $order['id'] . str_repeat('0', $indexLength) . $index;
} }
private function getCommonResult($result, $successCode = 0) protected function getCommonResult($result, $successCode = 0)
{ {
if ($result['code'] == $successCode) { if ($result['code'] == $successCode) {
return [ return [

Loading…
Cancel
Save