public function getAreaList($pid = -1) {
$map = array();
$pid != -1 && $map['pid'] = $pid;
return $this->where($map)->order('`area_id` ASC')->findAll();
}
$pid != -1 && $map['pid'] = $pid;
return $this->where($map)->order('`area_id` ASC')->findAll();
这两句没条件关系吧?上面的一句为什么要用&&连接呢?与直接写
$pid != -1;
$map['pid'] = $pid;
的区别是什么呢?