feat : chef name
This commit is contained in:
@@ -172,7 +172,7 @@ trait PrintTrait
|
||||
*/
|
||||
protected function closeWholeLine(): void
|
||||
{
|
||||
$siteArr = $this->siteModel->where('delivered_id',$this->siteInfo->delivered_id)->pluck('id');
|
||||
$siteArr = $this->siteModel->where('delivered_id',$this->siteInfo->delivered_id)->pluck('id')->toArray();
|
||||
|
||||
//没有日志数据 跳出
|
||||
$logArr = $this
|
||||
@@ -183,23 +183,20 @@ trait PrintTrait
|
||||
->toArray();
|
||||
if (empty($logArr)) return;
|
||||
|
||||
|
||||
//没有缓存数据 跳出
|
||||
$cacheData = $this->redis->hGetAll($this->stopOrderKey);
|
||||
if (empty($cacheData)) return;
|
||||
$cacheData = array_diff(array_keys($cacheData),[0]); //需要排除默认写的值
|
||||
|
||||
//数量不对等 跳出
|
||||
if (count($logArr) !== count($cacheData)) return;
|
||||
|
||||
//如果相反交集有一个不为空就是不对的 跳出
|
||||
if (!empty(array_diff($logArr,$cacheData)) || !empty(array_diff($cacheData,$logArr))) return;
|
||||
if(count(array_diff($logArr, $cacheData)) !== 0) return;
|
||||
|
||||
//批量写入 hashmap
|
||||
$insertCacheData = [];
|
||||
foreach ($siteArr as $one) {
|
||||
$insertCacheData[$one] = CateringCode::REDIS_FINISH_VALUE;
|
||||
}
|
||||
|
||||
$this->redis->hMset($this->stopOrderKey, $insertCacheData);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user