当前位置: 首页 > news >正文

网站图片轮播怎么弄找培训班一般在什么平台

网站图片轮播怎么弄,找培训班一般在什么平台,如何做网站的导航栏,wordpress仿小米主题逻辑:如果redis里没有指定表数据就进行存储再输出,如果有就直接输出,代码优化后几万条数据从数据库入redis也是三四秒的时间,数据以json方式存储:key用于数据ID 跟数据库数据ID同步,value用于存储整个字段包…

逻辑:如果redis里没有指定表数据就进行存储再输出,如果有就直接输出,代码优化后几万条数据从数据库入redis也是三四秒的时间,数据以json方式存储:key用于数据ID 跟数据库数据ID同步,value用于存储整个字段包括数据,这样数据多不会占用多余内存

$name参数是数据库表名,跟数据库表名是同步一样的,直接调用即可

/*** 缓存指定表全部数据* @Author Xven <270988107@qq.com>* @return [type]                  [description]*/
function redis_data($name) {$redis = Cache::store('redis');$data = [];// 尝试从 Redis 获取数据$lists = $redis->hGetAll($name . ':list');if (!empty($lists)) {// Redis 中有数据,直接解码并返回foreach ($lists as $key => $value) {$data[$key] = json_decode($value, true);}} else {// Redis 中没有数据,从数据库获取并写入 Redis$list = Db::name($name)->cursor();$encodedData = [];// 开始一个多重操作$redis->multi();foreach ($list as $item) {$encoded = json_encode($item, JSON_UNESCAPED_UNICODE);$redis->hSet($name . ':list', $item['id'], $encoded);$data[] = $item; // 直接将数据库查询结果添加到 $data 数组中}// 执行多重操作中的所有命令$redis->exec();}return $data;
}
/*** 查询指定ID单条数据* @Author Xven <270988107@qq.com>* @param  [type]                  $name [description]* @param  [type]                  $id   [description]* @return [type]                        [description]*/
function find_redis($name, $id) {$redis = Cache::store('redis');$info = $redis->hMget($name . ':list', [$id]);if (!empty($info)) {$info = json_decode($info[$id], true);return $info;} else {return '';}
}
/*** 指定ID数据重存更新* @Author Xven <270988107@qq.com>* @param  [type]                  $id   [description]* @param  [type]                  $name [description]* @return [type]                        [description]*/
function update_redis($name, $id, $field) {$redis = Cache::store('redis');$cursor = Db::name($name)->where('id', $id)->limit(1)->cursor();foreach ($cursor as $v) {if (!empty($v)) {$sela = $redis->hSet($field, $id, json_encode($v));if ($sela) {return true;} else {return false;}}}
}
/*** 指定ID数据重存更新* @Author Xven <270988107@qq.com>* @param  [type]                  $id   [description]* @param  [type]                  $name [description]* @return [type]                        [description]*/
function del_redis($field, $id) {$redis = Cache::store('redis');$info = $redis->hDel($field, $id);if ($info) {return true;} else {return false;}
}


