12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- // +----------------------------------------------------------------------
- // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
- // +----------------------------------------------------------------------
- // | 版权所有 2017~2021 LARAVEL研发中心
- // +----------------------------------------------------------------------
- // | 官方网站: http://www.laravel.cn
- // +----------------------------------------------------------------------
- // | Author: laravel开发员 <laravel.qq.com>
- // +----------------------------------------------------------------------
- namespace App\Models;
- use App\Services\RedisService;
- /**
- * 余额充值提现订单管理-模型
- * @author laravel开发员
- * @since 2020/11/11
- * Class BalanceLogModel
- * @package App\Models
- */
- class BalanceLogModel extends BaseModel
- {
- // 设置数据表
- protected $table = 'balance_logs';
- /**
- * 验证记录是否已经存在
- * @param $hash
- * @return array|bool
- */
- public static function checkExists($hash)
- {
- $cacheKey = "caches:wallet:balanceLog:{$hash}";
- $check = RedisService::get($cacheKey);
- if(RedisService::exists($cacheKey)){
- return $check;
- }
- $info = BalanceLogModel::where(['hash'=> $hash,'mark'=>1])->first();
- $info = $info? $info->toArray() : [];
- if($info){
- RedisService::set($cacheKey, $info, rand(600,1200));
- }
- return $info;
- }
- }
|