thinkphp6模型继承问题
作者:网站建设 | 发布日期:2020-12-30 | 浏览次数:
首先看这部分代码,这部分代码是能够正常返回数据的:
use think\Model;
/**
* @mixin \think\Model
*/
class Menu extends Model
{
public function getMenuList($condition = [],$order='',$json = true)
{
$where = array();
if (!empty($condition['title']))
{
$condition['title'] = trim($condition['title']);
$where[] = ['title','like', '%'.(string)$condition['title'].'%'];
}
if (isset($condition['pid']))
{
$where[] = ['pid','=',intval($condition['pid']) ];
}
if (isset($condition['hide']))
{
$where[] = ['hide','=',$condition['hide']];
}
if (isset($condition['status']))
{
$where[] = ['status','=',$condition['status']];
}
$list = $this->where($where)->order($order)->page($condition['page'],$condition['limit'])->select()->toArray();
return $list;
}
但是,如果我集成了另外一个非Model的公用模型的话,就会返回数据是空的了,如:
namespace app\base\model;
use think\Model;
/**
* @mixin \think\Model
*/
class Menu extends Base
{