I m facing this error syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ',' or ')'

This is my code in TablesController…

$curt_date = date(‘Y-m-d’);
$bills = TableRegistry::get(‘bills’);
$bill_product = $bills->find(‘all’,
array(‘conditions’ => array(‘bills.added_date’ => $curt_date)),
‘fields’ => array([
‘product_id’,
‘sum(quantity) as quantity_TOTAL’,
‘sum(productprice) as Total’]),
‘group’ => ‘product_id’);

$bill_product = $bills->find(
    'all',
    array(
        'conditions' => array(
            'bills.added_date' => $curt_date
        ),
        'fields' => array(
            'product_id',
            'sum(quantity) as quantity_TOTAL',
            'sum(productprice) as Total'
        ),
        'group' => 'product_id'
    )
);

Why do not you use an IDE with syntax highlighting?

Thanks rrd,
I have try to your provide code in my code but unfortunately getting error as attachments…

Try this
// Results in SELECT id AS pk, title AS aliased_title, body …
$query = $articles->find();
$query->select([‘pk’ => ‘id’, ‘aliased_title’ => ‘title’, ‘body’]);

Try this

$bill_product = $bills->find(
    'all', 
    array(
        'conditions' => array(
            'bills.added_date' => $curt_date
        ),
        'fields' => array([
            'product_id',
            'sum(quantity) as quantity_TOTAL',
            'sum(productprice) as Total'
        ]),
        'group' => 'product_id'
    )
);