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';//销售出库生成应收,缓存应收单的id
- private $existPayEnterpriseKey = 'existPayEnterprise'; // 存在应付单的企业标识
- public function __construct()
- {
- $this->cache = Factory::cache('finance');
- }
- /**
- * 销售出库生成应收单,应收单自动审核 缓存应收单id和时间
- * @param $enterpriseId
- * @param $id
- * @param $createTime
- * @return array|mixed
- */
- 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);
- }
- }
|