模型查询取别名报Call to a member function alias() on null

浏览:1826 发布日期:2017/12/18 分类:求助交流 关键字: alias where null mysql 别名 查询 模型
代码如下:
SmsTemplateModel::get()->alias('s')->where($where)->count('s.id');
报错如下:
Call to a member function alias() on null

把alias去掉又报错,如下:
Call to a member function where() on null

$where在开头申明成了一个空数组,在这里也确实是空数组。
最佳答案
评论( 相关
后面还有条评论,点击查看>>