<?phpnamespace app\common\model;u think\model;u think\db; class ur extends model{//开启自动完成时间戳功能 protected $autowritetimestamp = true;}?>
ur::update(['name'='安阳'],['id'=>1]);
thinkphp中upda分歧者 异类觉醒te方法的源代码如下:
/** * 更新数据 * @access public * @param array $data 数据数组 * @param array $where 更新条件 * @param array|true $fielabc的成语d 允许字段 * @return $this */ public static function update($data = [], $where = [], $field = null) { $model = new static(); if (!empty($field)) { $model->allowfield($field); } $result = $model->isupdate(true)->save($data, $where); return $model; }
$ur=new ur;$ur->isupdate(true)->save(['name'='安阳'],['id'=&g乞t;1]);
到此这篇关于thinkphp5.1的model模型自动更新update_time字段实例讲解的文章就介绍到这了,更多相关thnikphp5.1的model模型自动更新update_time字段内容请搜索www.887551.com以前的文章或继续浏览下面的相关文章希望大家以后多多支持www.887551.com!
本文发布于:2023-04-09 02:04:07,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/zuowen/60f28b69d0fd21b015d3d3fdc4511529.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:thinkphp5.1的model模型自动更新update.doc
本文 PDF 下载地址:thinkphp5.1的model模型自动更新update.pdf
留言与评论(共有 0 条评论) |