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


PHP AZLib::money方法代码示例

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


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

示例1: BuildForm

 function BuildForm()
 {
     Form::Form('BuildForm');
     CGlobal::$website_title = "Xây dựng cấu hình máy tính";
     if (Build::$bcatid) {
         $this->filter_get = Url::get('filter');
         AZLib::getFilters();
         if (isset(CGlobal::$filters[Build::$bcatid])) {
             $this->filter_groups = CGlobal::$filters[Build::$bcatid];
         }
         #############################################################################################################################################
         #Search condition
         CGlobal::$item_condition = "category_id = " . Build::$bcatid . " AND quantity>0 AND status = 1 AND price>0 AND quantity>0";
         //CGlobal::$item_condition .="status = 1 AND filter_ids != ''";
         $filter_str = '';
         if (isset(CGlobal::$filters[Build::$bcatid])) {
             $this->filter_groups = CGlobal::$filters[Build::$bcatid];
             $filter_get = $this->filter_get;
             $this->filter_get = array();
             if ($this->filter_groups) {
                 foreach ($this->filter_groups as $fgid => $gfilter) {
                     if ($filter_get && isset($filter_get[$fgid]) && $filter_get[$fgid]) {
                         $fid = $filter_get[$fgid];
                         if ($gfilter['filters'] && in_array($fid, array_keys($gfilter['filters']))) {
                             CGlobal::$no_paging = true;
                             $this->filter_get[$fgid] = $fid;
                             $filter_str .= ($filter_str == '' ? '+' : ' +') . "g{$fgid}f{$fid}f";
                         }
                     }
                 }
             }
         }
         $price_str = CGlobal::$allCategories[Build::$bcatid]['price_str'];
         if ($price_str) {
             $filter_price = array();
             $arr = explode(',', $price_str);
             $link = AZRewrite::formatUrl(Url::build_all(array('min', 'max', 'filter', 'page_no')));
             if ($this->filter_get) {
                 foreach ($this->filter_get as $get_gid => $get_fid) {
                     $link .= "&filter[{$get_gid}]={$get_fid}";
                 }
             }
             //SELECT 	SUM((price < 2000000 AND currency_id=1) OR ((price* 18000)< 200000 AND currency_id=2)) AS filter,
             //SUM((price >= 2000000 AND price< 5000000  AND currency_id=1) OR ((price* 18000) >= 200000 AND (price* 18000) < 500000 AND currency_id=2)) AS filter
             //FROM products
             $last_price = 0;
             $get_min = (int) Url::get('min', 0);
             $get_max = (int) Url::get('max', 0);
             $i = 1;
             foreach ($arr as $price) {
                 if ($last_price == 0) {
                     $this->price_cout_str .= ($this->price_cout_str != '' ? ',' : '') . " SUM((price < {$price} AND currency_id=1) OR ((price * " . CGlobal::$exchange . ") < {$price} AND currency_id=2)) AS `0`";
                 } else {
                     $this->price_cout_str .= ($this->price_cout_str != '' ? ',' : '') . " SUM((price >= {$last_price} AND price < {$price} AND currency_id=1) OR ((price * " . CGlobal::$exchange . ") >= {$last_price} AND (price * " . CGlobal::$exchange . ") < {$price} AND currency_id=2)) AS `{$last_price}`";
                 }
                 if ($get_min == $last_price && $get_max == $price) {
                     $this->min = $get_min;
                     $this->max = $get_max;
                 }
                 $filter_price[] = array('min' => $last_price, 'max' => $price);
                 $last_price = $price;
                 $i++;
             }
             if ($last_price) {
                 if ($get_min == $last_price && $get_max == 0) {
                     $this->min = $get_min;
                     $this->max = 0;
                 }
                 $this->price_cout_str .= ($this->price_cout_str != '' ? ',' : '') . "SUM((price >= {$last_price} AND currency_id=1) OR ((price * " . CGlobal::$exchange . ") >= {$last_price} AND currency_id=2)) AS `{$last_price}`";
                 $filter_price[] = array('min' => $last_price, 'max' => 0);
                 $last_price = $price;
             }
             if ($this->min) {
                 CGlobal::$item_condition .= " AND ((price >= " . $this->min . " AND currency_id=1) OR ((price * " . CGlobal::$exchange . ") >= " . $this->min . " AND currency_id=2))";
             }
             if ($this->max) {
                 CGlobal::$item_condition .= " AND ((price < " . $this->max . " AND currency_id=1) OR ((price * " . CGlobal::$exchange . ") < " . $this->max . " AND currency_id=2))";
             }
         }
         if ($filter_str) {
             CGlobal::$item_condition .= " AND MATCH(filter_search) AGAINST ('{$filter_str}' IN BOOLEAN MODE)";
         }
         #############################################################################################################################################
         if ($this->price_cout_str) {
             $this->filter_price = array('name' => "Giới hạn theo giá (VNĐ)", 'filters' => array());
             $price_cout_arr = DB::fetch("SELECT " . $this->price_cout_str . " FROM item WHERE " . CGlobal::$item_condition);
             if ($filter_price) {
                 foreach ($filter_price as $fprice) {
                     $min = $fprice['min'];
                     $max = $fprice['max'];
                     if ($price_cout_arr[$min]) {
                         if ($min && $max) {
                             $link2 = "{$link}&min={$min}&max={$max}";
                             $name = AZLib::money($min) . " - " . AZLib::money($max);
                         } elseif (!$max) {
                             $link2 = "{$link}&min={$min}";
                             $name = "Trên " . AZLib::money($min);
                         } elseif (!$min) {
                             $link2 = "{$link}&max={$max}";
                             $name = "Dưới " . AZLib::money($max);
//.........这里部分代码省略.........
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:Build.php

示例2: __construct


//.........这里部分代码省略.........
             }
         }
         //CGlobal::$item_condition .= ' AND MATCH(name, list_brief, brief, description) AGAINST (\'*'.$keywords.'*\' IN BOOLEAN MODE)  HAVING relevance > 0.2';
         //CGlobal::$item_condition .= " AND MATCH(name) AGAINST ('*$keywords*' IN BOOLEAN MODE)";
         CGlobal::$item_condition .= " AND MATCH(name, list_brief, brief, description) AGAINST ('{$keywords}' IN BOOLEAN MODE)";
         $filter_get = $this->filter_get;
         $this->filter_get = array();
         $filter_str = '';
         if ($this->filter_groups) {
             foreach ($this->filter_groups as $fgid => $gfilter) {
                 if ($filter_get && isset($filter_get[$fgid]) && $filter_get[$fgid]) {
                     $fid = $filter_get[$fgid];
                     if ($gfilter['filters'] && in_array($fid, array_keys($gfilter['filters']))) {
                         CGlobal::$no_paging = true;
                         $this->filter_get[$fgid] = $fid;
                         $filter_str .= ($filter_str == '' ? '+' : ' +') . "g{$fgid}f{$fid}f";
                     }
                 }
             }
         }
         $price_str = CGlobal::$allCategories[$this->search_catid]['price_str'];
         if ($price_str) {
             $filter_price = array();
             $arr = explode(',', $price_str);
             $link = Url::build_all(array('filter', 'max', 'min'));
             if ($this->filter_get) {
                 foreach ($this->filter_get as $get_gid => $get_fid) {
                     $link .= "&filter[{$get_gid}]={$get_fid}";
                 }
             }
             //SELECT 	SUM((price < 2000000 AND currency_id=1) OR ((price* 18000)< 200000 AND currency_id=2)) AS filter,
             //SUM((price >= 2000000 AND price< 5000000  AND currency_id=1) OR ((price* 18000) >= 200000 AND (price* 18000) < 500000 AND currency_id=2)) AS filter
             //FROM products
             $last_price = 0;
             $get_min = (int) Url::get('min', 0);
             $get_max = (int) Url::get('max', 0);
             $i = 1;
             foreach ($arr as $price) {
                 if ($last_price == 0) {
                     $this->price_cout_str .= ($this->price_cout_str != '' ? ',' : '') . " SUM((price < {$price} AND currency_id=1) OR ((price * " . CGlobal::$exchange . ") < {$price} AND currency_id=2)) AS `0`";
                 } else {
                     $this->price_cout_str .= ($this->price_cout_str != '' ? ',' : '') . " SUM((price >= {$last_price} AND price < {$price} AND currency_id=1) OR ((price * " . CGlobal::$exchange . ") >= {$last_price} AND (price * " . CGlobal::$exchange . ") < {$price} AND currency_id=2)) AS `{$last_price}`";
                 }
                 if ($get_min == $last_price && $get_max == $price) {
                     $this->min = $get_min;
                     $this->max = $get_max;
                 }
                 $filter_price[] = array('min' => $last_price, 'max' => $price);
                 $last_price = $price;
                 $i++;
             }
             if ($last_price) {
                 if ($get_min == $last_price && $get_max == 0) {
                     $this->min = $get_min;
                     $this->max = 0;
                 }
                 $this->price_cout_str .= ($this->price_cout_str != '' ? ',' : '') . "SUM((price >= {$last_price} AND currency_id=1) OR ((price * " . CGlobal::$exchange . ") >= {$last_price} AND currency_id=2)) AS `{$last_price}`";
                 $filter_price[] = array('min' => $last_price, 'max' => 0);
                 $last_price = $price;
             }
             if ($this->min) {
                 CGlobal::$item_condition .= " AND ((price >= " . $this->min . " AND currency_id=1) OR ((price * " . CGlobal::$exchange . ") >= " . $this->min . " AND currency_id=2))";
             }
             if ($this->max) {
                 CGlobal::$item_condition .= " AND ((price < " . $this->max . " AND currency_id=1) OR ((price * " . CGlobal::$exchange . ") < " . $this->max . " AND currency_id=2))";
             }
         }
         if ($filter_str) {
             CGlobal::$item_condition .= " AND MATCH(filter_search) AGAINST ('{$filter_str}' IN BOOLEAN MODE)";
         }
         #############################################################################################################################################
         if ($this->price_cout_str) {
             $this->filter_price = array('name' => "Giới hạn theo giá (VNĐ)", 'filters' => array());
             $price_cout_arr = DB::fetch("SELECT " . $this->price_cout_str . " FROM item WHERE " . CGlobal::$item_condition);
             if ($filter_price) {
                 foreach ($filter_price as $fprice) {
                     $min = $fprice['min'];
                     $max = $fprice['max'];
                     if ($price_cout_arr[$min]) {
                         if ($min && $max) {
                             $link2 = "{$link}&min={$min}&max={$max}";
                             $name = AZLib::money($min) . " - " . AZLib::money($max);
                         } elseif (!$max) {
                             $link2 = "{$link}&min={$min}";
                             $name = "Trên " . AZLib::money($min);
                         } elseif (!$min) {
                             $link2 = "{$link}&max={$max}";
                             $name = "Dưới " . AZLib::money($max);
                         }
                         if ($this->min == $min && $this->max == $max) {
                             $this->filter_price['filters'][] = array('link' => $link, 'name' => $name, 'count' => $price_cout_arr[$min], 'remove' => 1);
                         } else {
                             $this->filter_price['filters'][] = array('link' => $link2, 'name' => $name, 'count' => $price_cout_arr[$min], 'remove' => 0);
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:FilterMenuSearch.php

示例3: __construct

 function __construct()
 {
     Form::Form('FilterMenuForm');
     $this->filter_get = Url::get('filter');
     if (CGlobal::$curCategory && isset(CGlobal::$filters[CGlobal::$curCategory])) {
         $this->filter_groups = CGlobal::$filters[CGlobal::$curCategory];
     }
     #############################################################################################################################################
     #Search condition
     if (CGlobal::$curLevel2Cat) {
         CGlobal::$item_condition = "level_2_catid = " . CGlobal::$curLevel2Cat['id'] . " AND ";
     } elseif (CGlobal::$curMainCat) {
         CGlobal::$item_condition = "level_1_catid = " . CGlobal::$curMainCat['id'] . " AND ";
     }
     CGlobal::$item_condition .= "status = 1";
     //CGlobal::$item_condition .="status = 1 AND filter_ids != ''";
     $filter_get = $this->filter_get;
     $this->filter_get = array();
     $filter_str = '';
     if ($this->filter_groups) {
         foreach ($this->filter_groups as $fgid => $gfilter) {
             if ($filter_get && isset($filter_get[$fgid]) && $filter_get[$fgid]) {
                 $fid = $filter_get[$fgid];
                 if ($gfilter['filters'] && in_array($fid, array_keys($gfilter['filters']))) {
                     CGlobal::$no_paging = true;
                     $this->filter_get[$fgid] = $fid;
                     $filter_str .= ($filter_str == '' ? '+' : ' +') . "g{$fgid}f{$fid}f";
                 }
             }
         }
     }
     if (CGlobal::$curCategory && isset(CGlobal::$allCategories[CGlobal::$curCategory])) {
         $price_str = CGlobal::$allCategories[CGlobal::$curCategory]['price_str'];
         if ($price_str) {
             $filter_price = array();
             $arr = explode(',', $price_str);
             $link = WEB_DIR . "c" . CGlobal::$curCategory . "/" . Url::get('ebname');
             if ($this->filter_get) {
                 foreach ($this->filter_get as $get_gid => $get_fid) {
                     $link .= "&filter[{$get_gid}]={$get_fid}";
                 }
             }
             //SELECT 	SUM((price < 2000000 AND currency_id=1) OR ((price* 18000)< 200000 AND currency_id=2)) AS filter,
             //SUM((price >= 2000000 AND price< 5000000  AND currency_id=1) OR ((price* 18000) >= 200000 AND (price* 18000) < 500000 AND currency_id=2)) AS filter
             //FROM products
             $last_price = 0;
             $get_min = (int) Url::get('min', 0);
             $get_max = (int) Url::get('max', 0);
             $i = 1;
             foreach ($arr as $price) {
                 if ($last_price == 0) {
                     $this->price_cout_str .= ($this->price_cout_str != '' ? ',' : '') . " SUM((price < {$price} AND currency_id=1) OR ((price * " . CGlobal::$exchange . ") < {$price} AND currency_id=2)) AS `0`";
                 } else {
                     $this->price_cout_str .= ($this->price_cout_str != '' ? ',' : '') . " SUM((price >= {$last_price} AND price < {$price} AND currency_id=1) OR ((price * " . CGlobal::$exchange . ") >= {$last_price} AND (price * " . CGlobal::$exchange . ") < {$price} AND currency_id=2)) AS `{$last_price}`";
                 }
                 if ($get_min == $last_price && $get_max == $price) {
                     $this->min = $get_min;
                     $this->max = $get_max;
                 }
                 $filter_price[] = array('min' => $last_price, 'max' => $price);
                 $last_price = $price;
                 $i++;
             }
             if ($last_price) {
                 if ($get_min == $last_price && $get_max == 0) {
                     $this->min = $get_min;
                     $this->max = 0;
                 }
                 $this->price_cout_str .= ($this->price_cout_str != '' ? ',' : '') . "SUM((price >= {$last_price} AND currency_id=1) OR ((price * " . CGlobal::$exchange . ") >= {$last_price} AND currency_id=2)) AS `{$last_price}`";
                 $filter_price[] = array('min' => $last_price, 'max' => 0);
                 $last_price = $price;
             }
             if ($this->min) {
                 CGlobal::$item_condition .= " AND ((price >= " . $this->min . " AND currency_id=1) OR ((price * " . CGlobal::$exchange . ") >= " . $this->min . " AND currency_id=2))";
             }
             if ($this->max) {
                 CGlobal::$item_condition .= " AND ((price < " . $this->max . " AND currency_id=1) OR ((price * " . CGlobal::$exchange . ") < " . $this->max . " AND currency_id=2))";
             }
         }
         if ($filter_str) {
             CGlobal::$item_condition .= " AND MATCH(filter_search) AGAINST ('{$filter_str}' IN BOOLEAN MODE)";
         }
         #############################################################################################################################################
         if ($this->price_cout_str) {
             $this->filter_price = array('name' => "Giới hạn theo giá (VNĐ)", 'filters' => array());
             $price_cout_arr = DB::fetch("SELECT " . $this->price_cout_str . " FROM item WHERE " . CGlobal::$item_condition);
             if ($filter_price) {
                 foreach ($filter_price as $fprice) {
                     $min = $fprice['min'];
                     $max = $fprice['max'];
                     if ($price_cout_arr[$min]) {
                         if ($min && $max) {
                             $link2 = "{$link}&min={$min}&max={$max}";
                             $name = AZLib::money($min) . " - " . AZLib::money($max);
                         } elseif (!$max) {
                             $link2 = "{$link}&min={$min}";
                             $name = "Trên " . AZLib::money($min);
                         } elseif (!$min) {
                             $link2 = "{$link}&max={$max}";
                             $name = "Dưới " . AZLib::money($max);
//.........这里部分代码省略.........
开发者ID:duynhan07,项目名称:elink,代码行数:101,代码来源:FilterMenu.php


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