You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
What´s wrong with this code below?
`$builder = $this
->modelsManager
->createBuilder()
->columns("Smartman\Models\ServiceOrders.service_order_number,
Smartman\Models\ServiceOrders.created_at,
Smartman\Models\Clients.tradename,
Smartman\Models\Models.name,
Smartman\Models\Equipments.serial_number,
Smartman\Models\ServiceOrders.status")
->from(ServiceOrders::class)
->leftJoin(Equipments::class, 'Smartman\Models\ServiceOrders.equipment_id = Smartman\Models\Equipments.id')
->leftJoin(Models::class, 'Smartman\Models\Equipments.model_id = Smartman\Models\Models.id')
->leftJoin(Clients::class, 'Smartman\Models\Equipments.client_id = Smartman\Models\Clients.id')
->where('Smartman\Models\Clients.account_id = :accountid:', ['accountid' => $this->auth->getAccountId()])
->andwhere('Smartman\Models\ServiceOrders.service_order_number LIKE :number:', ['number' => '%' . $search . '%'])
->orwhere('Smartman\Models\Clients.name LIKE :name:', ['name' => '%' . $search . '%'])
->orwhere('Smartman\Models\Clients.tradename LIKE :tradename:', ['tradename' => '%' . $search . '%'])
->having('Smartman\Models\ServiceOrders.status LIKE :status:', ['status' => '%' . $status . '%'])
->orderBy('Smartman\Models\'. $orderby . ' ' . $order);
I keep getting this message:
'When having is set there should be columns option provided for which calculate row count'
Beta Was this translation helpful? Give feedback.
All reactions