$datum = Coupon::orderBy('create_at','desc')->get();
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'orders by `create_at` desc' at line 1 (SQL: select * from `st_coupon` where `st_coupon`.`delete_at` is null orders by `create_at` desc)
laravel 5.6版本 php 7.2
就是数据库操作将orderBy编译成了orders by,是什么原因?
我问俩个问题:
1.created_at是不是created_at?
2.sqlwhere语句是从哪里来的,是不是代码没贴完整