123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- namespace Jobs\Cache;
- use http\Exception;
- use Mall\Framework\Factory;
- use Mall\Framework\Core\ResultWrapper;
- use Mall\Framework\Core\ErrorCode;
- class FinanceCache
- {
- private $cache;
- protected $salesOutReceiveKey = 'salesOutReceive';
- private $existPayEnterpriseKey = 'existPayEnterprise';
- public function __construct()
- {
- $this->cache = Factory::cache('finance');
- }
-
- public function saveSalesOutReceive($enterpriseId, $id, $createTime)
- {
- $this->cache->zadd($this->salesOutReceiveKey.'::'.$enterpriseId, $createTime, $id);
- }
- public function delSalesOutReceive($enterpriseId, $id)
- {
- $this->cache->zrem($this->salesOutReceiveKey.'::'.$enterpriseId, $id);
- }
-
- public function cacheExistPayEnterprise($enterpriseId)
- {
- return $this->cache->sadd($this->existPayEnterpriseKey, $enterpriseId);
- }
- }
|