2],null,'id,ptStyle,shopName',null,true); if(empty($shopList)){ return false; } foreach($shopList as $shop){ $mainId = $shop->mainId; $shopName = $shop->shopName??''; $sjName = $shop->merchantName??''; $name = $sjName.' '.$shopName; $cacheKey = 'live_order_' . $mainId; $has = Yii::$app->redis->executeCommand('GET', [$cacheKey]); if(empty($has)){ continue; } $connection = Yii::$app->db; $transaction = $connection->beginTransaction(); try { $list = LiveOrderClass::getAllByCondition(['mainId' => $mainId,'switchOrder'=>0], null, '*', null, true); if(empty($list)){ continue; } $arr = []; foreach ($list as $live) { $addTime = $live->addTime; $date = date("Y-m-d", strtotime($addTime)); $arr[$date] = 1; } if (count($arr) > 1) { noticeUtil::push($name." mainId:{$mainId} live order 有记录不是同一天的", '15280215347'); continue; } //转换完了之后要清货位号!!!!!!!!! $transaction->commit(); Yii::$app->redis->executeCommand('DEL', [$cacheKey]); } catch (\Exception $e) { $transaction->rollBack(); $msg = $e->getMessage(); noticeUtil::push($name." mainId:{$mainId} live order 报错了:".$msg, '15280215347'); } } } }