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


PHP DbQuery::orderby方法代码示例

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


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

示例1: getLocalCampaigns

 private function getLocalCampaigns($campaign_state = null)
 {
     $req = new DbQuery();
     $req->select('campaign_id, campaign_state, campaign_date_update, campaign_date_send, campaign_name');
     $req->from($this->table);
     if ($campaign_state) {
         $req->where('campaign_state = ' . (string) $campaign_state);
     }
     $req->orderby('campaign_date_update DESC');
     $req->limit(5);
     $user_list = Db::getInstance()->executeS($req, true, false);
     return $user_list;
 }
开发者ID:Oldwo1f,项目名称:yakaboutique,代码行数:13,代码来源:adminmarketingslist.php

示例2: connectFromCredentials

 public function connectFromCredentials($media = 'all')
 {
     $req = new DbQuery();
     $req->select('*');
     $req->from('expressmailing');
     $req->orderby('api_media DESC');
     switch ($media) {
         case 'email':
             $req->where('api_media IN (\'all\', \'email\')');
             break;
         case 'fax':
             $req->where('api_media IN (\'all\', \'fax\')');
             break;
         case 'sms':
             $req->where('api_media IN (\'all\', \'sms\')');
             break;
         default:
             $req->where('api_media = \'all\'');
             break;
     }
     $api_credentials = Db::getInstance()->executeS($req, true, false);
     if (count($api_credentials) > 0) {
         // On indique que la base locale contient des credentials
         // ------------------------------------------------------
         $this->credentials = count($api_credentials);
         // Si on trouve un couple login/password en local, on initie la connexion à l'api
         // ------------------------------------------------------------------------------
         if ($this->openSession()) {
             // Puis on regarde si ce compte est toujours actif
             // -----------------------------------------------
             foreach ($api_credentials as $account) {
                 $this->error = null;
                 $response_array = array();
                 $parameters = array('login' => $account['api_login'], 'password' => $account['api_password']);
                 if ($this->connectUser($parameters, $response_array)) {
                     if (isset($response_array['account_id']) && (int) $response_array['account_id'] > 0) {
                         // Le compte est toujours actif !
                         // ------------------------------
                         Configuration::updateValue('adminmarketing_session_api', $this->session_id);
                         return true;
                     }
                 }
             }
         }
     }
     return false;
 }
开发者ID:Oldwo1f,项目名称:yakaboutique,代码行数:47,代码来源:session_api.php

示例3: getCustomersSmsRequest

    public static function getCustomersSmsRequest($campaign_id, $checked_langs, $checked_groups, $checked_campaign_active, $checked_products, $checked_categories, $limit = 0, &$list_total = null)
    {
        $sql_calc_found = is_null($list_total) ? '' : 'SQL_CALC_FOUND_ROWS ';
        $req = new DbQuery();
        $req->select($sql_calc_found . (int) $campaign_id . ' as campaign_id, address.phone_mobile as target,
				address.phone_mobile as col_0, customer.lastname as col_1, customer.firstname as col_2,address.postcode as col_3,
				address.city as col_4, \'prestashop\' as source');
        $req->from('customer', 'customer');
        $req->leftJoin('customer_group', 'customer_group', 'customer_group.id_customer = customer.id_customer');
        $req->leftJoin('guest', 'guest', 'guest.id_customer = customer.id_customer');
        $req->leftJoin('connections', 'connections', 'connections.id_guest = guest.id_guest');
        $req->innerJoin('address', 'address', 'address.id_customer = customer.id_customer AND address.phone_mobile <> \'\'');
        $req->leftJoin('country', 'country', 'address.id_country = country.id_country');
        $where = array();
        $where[] = 'address.phone_mobile IS NOT NULL AND address.phone_mobile <> \'\'';
        if (!empty($checked_langs)) {
            $where[] = 'customer.id_lang IN(' . implode(', ', array_map('intval', $checked_langs)) . ')';
        }
        if (!empty($checked_groups)) {
            $where[] = 'customer_group.id_group IN(' . implode(', ', array_map('intval', $checked_groups)) . ')';
        }
        if ($checked_campaign_active) {
            $where[] = 'customer.active = 1';
        }
        if (!empty($checked_products) || !empty($checked_categories)) {
            $where_products_categories = array();
            $req->leftJoin('cart', 'cart', 'cart.id_customer = customer.id_customer');
            $req->leftJoin('cart_product', 'cart_product', 'cart_product.id_cart = cart.id_cart');
            if (!empty($checked_products)) {
                $where_products_categories[] = 'cart_product.id_product IN(' . implode(', ', array_map('intval', $checked_products)) . ')';
            }
            if (!empty($checked_categories)) {
                $req->leftJoin('category_product', 'category_product', 'category_product.id_product = cart_product.id_product');
                $where_products_categories[] = 'category_product.id_category IN(' . implode(', ', array_map('intval', $checked_categories)) . ')';
            }
            $where[] = implode(' OR ', $where_products_categories);
        }
        $req->where(implode(' AND ', $where));
        $req->orderby('customer.id_customer');
        $req->groupby('customer.id_customer');
        $limit = (int) $limit;
        if ($limit) {
            $req->limit($limit);
        }
        return $req;
    }
开发者ID:Oldwo1f,项目名称:yakaboutique,代码行数:46,代码来源:db_marketing.php


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