发布推送

This commit is contained in:
ROmani
2024-02-26 00:41:25 +08:00
parent 70304f730b
commit 1a9008b318
33 changed files with 1515 additions and 216 deletions

View File

@ -0,0 +1,38 @@
<?php
namespace App\Cache\Struct;
use App\Cache\Base\StructBaseCache;
use App\Models\Customer\CustomerUserExtendModel;
//用户缓存用户基础信息结构自己组装不完全等于数据表primary_key为主键
class StructUserCommonCacheUid extends StructBaseCache
{
public string $primary_prefix = 'StructUserCommonCacheUid:'; //后面跟primary_key
//缓存元素
const USER_UID = 'uid';
const USER_IS_ACTIVE = 'user_is_active'; //是否活跃用户
//生成函数,自动调用生成函数
public array $aCacheKey = [
self::USER_UID => 'genUserUid',
self::USER_IS_ACTIVE => 'genUserIsActive',
];
function genUserUid(): string
{
return $this->primary_key;
}
function genUserIsActive(): string
{
$oCustomerUserExtendModel = new CustomerUserExtendModel();
$oCustomerUserExtend = $oCustomerUserExtendModel->findItem($this->primary_key);
if(!$oCustomerUserExtend) return '';
return $oCustomerUserExtend->is_active;
}
}