|
|
@@ -643,9 +643,12 @@ class Tool {
|
|
|
->where(['STATUS' => 1, 'IS_DELETE' => 0, 'INVOICE_NO' => ['$ne' => '']])
|
|
|
->orderBy(['PAY_AT' => SORT_DESC])
|
|
|
->one();
|
|
|
- if ($order) {
|
|
|
+
|
|
|
+ $invoiceNo = $order->INVOICE_NO;
|
|
|
+
|
|
|
+ if ($invoiceNo) {
|
|
|
// 截取后 5 位, 转为数字+1
|
|
|
- $no = sprintf('%05d', intval(substr($order->INVOICE_NO, -5)) + 1);
|
|
|
+ $no = sprintf('%05d', intval(substr($invoiceNo, -5)) + 1);
|
|
|
} else {
|
|
|
$no = '00001';
|
|
|
}
|