I have this QueryService function:
public static function findAllOrderStatus(): Collection
{
$orders = TableRegistry::get('b2c_orders');
$query = $orders->find();
return $query->select([
'shop_code' => 'm.mall_code',
'order_id' => 'b2c_order_number',
'ship_status' => 'status',
])
->join([
'table' => 'malls',
'alias' => 'm',
'type' => 'INNER',
'conditions' => 'b2c_orders.mall_uuid = m.mall_uuid',
])
->where([
'm.mall_code' => MALL_ALPEN_OWN
])
->all();
}
I am getting an error of
Exception: Return value of findAllOrderStatus() must be an instance of Cake\Collection\Collection, instance of Cake\ORM\ResultSet returned
How can I make the $query->select to be a Collection?