2021-07-27 tp5错误记录

Call to a member function assign() on null

在null上调用成员函数赋值()

子类的构造函数覆盖了父类的,所以报错了。

  1. 将__construct()改为_initialize()
  2. public function __construct(){
        parent::__construct();
    }
    
  3. public function __construct(){
        parent::__initialize();
    }
    

 A non well formed numeric value encountered 

遇到格式不正确的数值

我的场景为:在数据库中存入获取到数值,原始数值的类型为localdatetime,在使用tp5渲染模板时遇到此问题。

解决方法:修改database中的字段

更新:auto_timestamp不能更改,只需要更改detetime_format的值即可。更改auto_timestamp字段可能会造成在进行软删除时出现时间戳不能写入的情况。

Integrity constraint violation: 1052 Column 'id' in order clause is ambiguou

错误场景:

 问题在where条件中的id,意思是系统找不到这个id是哪个表的,需要在前面加上表名。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值