thinkphp 加cache锁

admin8个月前Thinkphp120
$lockKey = 'user_lock_requirement' . $this->user_id;
$isLocked = Cache::get($lockKey); if ($isLocked) {
    $this->error('请勿重复点击');
}
$expire = 3;
$setLockSuccess = Cache::set($lockKey, 1, $expire);
Cache::rm($lockKey);

相关文章

支付宝生成支付二维码

public function alipay($pay_order_no = '20241114123331000000195475', $uid = 1, $url = '') {...

关注公众号登录

/* * 服务端生成带唯一标识二维码并将唯一标识返回给前端 */ public function wx_code() { $scene_str...

查找重复的数据

$data = Db::name('about_product_list')->field('id,title,count(id) as num')->gr...

文章中图片路径替换

if ($list['post_content']) { $list['post_content'] = html_entity_decode($list['post_content']);...

微信卡卷html 领取的签名

/* * 创建签名 */public function sign(){    $cardId = 'p7YU46qidv5_baigH0Ds4ObP7MDg'; &...

微信公众号h5登录

public function getCode(){    $order_id = '95896766';    $config = confi...