【发布时间】:2020-09-02 22:30:57
【问题描述】:
**我在下面的脚本中使用了 whereNot 子句。即显示以下错误。除 cancel 数据外,其余数据将显示。谁能帮帮我。
SQLSTATE[42S22]:找不到列:1054 'where 子句'中的未知列 'not'(SQL:从 client 中选择 count(*) 作为聚合作为 c 左连接 users 作为 u在c.telemarketar = u.id 上左连接disposition 为d 在c.id = @9876543@33@.client = @9876 处**
$datas= DB::table('client as c')
->select(
'c.id as clid',
'u.id as uid',
'd.id as did',
'd.bgcolor as bgcolor',
'd.fcolor as fcolor',
'c.customerName as customerName',
'c.email as email',
'c.streetaddress as streetaddress',
'c.city as city',
'c.landNumber as landNumber',
'u.codenumber',
)
->leftJoin('users as u', 'c.telemarketar', '=', 'u.id')
->leftJoin('disposition as d', 'c.id', '=', 'd.client')
->whereNot('bgcolor','=','CANCEL')
->orderBy('c.id', 'desc')
->paginate(100);
【问题讨论】: