当前位置: 首页>>代码示例>>PHP>>正文


PHP Catalog::getTables方法代码示例

本文整理汇总了PHP中Catalog::getTables方法的典型用法代码示例。如果您正苦于以下问题:PHP Catalog::getTables方法的具体用法?PHP Catalog::getTables怎么用?PHP Catalog::getTables使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Catalog的用法示例。


在下文中一共展示了Catalog::getTables方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initQuery

 function initQuery($params)
 {
     $tables = Manufacturers::getTables();
     $tables_ctl = Catalog::getTables();
     $m = $tables['manufacturers']['columns'];
     $pa = $tables_ctl['product_attributes']['columns'];
     $setting_filtering = $params['setting_filtering'];
     $setting_nonempty = $params['setting_nonempty'];
     $zone = $params['zone'];
     $b_only_active = $params['b_only_active'];
     $return_all = $params['return_all'];
     $_ids = $params['_ids'];
     $this->addSelectTable('manufacturers');
     $this->addSelectField("DISTINCT(" . $m['manufacturer_id'] . ")", 'id');
     $this->addSelectField($m['manufacturer_name'], 'value');
     if ($b_only_active === true) {
         $this->WhereValue($m['manufacturer_active'], DB_EQ, DB_TRUE);
     }
     if ($return_all == false && $setting_nonempty == "HIDE_EMPTY" && $zone == "CustomerZone") {
         $this->addSelectTable('product_attributes');
         if ($b_only_active === true) {
             $this->WhereAND();
         }
         $this->WhereField($m['manufacturer_id'], DB_EQ, $pa['attr_value']);
         $this->WhereAND();
         $this->WhereValue($pa['a_id'], DB_EQ, modApiFunc('Catalog', 'getManufacturerAttrId'));
         if (!empty($_ids)) {
             foreach ($_ids as $i) {
                 $ids[] = $i['product_id'];
             }
             $this->WhereAND();
             $this->WhereField($pa['p_id'], DB_IN, '(' . implode(',', $ids) . ')');
         }
     }
     $this->SelectOrder($m['sort_order'], 'ASC');
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:36,代码来源:common.php

示例2: uninstall

 /**
  * Uninstalls the module.
  * It deletes all module tables.
  *
  * The uninstall() method is called statically.
  * To call other methods of this class from this method,
  * the static call is used, for example,
  * Catalog::getTables() instead of $this->getTables()
  */
 function uninstall()
 {
     $query = new DB_Table_Delete(Catalog::getTables());
     global $application;
     $application->db->getDB_Result($query);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:15,代码来源:catalog_api.php

示例3: initQuery

 function initQuery($params)
 {
     $pid = $params['pid'];
     $tables = Catalog::getTables();
     $c = $tables['products_to_categories']['columns'];
     $this->addSelectField($c['category_id'], 'mcats');
     $this->WhereValue($c['product_id'], DB_EQ, $pid);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:8,代码来源:common.php

示例4: initQuery

 function initQuery($params)
 {
     $id = $params['it_id'];
     $tables = Catalog::getTables();
     $it = $tables['input_types']['columns'];
     $itv = $tables['input_type_values']['columns'];
     foreach ($it as $k => $v) {
         $this->addSelectField($v);
     }
     foreach ($itv as $k => $v) {
         if ($k != 'value') {
             $this->addSelectField($v);
         } else {
             $this->setMultiLangAlias('_ml_value', 'input_type_values', $itv['value'], $itv['id'], 'Catalog');
             $this->addSelectValue($this->getMultiLangAlias('_ml_value'), 'input_type_value');
         }
     }
     $this->WhereValue($it['id'], DB_EQ, $id);
     $this->WhereAND();
     $this->WhereField($itv['it_id'], DB_EQ, $it['id']);
     $this->SelectOrder($itv['id'], 'ASC');
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:22,代码来源:common.php

示例5: initQuery

 function initQuery($params)
 {
     $tables = Customer_Reviews::getTables();
     $crtable = $tables['customer_reviews']['columns'];
     $rtable = $tables['customer_reviews_rates']['columns'];
     $rltable = $tables['customer_reviews_rate_list']['columns'];
     $product_tables = Catalog::getTables();
     $ptable = $product_tables['products']['columns'];
     $patable = $product_tables['product_attributes']['columns'];
     $ptatable = $product_tables['product_type_attributes']['columns'];
     $this->addSelectTable('customer_reviews');
     $this->addSelectTable('customer_reviews_rates');
     $this->addSelectTable('customer_reviews_rate_list');
     $this->addSelectField($crtable['product_id']);
     $this->addSelectField('SUM(' . $rtable['rate'] . ')', 'total_rate');
     $this->addSelectField('COUNT(' . $rtable['rate'] . ')', 'total_count');
     // getting customer_review value for selected product
     // attribute_id = CUSTOMER_REVIEWS_PRODUCT_ATTRIBUTE_ID
     $attribute_id = modApiFunc('Catalog', 'getCustomerReviewsAttrId');
     $this->addLeftJoinOnConditions('product_attributes', array($crtable['product_id'], DB_EQ, $patable['p_id'], DB_AND, $patable['a_id'], DB_EQ, $attribute_id));
     $this->addLeftJoin('products', $crtable['product_id'], DB_EQ, $ptable['id']);
     $this->addLeftJoinOnConditions('product_type_attributes', array($ptable['pt_id'], DB_EQ, $ptatable['pt_id'], DB_AND, $ptatable['type_attr_visible'], DB_EQ, '1', DB_AND, $ptatable['a_id'], DB_EQ, $attribute_id));
     $this->addSelectField('IF(' . $patable['attr_value'] . ' IS NULL OR ' . $ptatable['a_id'] . ' IS NULL, 0, ' . $patable['attr_value'] . ')', 'product_cr');
     $this->WhereField($crtable['cr_id'], DB_EQ, $rtable['cr_id']);
     $this->WhereAND();
     $this->WhereField($rtable['cr_rl_id'], DB_EQ, $rltable['cr_rl_id']);
     $this->WhereAND();
     // show only visible rates
     $this->WhereValue($rltable['visible'], DB_EQ, 'Y');
     $this->WhereAND();
     // show only approved reviews
     $this->WhereValue($crtable['status'], DB_EQ, 'A');
     if (isset($params['product_id'])) {
         $this->WhereAND();
         $this->WhereValue($crtable['product_id'], DB_EQ, $params['product_id']);
     }
     $this->SelectGroup($crtable['product_id']);
 }
开发者ID:KICHIRO20,项目名称:-Myproject_part1-,代码行数:38,代码来源:common.php


注:本文中的Catalog::getTables方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。