0
テーブル内の特定のデータの数を表示する$ scope.countがあります。 $のscope.countの角度 - キー値の値を印刷する方法
<label class="btn btn-yellow force-btn">Model = {{ count }} </label>
結果は次のとおりです:私はは$ scope.countで、それは結果だセーブ
$result = $this->_em->createQueryBuilder()
->select('count(u.teamId)')
->from('mypath\Entities\Teams', 'u')
->where('u.teamType =:teamType')
->setParameters(['teamType' => 4 ])
->getQuery()
->getScalarResult();
return $result;
:
ものの[{"1":"2"}]
、私がしたい私はこれを作りましたちょうどを示してください。なにか提案を?
を試してみてください。それは働いている。カウント[0] ["1"]はどのように機能しますか? – AFN
count [0]は{"1"、 "2"}、["1"]はそのオブジェクトのキーです。 –
だから "2"の代わりに "1"を取り出す方法は? – AFN