获取子栏目数量时,出现以下报错:
未定义数组索引: data
<?php if(is_array($categorys['data']) || $categorys['data'] instanceof hinkCollection || $categorys['data'] instanceof hinkPaginator): $i = 0; $__LIST__ = $categorys['data'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
代码如下:
public function getChildCountInPids($condition) {
$where[] = [“pid”, “in”, $condition[‘pid’]];
$where[] = [“status”, “<>”, config(“apistatus.mysql.usertatus_delete”)];
$res = this−>where(this->where(this−>where(where)
->field([“pid”, “count(*) as count”])
->group(“pid”)
->select();
echo $this->getLastSql();exit;
return $res;
}
getChildCountInPids代码没有输出SQL