Find two column in laravel which have equal values via Eloquent?

前端 未结 3 2023
孤城傲影
孤城傲影 2021-02-07 03:09

I am working on a project where I have a table market which has a buyer_id column and a seller_id column. When a seller puts something on the market, the seller_id and buyer_id

3条回答
  •  别那么骄傲
    2021-02-07 03:51

    Option 1: ->whereRaw('column1 = column2')

    Option 2: When on sale buyer_id == null != seller_id, ->where('buyer_id', '=', null)

提交回复
热议问题