Laravel雄辩的错误(SQLSTATE [22P02]:无效的文本表示形式:7错误:整数的无效输入语法)

时间:2018-08-16 04:59:24

标签: laravel eloquent

我尝试通过使用以下查询加入3个表来检索数据,但是它返回上述错误(标题中)。我找不到问题所在。预先谢谢你。

$data = DB::connection('pgsql_backoffice')
            ->table('tusers')
            ->join('tservices','tusers.user_id','=','tservices.user_id')
            ->join('tnotify_send_info','tnotify_send_info.user_id','=','tnotify_send_info.user_id')
            ->select('tusers.user_id','tservices.account_no','tusers.cust_type','tusers.first_name','tusers.last_name','tusers.company_name','tservices.created_t','tservices.start_t','tnotify_send_info.notify_actual_date')
            ->where('tservices.plan_id','tnotify_send_info.package_id')
            ->get();

错误表明'tnotify_send_info.package_id'出了些问题

1 个答案:

答案 0 :(得分:0)

使用whereColumn()比较列:

->whereColumn('tservices.plan_id', 'tnotify_send_info.package_id')