thinkphp6模型繼承問題
作者:網(wǎng)站建設(shè) | 發(fā)布日期:2020-12-30
首先看這部分代碼,這部分代碼是能夠正常返回?cái)?shù)據(jù)的:
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;
}
但是,如果我集成了另外一個(gè)非Model的公用模型的話,就會(huì)返回?cái)?shù)據(jù)是空的了,如:
namespace app\base\model;
use think\Model;
/**
* @mixin \think\Model
*/
class Menu extends Base
{