================================================================================
- エレコマ(Elephant Commerce) version 1.0.0 http://ec.kbmj.com/
+ エレコマ(Elephant Commerce) version 1.0.2 http://ec.kbmj.com/
================================================================================
エレコマのダウンロードありがとうございます。
8. アプリケーションの展開
# cd /usr/local
-# tar zxf (DOWNLOAD_PATH)/elecoma-1.0.0.tar.gz
-# mv elecoma-1.0.0 ec
+# tar zxf (DOWNLOAD_PATH)/elecoma-<version>.tar.gz
+# mv elecoma-<version> ec
# chown -R ec:ec /usr/local/ec
9. postgresqlのセットアップ
* エレコマ ライセンス
================================================================================
本ソフトウェアはMIT Licenceを採用しています。
-ライセンスの詳細についてはCopyrightファイルを参照してください。
+ライセンスの詳細についてはCOPYRIGHTファイルを参照してください。
配布物に含まれる「エレコマ」のロゴはクリエイティブ・コモンズノ表示-継承 2.1
日本ライセンスに従った範囲内でご利用いただけます。
render :action => "index"
return
end
- condition_sql = CustomerSearchForm.get_sql_select + CustomerSearchForm.get_sql_condition(@condition)
- @customers = Customer.paginate_by_sql(condition_sql,
+ sql_condition, conditions = CustomerSearchForm.get_sql_condition(@condition)
+ sql = CustomerSearchForm.get_sql_select(true) + sql_condition
+ sqls = [sql]
+ conditions.each do |c|
+ sqls << c
+ end
+ #condition_sql = CustomerSearchForm.get_sql_select + CustomerSearchForm.get_sql_condition(@condition)
+ #@customers = Customer.paginate_by_sql(condition_sql,
+ @customers = Customer.paginate_by_sql(sqls,
:page => params[:page],
:per_page => @condition.search_par_page,
:order => "id")
return
end
session[:condition_save] = @condition
- @customers = Customer.paginate_by_sql(MailMagazine.get_sql_select + MailMagazine.get_sql_condition(@condition),
+ sql_condition, conditions = MailMagazine.get_sql_condition(@condition)
+ sql = MailMagazine.get_sql_select + sql_condition
+ sqls = [sql]
+ conditions.each do |c|
+ sqls << c
+ end
+ #@customers = Customer.paginate_by_sql(MailMagazine.get_sql_select + MailMagazine.get_sql_condition(@condition),
+ @customers = Customer.paginate_by_sql(sqls,
:page => params[:page],
:per_page => @condition.search_par_page,
:order => "id")
- all_customers = Customer.find_by_sql(MailMagazine.get_sql_select + MailMagazine.get_sql_condition(@condition))
+ #all_customers = Customer.find_by_sql(MailMagazine.get_sql_select + MailMagazine.get_sql_condition(@condition))
+ all_customers = Customer.find_by_sql(sqls)
@check_all = true
customer_ids = []
redirect_to :ation => "index"
end
condition_data = MailMagazineCondition.new(@condition).to_yaml
- @customers = Customer.find_by_sql(MailMagazine.get_sql_select + MailMagazine.get_sql_condition(@condition, except_list))
+ sql_condition, conditions = MailMagazine.get_sql_condition(@condition, except_list)
+ sql = MailMagazine.get_sql_select + sql_condition
+ sqls = [sql]
+ conditions.each do |c|
+ sqls << c
+ end
+ #@customers = Customer.find_by_sql(MailMagazine.get_sql_select + MailMagazine.get_sql_condition(@condition, except_list))
+ @customers = Customer.find_by_sql(sqls)
@contents = MailMagazineContentsForm.new(params[:contents])
mm = MailMagazine.new
def full_name
"#{family_name} #{first_name}"
end
+
+ def full_name_kana
+ "#{family_name_kana} #{first_name_kana}"
+ end
+
+ def tel_no
+ "#{tel01}-#{tel02}-#{tel03}"
+ end
def self.get_symbols
[
\r
def self.csv(params)\r
@condition = self.new(params[:condition] ||= [])\r
- customers = Customer.find_by_sql(get_sql_select(true) + get_sql_condition(@condition))\r
+ sql_condition, conditions = get_sql_condition(@condition)\r
+ sql = get_sql_select(true) + sql_condition\r
+ sqls = [sql]\r
+ conditions.each do |c|\r
+ sqls << c\r
+ end\r
+ #customers = Customer.find_by_sql(get_sql_select(true) + get_sql_condition(@condition))\r
+ customers = Customer.find_by_sql(sqls)\r
unless customers.size > 0\r
return false\r
end\r
end\r
\r
def self.get_sql_condition(condition)\r
- <<-EOS\r
+ conditions = []\r
+ sql_condition = <<-EOS\r
from\r
customers c\r
\r
where o.id=d.order_id\r
and d.id=t.order_delivery_id\r
#{if !condition.product_name.blank?\r
- "and t.product_name like '%#{condition.product_name}%'"\r
+ conditions << "%#{condition.product_name}%"\r
+ "and t.product_name like ? "\r
end}\r
#{if !condition.product_code.blank?\r
- "and t.product_code like '%#{condition.product_code}%'"\r
+ conditions << "%#{connection.product_code}%"\r
+ "and t.product_code like ? "\r
end}\r
#{if !condition.category_id.blank?\r
"and t.product_category_id =#{condition.category_id}"\r
"and c.prefecture_id = '#{condition.prefecture_id}'"\r
end}\r
#{unless condition.customer_name_kanji.blank?\r
- "and (c.family_name || c.first_name) like '%#{condition.customer_name_kanji}%'"\r
+ conditions << "%#{condition.customer_name_kanji}%"\r
+ "and (c.family_name || c.first_name) like ? "\r
end}\r
#{unless condition.customer_name_kana.blank?\r
- "and (c.family_name_kana || c.first_name_kana) like '%#{condition.customer_name_kana}%'"\r
+ conditions << "%#{condition.customer_name_kana}%"\r
+ "and (c.family_name_kana || c.first_name_kana) like ?"\r
end}\r
#{if condition.sex_male == "1" && condition.sex_female == "0"\r
"and c.sex=1"\r
end\r
}\r
#{unless condition.email.blank?\r
- "and c.email like '%#{condition.email}%'"\r
+ conditions << "%#{condition.email}%"\r
+ "and c.email like ? "\r
end}\r
#{if condition.reachable == '1'\r
"and c.reachable = '1'"\r
end} \r
#{unless condition.tel_no.blank?\r
- "and (c.tel01 || c.tel02 || c.tel03) like '%#{condition.tel_no}%'"\r
+ conditions << "%#{condition.tel_no}%"\r
+ "and (c.tel01 || c.tel02 || c.tel03) like ? "\r
end}\r
#{unless condition.occupation_id.blank?\r
"and c.occupation_id in ('" << condition.occupation_id.join("','") << "')"\r
}\r
order by c.id\r
EOS\r
+ return [sql_condition, conditions] \r
end\r
\r
end\r
end
def self.get_sql_condition(condition, except_list = [])
- <<-EOS
+ conditions = []
+ sql_condition = <<-EOS
from
customers c
where o.id=d.order_id
and d.id=t.order_delivery_id
#{if !condition.product_name.blank?
- "and t.product_name like '%#{condition.product_name}%'"
+ conditions << "%#{condition.product_name}%"
+ "and t.product_name like ? "
end}
#{if !condition.product_code.blank?
- "and t.product_code like '%#{condition.product_code}%'"
+ conditions << "%#{condition.product_code}%"
+ "and t.product_code like ? "
end}
#{if !condition.category_id.blank?
"and t.product_category_id =#{condition.category_id}"
"and c.prefecture_id = '#{condition.prefecture_id}'"
end}
#{unless condition.customer_name_kanji.blank?
- "and (c.family_name || c.first_name) like '%#{condition.customer_name_kanji}%'"
+ conditions << "%#{condition.customer_name_kanji}%"
+ "and (c.family_name || c.first_name) like ? "
end}
#{unless condition.customer_name_kana.blank?
- "and (c.family_name_kana || c.first_name_kana) like '%#{condition.customer_name_kana}%'"
+ condition << "%#{condition.customer_name_kana}%"
+ "and (c.family_name_kana || c.first_name_kana) like ? "
end}
#{if condition.sex_male == "1" && condition.sex_female == "0"
"and c.sex=1"
end
}
#{unless condition.email.blank?
- "and c.email like '%#{condition.email}%'"
+ conditions << "%#{condition.email}%"
+ "and c.email like ? "
end}
#{unless condition.tel_no.blank?
- "and (c.tel01 || c.tel02 || c.tel03) like '%#{condition.tel_no}%'"
+ conditions << "%#{condition.tel_no}%"
+ "and (c.tel01 || c.tel02 || c.tel03) like ? "
end}
#{unless condition.occupation_id.blank?
"and c.occupation_id in ('" << condition.occupation_id.join("','") << "')"
end}
order by c.id
EOS
+ return sql_condition, conditions
end
end
<td rowspan="2"><%= Customer::ACTIVATE_NAMES[c.activate.to_i] %></td>\r
<td><%= c.id %></td>\r
<td rowspan="2">\r
- <%= c.name_kanji %>/\r
- <%= c.name_kana %>\r
+ <%= c.full_name %>/\r
+ <%= c.full_name_kana %>\r
</td>\r
<td rowspan="2"><%= System::SEX_NAMES[c.sex] %></td>\r
<td><%= c.tel_no %></td>\r
trade_item: 取扱商品
introduction: 店舗案内
prefecture_id: '13'
+ deleted_at:
}\r
\r
#header h1 {\r
- width: 158px;\r
+ width: 169px;\r
margin: 22px auto 0;\r
}\r
\r