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