Commit 1902b167 authored by 顾文旭's avatar 顾文旭

防止重复计算

parent 6ffb21b8
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
* Date: 2021/9/3 2:23 下午 * Date: 2021/9/3 2:23 下午
*/ */
use Api\PhpUtils\Log\FileLog;
use Api\PhpUtils\Redis\RedisUtil;
use App\Base\Base; use App\Base\Base;
use App\Base\Job; use App\Base\Job;
use Api\PhpServices\Idgen\Idgen; use Api\PhpServices\Idgen\Idgen;
...@@ -52,6 +54,13 @@ class ColonelorderController extends Base ...@@ -52,6 +54,13 @@ class ColonelorderController extends Base
*/ */
public function indexAction() public function indexAction()
{ {
$redis = RedisUtil::getInstance('cache', ['serializer' => 'none']);
$date = $redis->get($this->settlementDate);
if (!empty($date)) {
FileLog::error("ColonelorderController index ", "重复计算奖励!!!");
return;
}
$redis->set($this->settlementDate, 1);
$this->loggerInfo('start'); $this->loggerInfo('start');
if ($userIdList = ColonelDistributorColonel::getColonelUserIds()) { if ($userIdList = ColonelDistributorColonel::getColonelUserIds()) {
$userIdList = array_chunk($userIdList, self::DEFAULT_USER_BATCH_SIZE); $userIdList = array_chunk($userIdList, self::DEFAULT_USER_BATCH_SIZE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment