395 篇
建站知识总结与分享
搜索“think”
thinkphp5.1视图查询
web 0 0
2462 0 2019-01-11 ThinkPHP5.1
<?php namespace app\index\model; use think\Model; use think\Db; use think\db\Where; class Articles extends Model { /** * 视图查询 */ public function indexFun(){ //...
thinkphp5.1高级查询
web 0 0
3359 0 2019-01-11 ThinkPHP5.1
<?php namespace app\index\model; use think\Model; use think\Db; use think\db\Where; class Articles extends Model { /** * 高级查询-快捷查询方式是一种多字段相同查询条件的简化写法,可以进一步简化查询条件的写法...
thinkphp5.1时间查询
web 1 0
3155 0 2019-01-11 ThinkPHP5.1
<?php namespace app\index\model; use think\Model; use think\Db; class Articles extends Model { /** * 时间查询 */ public function indexFun(){ // 使用where方法-大于某个时间 ...
thinkphp5.1聚合查询
web 0 0
2294 0 2019-01-10 ThinkPHP5.1
<?php namespace app\index\model; use think\Model; use think\Db; class Articles extends Model { /** * 聚合查询 * 聚合方法如果没有数据,默认都是0,聚合查询都可以配合其它查询条件 */ public funct...
thinkphp5.1链式操作sequence数据库指定自增序列名
web 0 0
2537 0 2019-01-10 ThinkPHP5.1
不太懂怎么使用 <?php namespace app\index\model; use think\Model; use think\Db; class Articles extends Model { /** * 链式操作-sequence方法用于pgsql数据库指定自增序列名,其它数据库不必使用 */ p...
thinkphp5.1链式操作failException抛出异常
web 0 0
2614 0 2019-01-10 ThinkPHP5.1
<?php namespace app\index\model; use think\Model; use think\Db; class Articles extends Model { /** * 链式操作-failException设置查询数据为空时是否需要抛出异常,如果不传入任何参数,默认为开启,用于select和f...
thinkphp5.1链式操作partition数据库水平分表
web 1 2
5003 0 2019-01-10 ThinkPHP5.1
具体怎么用不太懂 <?php namespace app\index\model; use think\Model; use think\Db; class Articles extends Model { /** * 链式操作-partition 方法用于是数据库水平分表 */ public function...
thinkphp5.1链式操作force
web 0 0
2568 0 2019-01-10 ThinkPHP5.1
<?php namespace app\index\model; use think\Model; use think\Db; class Articles extends Model { /** * 链式操作-force 方法用于数据集的强制索引操作 * 对查询强制使用user索引,user必须是数据表实际创建的索引名...
thinkphp5.1链式操作fetchSql
web 0 0
2429 0 2019-01-10 ThinkPHP5.1
<?php namespace app\index\model; use think\Model; use think\Db; class Articles extends Model { /** * 链式操作-fetchSql用于直接返回SQL而不是执行查询,适用于任何的CURD操作方法 */ public func...
thinkphp5.1链式操作comment注释
web 0 0
2460 0 2019-01-10 ThinkPHP5.1
<?php namespace app\index\model; use think\Model; use think\Db; class Articles extends Model { /** * 链式操作-COMMENT方法 用于在生成的SQL语句中添加注释内容 */ public function commen...
thinkphp5.1链式操作cache缓存
web 0 0
2545 0 2019-01-10 ThinkPHP5.1
<?php namespace app\index\model; use think\Model; use think\Db; class Articles extends Model { /** * 链式操作-cache方法用于查询缓存操作,也是连贯操作方法之一。 * cache可以用于select、find、valu...
关于thinkphp连贯操作加锁的详细介绍lock
web 0 0
2900 0 2019-01-10 ThinkPHP
官网上面的加锁介绍不是很详细,我给详细说一下 首先,数据库类型要是InnoDB,其次,加锁必须跟事务同时使用,还有,查询的时候都必须带锁,比如: $user_mod->lock(true)->where('id=1')->select();这个地方用锁查询,其次地方如果查询这个user对象需要防止同时操作的话也...
thinkphp5.1链式操作lock
web 0 0
3171 0 2019-01-10 ThinkPHP5.1
<?php namespace app\index\model; use think\Model; use think\Db; class Articles extends Model { /** * 链式操作-Lock方法是用于数据库的锁机制,如果在查询或者执行操作的时候使用: * 就会自动在生成的SQL语句最后加上 F...
thinkphp5.1链式操作distinct去重,去除重复
web 0 0
2770 0 2019-01-10 ThinkPHP5.1
<?php namespace app\index\model; use think\Model; use think\Db; class Articles extends Model { /** * 链式操作-DISTINCT 方法用于返回唯一不同的值 。 * distinct方法的参数是一个布尔值。 */ pub...
thinkphp5.1链式操作union
web 0 3
3603 0 2019-01-10 ThinkPHP5.1
<?php namespace app\index\model; use think\Model; use think\Db; class Articles extends Model { /** * 链式操作-UNION操作用于合并两个或多个 SELECT 语句的结果集。 * UNION 内部的 SELECT 语句必须拥...
thinkphp5.1链式操作join
web 0 0
2741 0 2019-01-10 ThinkPHP5.1
<?php namespace app\index\model; use think\Model; use think\Db; class Articles extends Model { /** * 链式操作-JOIN方法用于根据两个或多个表中的列之间的关系,从这些表中查询数据。join通常有下面几种类型,不同类型的join...
关于本站

“最难不过坚持”

本人承接扒站仿站,php网站维护,病毒查杀,网站编辑,网站改版,html制作

有需要网站维护,改版,病毒查杀,网站编辑,网站备案,html制作等相关的工作可以联系我。
本人有多年相关工作经验,也可提供免费咨询,交个朋友。
有需要探讨问题的朋友,也可以加我微信,共同探讨!
微信:15011482830 QQ:408917339

8037018 2685 39
最新评论
https://jueru.net/
评 留言
:weixiao:
评 留言
:shuijiao: :weiqu: :zhenbang: :leng:
评 留言
:yiwen: :yiwen: :yiwen: :yiwen:
评 EasySass: could not generate CSS file. See Output panel for details.
这个业务逻辑多少都有点奇怪了,阅读浏览次数增值在新闻详情页的控制器方法里setInc,这怎么还写进模型事件里了。如果非要用onAfterRead也可以,把新闻文章的内容单独分出来一个news_content表,然后把它和news做关联,然后给news_content表的onAfterRead事件做增值处理,这样点进新闻页内查询到文章内容时才会触发它。
评 TP6模型事件-查询后onAfterRead不好用
文章标签更多
ThinkPHP (260)
Mysql (59)
DedeCms (33)
jQuery (74)
证件照 (1)
setInc (4)
setDec (4)
onclick (5)