0
点赞
收藏
分享

微信扫一扫

tp6中model的crd

滚过红尘说红尘 2022-05-19 阅读 142


create:

<?php
namespace app\index\controller;

use app\BaseController;
use think\facade\Db;
use app\model\Aaa;
use think\facade\Cache;
class Index extends BaseController
{
public function hello()
{
//设置缓存
Cache::set("bj","您好",3600);
//获取缓存
$res=Cache::get("bj");
//输出缓存
halt($res);
}
}

tp6中model的crd_php

delete:

<?php
namespace app\index\controller;

use app\BaseController;
use think\facade\Db;
use app\model\Aaa;
use think\facade\Cache;
class Index extends BaseController
{
public function hello()
{
//设置缓存
Cache::set("bj","您好",3600);
//删除缓存
Cache::delete('bj');
//获取缓存
$res=Cache::get("bj");
//输出缓存
halt($res);
}
}

tp6中model的crd_缓存_02



举报

相关推荐

0 条评论