From ae189b49d9e06d81a1c03e599fdf05340cd96deb Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Thu, 14 Aug 2025 15:56:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/model/CrmCustomer.php | 2 +- app/crm/model/Customer.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/common/model/CrmCustomer.php b/app/common/model/CrmCustomer.php index f050186..bc439db 100644 --- a/app/common/model/CrmCustomer.php +++ b/app/common/model/CrmCustomer.php @@ -61,7 +61,7 @@ class CrmCustomer extends Model public static function generateCustomerCode($customer) { // 生成唯一16位code,CM+14位 - $unique = strtoupper(substr(md5($customer->id . microtime(true) . mt_rand(1000, 9999)), 8, 14)); + $unique = strtoupper(substr(md5($customer->id . microtime(true) . mt_rand(1000, 9999)), 8, 6)); $code = 'CM' . date('Ymd') .$unique; return $code; } diff --git a/app/crm/model/Customer.php b/app/crm/model/Customer.php index ff0287d..326eb72 100644 --- a/app/crm/model/Customer.php +++ b/app/crm/model/Customer.php @@ -94,7 +94,7 @@ class Customer extends Model public static function generateCustomerCode($customer) { // 生成唯一16位code,CM+14位 - $unique = strtoupper(substr(md5($customer->id . microtime(true) . mt_rand(1000, 9999)), 8, 14)); + $unique = strtoupper(substr(md5($customer->id . microtime(true) . mt_rand(1000, 9999)), 8, 6)); $code = 'CM' . date('Ymd') .$unique; return $code; }