瀏覽代碼

Fixed SQL query incompatibility between sqlite and postgres

pull/3/head
Adrian Short 14 年之前
父節點
當前提交
ed04b3ce65
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      app.rb

+ 2
- 2
app.rb 查看文件

@@ -76,11 +76,11 @@ get '/services/:slug' do
@min = @service.payments.min(:amount)
@results = repository(:default).adapter.query("
SELECT s.id, s.name AS supplier_name, s.slug AS supplier_slug, SUM(p.amount) AS total
SELECT s.name AS supplier_name, s.slug AS supplier_slug, SUM(p.amount) AS total
FROM payments p, suppliers s
WHERE p.supplier_id = s.id
AND p.service_id = #{@service.id}
GROUP BY s.id
GROUP BY s.name, s.slug
ORDER BY total DESC")

haml :service


Loading…
取消
儲存