Files
cycle_api/app/Cache/Base/StructBaseCache.php
2024-02-26 00:41:25 +08:00

22 lines
524 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace App\Cache\Base;
use Illuminate\Support\Facades\Cache;
//用户缓存用户基础信息结构自己组装uid为主键
abstract class StructBaseCache extends BaseCache
{
public string $primary_key_column = 'uid'; //值标识
public array $aCacheKey = [];
function loadData(): array|null
{
$aData = [];
foreach ($this->aCacheKey as $key => $value) {
if (method_exists($this, $value)) $aData[$key] = $this->$value();
}
return $aData;
}
}