1. $res_exi = $user_coupon->fetchSql()->where('user_id="'.$user_id.'" AND coupon_id="'.$id.'" ')->find();
2. $user->getLastSql(); 或$user->_sql();
3. 配置中数据库开启调试模式
'DB_DEBUG' => true, //开启调试模式 记录SQL日志,Runtime/Logs查看日志记录
4. M()->_sql();
1. $res_exi = $user_coupon->fetchSql()->where('user_id="'.$user_id.'" AND coupon_id="'.$id.'" ')->find();
2. $user->getLastSql(); 或$user->_sql();
3. 配置中数据库开启调试模式
'DB_DEBUG' => true, //开启调试模式 记录SQL日志,Runtime/Logs查看日志记录
4. M()->_sql();