MerchantServices.php 482 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace Modules\ManageApi\Services;
  3. use App\Constants\RedisKeyConstant;
  4. use App\Models\MerchantModel;
  5. use Illuminate\Support\Facades\Cache;
  6. class MerchantServices
  7. {
  8. /**
  9. * 清理商户缓存
  10. *
  11. * @return void
  12. */
  13. public function clearCache()
  14. {
  15. $data = MerchantModel::query()->where('status', 1)->get(['uid']);
  16. foreach ($data as $val) {
  17. Cache::forget(RedisKeyConstant::PAYMENT_TYPE . $val['uid']);
  18. }
  19. }
  20. }