环境:
Laravel 5.7.28
数据库 mysql
CentOS 7.2
我有 3 个表,如下所示,我需要加入这 3 个表并合并列 ( customer.first_name,customer.last_name,customer.address,job.name,job.address,job.date) 来设置“喜欢”查询。
例如,在 coulms 合并customer.first_name,customer.last_name,customer.address,job.name,job.address,job.date customer.first_name + customer.last_name + customer.address + job.name + job.address +job.date 之后是 'TOMSMITHCecilia ChapmanABC.LtdIris Watson2019-01-10',所以
when $text = 'MS';
set 'like' '%'.$text.'%' will return below result
customer.first_name = TOM
customer.last_name = SMITH
customer.address = Cecilia Chapman
job.name = ABC.Ltd
job.address = Iris Watson
job.date = 2019-01-10
id 表(关系属于表客户和工作)
ID
顾客ID
作业编号
客户表
ID
名
姓
地址
工作编号
ID
姓名
地址
工作日期
森林海
潇潇雨雨