Dev
thinkphp5 自动写入数据库 datetime
返回首页
搜索
thinkphp5 自动写入数据库 datetime
发表于
2021-01-15
|
更新于
2026-11-16
|
php
1
2
3
protected $autoWriteTimestamp = 'datetime';
protected $dateFormat = 'Y-m-d H:i:s';
文章作者:
developer
文章链接:
https://blog.iguojin.com/2021/01/15/thinkphp5%20%E8%87%AA%E5%8A%A8%E5%86%99%E5%85%A5%E6%95%B0%E6%8D%AE%E5%BA%93%20datetime/
版权声明:
本博客所有文章除特别声明外,均采用
CC BY-NC-SA 4.0
许可协议。转载请注明来源
Dev
!
thinkphp5
自动写入数据库
datetime
上一篇
LibreOffice 转换文档格式
自动安装1234567891011apt-get install libreoffice -yapt-get install libreoffice-l10n-zh-cn libreoffice-help-zh-cn -ycd /usr/share/fonts && \ wget https://mirrors.tuna.tsinghua.edu.cn/adobe-fonts/source-han-sans/SubsetOTF/SourceHanSansCN.zip && \ wget https://mirrors.tuna.tsinghua.edu.cn/adobe-fonts/source-han-serif/SubsetOTF/SourceHanSerifCN.zip && \ unzip SourceHanSansCN.zip && \ unzip SourceHanSerifCN.zip && \ rm -rf SourceHanSerifCN.zip &a...
下一篇
php excel PhpSpreadsheet 处理大量数据 读取
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566use PhpOffice\PhpSpreadsheet\IOFactory;use PhpOffice\PhpSpreadsheet\Spreadsheet;class Xlsx{ public static function load($filePath) { $inputFileType = IOFactory::identify($filePath); $excelReader = IOFactory::createReader($inputFileType); $PHPExcel = $excelReader->load($filePath); return $PHPExcel; } /** * 迭代每一行...
相关推荐
2018-01-24
thinkphp5 模型初始化 注意要点
参考文献https://www.kancloud.cn/manual/thinkphp5/177529 TP中模型初始化 使用initialize方法否则会导致无法正常使用模型的对象特性 例如读取后数据为空空数组
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"],];...
2017-03-20
thinkphp5 cookie删除失败的原因
thinkphp5.0.7cookie操作有点问题默认配置中cookie没有prefix前缀但是cookie(null),这种方法只能删除指定prefix的所以直接这么用没法清除
2017-08-29
thinkphp5 多对多关联模型
可能是为了卖文档tp5的文档过于简单我想很多人可能确实应该转去laravel了 经过实践可知tp5模型有如下特性 实例化内部可以用方法访问关联,使用前应该有读取一行的操作,以便让主键有值,自动写入中间表 1$this->categories()->save($category); 外部需要用属性的方式去读取,不支持select,只能是find或者取出select后的一条数据 1$posts[0]->categories->column('id');
2018-02-01
thinkphp5 缓存 补充使用方法
thinkphp5 文档当中大致有缓存的使用方法,但是比较简略,很多时候难以应对实际工作以下给出缓存的实际用法 使用默认配置时,直接调用cache方法即可 自定义配置12config('cache.path', config('cache_path'));self::$cache = Cache::connect(config('cache')); 应该使用connect方法重新获取缓存实例,并在使用后恢复原来配置
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"]; 登陆控制器修改这时屏蔽验证码 或者修改验证码生成的地方即可
developer
AI相伴的开发者博客
文章
1035
标签
742
分类
36
公告
This is my Blog
最新文章
wslc空间清理
2026-11-16
Cmder 跟随 Windows 明暗主题
2026-10-28
Intel(R) System Usage Report禁用
2026-10-18
压力测试
2026-10-16
税务学习记录
2026-10-13
搜索
数据加载中