Home  >  Q&A  >  body text

How to use ifNUll in tp5 framework

I am using leftJoin to query two tables, but the value found in a field (pname) is null. So how do I use ifNUll to set default values ​​for these null fields in tp5? Please let me know.

image.png

有什么是忘不了的。有什么是忘不了的。1773 days ago1540

reply all(2)I'll reply

  • 像风一样自由

    像风一样自由2020-01-06 21:15:54

    Either modify Mysql, or use foreach to judge with PHP

    reply
    0
  • 有什么是忘不了的。

    I've thought about this as well, but I think it's too troublesome so I don't want to do it. Just think of a function and do it. But I found a solution to replace it, which is to use tp's getter.

    有什么是忘不了的。 · 2020-01-07 19:28:03
  • Cancelreply