Found partial solution:
PanelDataQuery::create()
->withColumn('p1.local_id','localId')
->withColumn('count(1)', 'amount')
->select(array( 'localId','amount'))
[...]
Seems to work fine. Altought I'd appreciate any other solutions. Still would be great how to deal with similar problem in addJoinCondition.
When i replace:
->filterByType('model')->filterByLocalId($model)
From the original query, with:
->addJoinCondition('p2', 'p2.localId = ?', $model)
->addJoinCondition('p2', "p2.type = 'model'");
I got similar issue as stated in error: propel translates p2.localId to panel_code.local_id which isn't correct (multiple panel_code table joins with aliases are included in query).