如果此查询直接在我的数据库中执行:
select * from `account_transactions`
where `AT_createuser` = 4 group by `AT_transactionficheno`
但这会返回en错误:
Transactions::with('type')->where('AT_createuser', JWTAuth::user()->id)
->groupBy('AT_transactionficheno')->get();
错误是:
SQLSTATE [42000]:语法错误或访问冲突:1055 'fee.account_transactions.AT_id'不在GROUP BY中(SQL:select * from
account_transactions
,其中AT_createuser
= 4 group byAT_transactionficheno
)
答案 0 :(得分:-3)
尝试转到config / database.php 在mysql> strict => false