thinkphp5 自动写入数据库 datetime
发表于|更新于|php
1 | protected $autoWriteTimestamp = 'datetime'; |
文章作者: developer
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Dev!
相关推荐
2017-08-28
thinkphp5 tp5 子查询 join
123456$GLOBALS["queryid"] = $id;$res = Db::name("cfamily_post")->where("delete_time", 0)->where('id', 'in', function ($query){ $query->name("cfamily_category_post")->where('category_id', $GLOBALS["queryid"])->field('post_id');})->page($page, $listRows)->select(); 123456789$join = [ ["cfamily_category_post relation","post.id = relation.post_id"],];...
2018-01-24
thinkphp5 模型初始化 注意要点
参考文献https://www.kancloud.cn/manual/thinkphp5/177529 TP中模型初始化 使用initialize方法否则会导致无法正常使用模型的对象特性 例如读取后数据为空空数组
2017-08-29
thinkphp5 多对多关联模型
可能是为了卖文档tp5的文档过于简单我想很多人可能确实应该转去laravel了 经过实践可知tp5模型有如下特性 实例化内部可以用方法访问关联,使用前应该有读取一行的操作,以便让主键有值,自动写入中间表 1$this->categories()->save($category); 外部需要用属性的方式去读取,不支持select,只能是find或者取出select后的一条数据 1$posts[0]->categories->column('id');
2017-12-04
thinkphp5 tp5 开启url 兼容模式 方法
thinkcmf 使用thinkphp5开发 虽然号称支持url兼容模式 1index.php?s=a/b/c 实际上没法打开的 需要做如下修改 入口文件修改12$base_url = '/test/thinkcmf/public/';\think\Url::root($GLOBALS["base_url"] . 'index.php?s='); HomeBaseController AdminBaseController修改1$root = empty($GLOBALS["base_url"]) ? cmf_get_root() : $GLOBALS["base_url"]; 登陆控制器修改这时屏蔽验证码 或者修改验证码生成的地方即可
2017-04-02
thinkphp5 phpstudy 显示 No input file specified 解决办法
这是由于运行模式导致的修改入口处的配置 12345678910111213<IfModule mod_rewrite.c> Options +FollowSymlinks -Multiviews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f #apacheHanlder模式 #RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] #fastCGI模式 RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]</IfModule>
2017-01-02
ci laravel lumen slim symfony thinkphp thinkphp5 yii2 phalcon yaf php框架安装后裸跑速度对比
最近比较忙先这样用吧 都是用我的笔记本 Wamp2.5 php5.6 apache2.4.9下跑的环境一致 绝对速度可能没有参考价值,相对速度可以参考,装上换上一样的模板就跑 模板地址 http://www.iguojin.com/ 1<div class="keywords">WE PROVIDE H5 GAMES & WECHAT DEVELOPMENT</div> 跑三遍。。。CI还是很猛的。。我觉得小项目是时候从TP转到CI了 2017-09-06最新测试phalcon可能是小项目首选,原因主要是, 这个框架速度极快, 使用简单,基本上和thinkphp用起来一样方便,没有一些强制性和框架专属的东西,很人性化 他的文档我看了一下只有一个,比较详细,没有藏着掖着的东西,这点算是优于thinkphp和laravel 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354// y...
公告
This is my Blog