标签:mysql mode dmi encode highlight sharp cep 实例化 mys
$data = $request->except(‘_token‘);
$file = $request->file(‘g_pic‘)->store(‘img‘);
$data[‘g_pic‘] = ‘/‘.$file;
RedisModel::create($data);
return redirect(route(‘admin.goods.index‘));
//实例化Redis $redis = Redis::connection(); //选择redis 区 // $redis->select(1); //接收页面 $page = $request[‘page‘]; if($redis->hexists(‘data‘,‘page$page‘)) { dump("redis 读取"); $angel = $redis->hget(‘data‘,"page$page"); $data = json_decode($angel,true); }else{ dump("mysql 读取"); $data = RedisModel::paginate(config(‘page.pagesize‘))->toArray(); $redis->hset(‘data‘,"page$page",json_encode($data)); } return view(‘admin.goods.index‘,[‘data‘=>$data]);
标签:mysql mode dmi encode highlight sharp cep 实例化 mys
原文地址:https://www.cnblogs.com/itlaowang/p/14058202.html