'SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: bigint = json

Illuminate\Database\QueryException SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: bigint = json LINE 1: ... inner join "program_plan" on "program_plan"."id" = "order_p... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. (SQL: select count(*) as aggregate from "order_program_plan" inner join "person" on "person"."pid" = "order_program_plan"."pid" inner join "program_plan" on "program_plan"."id" = "order_program_plan"."program_id")

Script Controller :

 $query =  Orderplan::select(
         ["order_program_plan.*","person.pid","program_plan.id"] )
         ->join('person','person.pid','=','order_program_plan.pid')
         ->join('program_plan','program_plan.id','=','order_program_plan.program_id');


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source