Class: C80Yax::PrefixProp

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
Concerns::Props::Parsable
Defined in:
app/models/c80_yax/prefix_prop.rb

Class Method Summary collapse

Methods included from Concerns::Props::Parsable

included

Class Method Details

.select_props_sql(strsubcat_id) ⇒ Object

--------------—————---------------——————————————————–--------------- | strsubcat_id | prefix_prop_id | prop_name_id | title | uom_title | --------------—————---------------——————————————————–--------------- | 7 | 5 | 36 | Бренд | NULL | | 7 | 6 | 46 | Завод | NULL | --------------—————---------------——————————————————–---------------



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'app/models/c80_yax/prefix_prop.rb', line 15

def self.select_props_sql(strsubcat_id)
  sql = "
  SELECT
    c80_yax_prefix_props.strsubcat_id,
    c80_yax_prefix_props_prop_names.*,
    c80_yax_prop_names.title,
    c80_yax_uoms.title as uom_title
  FROM c80_yax_prefix_props
    LEFT JOIN c80_yax_prefix_props_prop_names ON c80_yax_prefix_props.id = c80_yax_prefix_props_prop_names.prefix_prop_id
    LEFT JOIN c80_yax_prop_names ON c80_yax_prefix_props_prop_names.prop_name_id = c80_yax_prop_names.id
    LEFT JOIN c80_yax_uoms ON c80_yax_prop_names.uom_id = c80_yax_uoms.id
  WHERE c80_yax_prefix_props.strsubcat_id = #{strsubcat_id};
"
  rows = ActiveRecord::Base.connection.execute(sql)
  rows

end