From 54421391fb2709c0265e4dfa167a1f376bce71dd Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 3 Aug 2023 17:52:39 +0800 Subject: [PATCH] 1 --- webapp/controller/BaseController.class.php | 6 ++++++ webapp/controller/DailySelectionController.class.php | 3 ++- webapp/models/OrderId.php | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/webapp/controller/BaseController.class.php b/webapp/controller/BaseController.class.php index 367732de..0218f73f 100644 --- a/webapp/controller/BaseController.class.php +++ b/webapp/controller/BaseController.class.php @@ -30,6 +30,12 @@ class BaseController { return $this->nowtime; } + public function _getTodayLeadStr() + { + $leadStr = strftime('%y%m%d', $this->_getNowTime()); + return $leadStr; + } + public function _getNowDaySeconds() { return $this->_getDaySeconds($this->nowtime); diff --git a/webapp/controller/DailySelectionController.class.php b/webapp/controller/DailySelectionController.class.php index 17f8e8e0..1739a783 100644 --- a/webapp/controller/DailySelectionController.class.php +++ b/webapp/controller/DailySelectionController.class.php @@ -281,7 +281,8 @@ class DailySelectionController extends BaseAuthedController { private function getRedisKey() { - $key = DAILY_SELECTION_KEY . myself()->_getAccountId(); + $key = DAILY_SELECTION_KEY . + myself()->_getTodayLeadStr() . ':' . myself()->_getAccountId(); return $key; } diff --git a/webapp/models/OrderId.php b/webapp/models/OrderId.php index 1a7b5606..de5f8503 100644 --- a/webapp/models/OrderId.php +++ b/webapp/models/OrderId.php @@ -21,7 +21,7 @@ class OrderId { ) ); $lastIdx = SqlHelper::getLastInsertId(myself()->_getSelfMysql()); - $orderId = strftime('%Y%m%d%H%M%S', myself()->_getNowTime()) . phpcommon\pad($lastIdx % 100000, 5); + $orderId = strftime('%y%m%d%H%M%S', myself()->_getNowTime()) . phpcommon\pad($lastIdx % 100000, 5); return $orderId; }