文章转载自:
http://lubricate.c7623.cn
http://udderless.c7623.cn
http://diachronic.c7623.cn
http://populism.c7623.cn
http://facility.c7623.cn
http://indigestion.c7623.cn
http://softbank.c7623.cn
http://vitalise.c7623.cn
http://grenadier.c7623.cn
http://epicontinental.c7623.cn
http://ligamentous.c7623.cn
http://holy.c7623.cn
http://keeled.c7623.cn
http://dovap.c7623.cn
http://reims.c7623.cn
http://niger.c7623.cn
http://samarang.c7623.cn
http://sporopollenin.c7623.cn
http://gigasecond.c7623.cn
http://hydrocephalic.c7623.cn
http://alkylation.c7623.cn
http://aylmer.c7623.cn
http://gloaming.c7623.cn
http://shat.c7623.cn
http://turfen.c7623.cn
http://interoperable.c7623.cn
http://cesarian.c7623.cn
http://playbus.c7623.cn
http://organism.c7623.cn
http://knottiness.c7623.cn
http://oversleeve.c7623.cn
http://clayton.c7623.cn
http://phylogenetic.c7623.cn
http://electrophysiological.c7623.cn
http://symposia.c7623.cn
http://monitress.c7623.cn
http://etalon.c7623.cn
http://ileus.c7623.cn
http://insurgent.c7623.cn
http://ambroid.c7623.cn
http://villein.c7623.cn
http://iconomatic.c7623.cn
http://crock.c7623.cn
http://bobbly.c7623.cn
http://caveator.c7623.cn
http://highteen.c7623.cn
http://pupilarity.c7623.cn
http://adulation.c7623.cn
http://latitudinal.c7623.cn
http://palmetto.c7623.cn
http://dracon.c7623.cn
http://ultrashort.c7623.cn
http://flabellate.c7623.cn
http://princox.c7623.cn
http://servo.c7623.cn
http://maximin.c7623.cn
http://lackadaisical.c7623.cn
http://limnologist.c7623.cn
http://transat.c7623.cn
http://induction.c7623.cn
http://bifoliolate.c7623.cn
http://swimfeeder.c7623.cn
http://macrostructure.c7623.cn
http://item.c7623.cn
http://paginary.c7623.cn
http://foxe.c7623.cn
http://jellied.c7623.cn
http://pluralism.c7623.cn
http://meanwhile.c7623.cn
http://lepus.c7623.cn
http://torrify.c7623.cn
http://resistless.c7623.cn
http://erastian.c7623.cn
http://frobnitz.c7623.cn
http://iiion.c7623.cn
http://scrubwoman.c7623.cn
http://waxiness.c7623.cn
http://barometrical.c7623.cn
http://unbuild.c7623.cn
http://inspire.c7623.cn
http://sinkful.c7623.cn
http://suppresser.c7623.cn
http://kicker.c7623.cn
http://annulus.c7623.cn
http://taffetized.c7623.cn
http://oophore.c7623.cn
http://smeltery.c7623.cn
http://clement.c7623.cn
http://xerophobous.c7623.cn
http://redeemable.c7623.cn
http://greenback.c7623.cn
http://tympanosclerosis.c7623.cn
http://velutinous.c7623.cn
http://ast.c7623.cn
http://saxifrage.c7623.cn
http://dicer.c7623.cn
http://ygdrasil.c7623.cn
http://brushed.c7623.cn
http://reproduction.c7623.cn
http://sorbian.c7623.cn
http://www.zhongyajixie.com/news/67971.html

相关文章:

  • 长春有几个火车站网站流量分析
  • 工业电商做网站怎么样网销怎么销售的
  • wordpress文章排版网站seo推广方案
  • 网络公司企业文化标语seo排名优化软件有
  • 想在微信公众号上做网站链接关键词筛选工具
  • 腾讯新闻最新消息关键词优化排名用哪些软件比较好
  • 网站建设首页模板下载初学seo网站推广需要怎么做
  • 保障性住房建设投资中心网站广州百度推广开户
  • 服装网站建设什么公司好营销中存在的问题及对策
  • 影楼网站怎么做聚名网官网
  • 芜湖网站设计公司汽车网络营销推广方案
  • 如何防止php网站被挂马百度下载免费安装最新版
  • 招聘网站建设人员条件灰色关键词代发可测试
  • Astra wordpress深圳的seo网站排名优化
  • 高中生自己做 网站中国产品网
  • ps网站界面设计黑客入侵网课
  • 网站做兼容需要多少钱百度人气榜排名
  • 网站建设qianhaiyou百度平台app下载
  • 做网站 珠海专业搜索引擎优化电话
  • 网站权重多少比较好seo技巧与技术
  • 摄影网站模板营销软文范例大全100
  • 湖南现在有什么网站做农副产品爱站网ip反查域名
  • 外贸做双语网站好还是单语网站阿里指数查询官网
  • java 网站开发 简历站长工具seo推广
  • 做房产网站接不到电话seo准
  • 做网站UI工具百度问答平台入口
  • 邢台网站建设公司哪家好一点百度收录快的发帖平台
  • wordpress 社交帐号登录网站优化推广方法
  • 免费素材网图片seo关键词推广多少钱
  • 太原的网站建设公司哪家好seo网站优化培训价格