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


PHP Catalog::getAdditionalgood方法代码示例

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


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

示例1: sameprice

 function sameprice()
 {
     Funcs::escapeGet();
     if ($_GET) {
         $same_price = Catalog::getAdditionalgood($_GET['id'], 'better_for_same_price');
         $data = array();
         foreach ($same_price as $sid) {
             $data['list'][] = Catalog::getOne($sid['id']);
         }
         View::$layout = 'popup';
         View::render('popup/sameprice', $data);
     }
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:13,代码来源:PopupController.php

示例2: __construct

 function __construct()
 {
     if (Funcs::$uri[1] == '') {
         $tree = Tree::getTreeByUrl();
         Funcs::setMeta($tree);
         $basket = new Basket();
         $tree['order'] = $basket->getOrder();
         if ($tree['order']['count'] > 0) {
             /*if($_SESSION['iuser']){
             			$adds=$_SESSION['iuser']['options']['address'];
             			if($_POST['adds'])$adds=$_POST['adds'];
             			if(is_numeric($adds)){
             				$tree['reg']=Cabinet::getOneAdds($adds);
             			}
             			$tree['adds']=$adds;
             		}*/
             $accessories = array();
             $salegoods = array();
             foreach ($tree['order']['goods'] as $key => $item) {
                 $accessories[] = Catalog::getAdditionalgood($key, 'accessories');
             }
             foreach ($accessories as $i => $items) {
                 foreach ($items as $ii => $item) {
                     $salegoods[] = $item['tree'];
                     if (key_exists($item['tree'], $tree['order']['goods'])) {
                         unset($accessories[$i][$ii]);
                     }
                 }
             }
             $tree['order']['accessories'] = $accessories;
             $tree['order']['salegoods'] = $salegoods;
             View::render('basket/basket', $tree);
         } else {
             View::render('basket/empty', $tree);
         }
     } elseif (count($_SESSION['goods']) == 0 && Funcs::$uri[1] != 'addtobasket' && $_SESSION['orderId'] == '' && Funcs::$uri[1] != 'addlisttobasket' && Funcs::$uri[1] != 'getneworder' && Funcs::$uri[1] != 'success' && Funcs::$uri[1] != 'fail') {
         $this->redirect('/basket/');
     }
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:39,代码来源:BasketController.php

示例3: __construct

 function __construct()
 {
     if ($_POST) {
         DB::escapePost();
         if (isset($_POST['report'])) {
             $tree = Tree::getTreeByUrl();
             $href = Catalog::getPathToTree($tree['id']);
             Catalog::setReport($tree['id']);
             View::$layout = 'empty';
             View::render('site/redirect', array('href' => $href, 'text' => 'Отзыв успешно добавлен!'));
             die;
         }
         if (isset($_POST['subscribe'])) {
             $tree = Tree::getTreeByUrl();
             $href = Tree::getPathToTree($tree['id']);
             Catalog::setSubscribe($tree['id']);
             die;
         }
     } else {
         DB::escapeGet();
         if (Funcs::$uri[1] == '' && isset($_GET['hits']) && Funcs::$uri[1] != 'setratingstars' && Funcs::$uri[1] != 'delreport') {
             $tree = Tree::getTreeByUrl();
             Funcs::setMeta($tree);
             $tree = Catalog::getHitCatalog($tree['id']);
             View::render('catalog/catalog', array('list' => $tree, 'name' => 'Все хиты'));
         } elseif (Funcs::$uri[1] == '' && Funcs::$uri[1] != 'setratingstars' && Funcs::$uri[1] != 'delreport') {
             $tree = Tree::getTreeByUrl();
             Funcs::setMeta($tree);
             $tree = Catalog::getPreviewCatalog($tree['id']);
             //View::render('catalog/catalog',array('list'=>$tree));
         } elseif (Funcs::$uri[1] != 'setratingstars' && Funcs::$uri[1] != 'delreport') {
             $tree = Tree::getTreeByUrl(Funcs::$uri[0]);
             if ($tree['info']['type'] == 'struct') {
                 $temp = Catalog::getInnerListPagi($tree['id']);
                 $tree['list'] = $temp['list'];
                 $tree['vendors'] = Catalog::getVendors($tree['id'], $tree['list']);
                 //$tree['options']['available']=array();
                 //$tree['options']['catalog']=Catalog::getType($tree['id'],$tree['parent']);
                 //$tree['options']['vendors']=Catalog::getVendors($tree['id']);
                 if ($_GET['ve']) {
                     $tree['name'] = $tree['seo_description'] = $tree['name'] . ' ' . Funcs::$referenceId['vendor'][$_GET['ve']]['name'];
                     Funcs::setMeta($tree);
                 }
                 $tree['options']['price'] = Catalog::getValuesPrice($tree['id']);
                 $tree['options']['price2'] = Catalog::getLink('pricelink');
                 //$tree['options']['rating']=array();
                 Funcs::setMeta($tree);
                 $tree['quantity'] = $temp['quantity'];
                 if ($_GET['ajax'] == 'act') {
                     print $tree['quantity'];
                     die;
                 } else {
                     View::render('catalog/list', $tree);
                 }
             } else {
                 Funcs::setMeta($tree, 'goods');
                 $id = $tree['id'];
                 $tree = Catalog::getOne($id);
                 Catalog::setPopularity($id);
                 $tree['reports'] = Catalog::getReports($id);
                 Catalog::setViewed($id);
                 $tree['same_price'] = Catalog::getAdditionalgood($id, 'better_for_same_price');
                 $tree['accessories'] = Catalog::getAdditionalgood($id, 'accessories');
                 //$tree['similargoods']=Catalog::getAdditionalgood($id,'similargoods');
                 $tree['similargoods'] = Catalog::getMore($tree['id'], $tree['parent']);
                 $tree['reportme'] = Catalog::getReport($tree['id']);
                 if (isset($_GET['print'])) {
                     View::$layout = 'empty';
                     View::render('catalog/print', $tree);
                     die;
                 } else {
                     View::render('catalog/one', $tree);
                 }
             }
         }
     }
 }
开发者ID:sov-20-07,项目名称:billing,代码行数:77,代码来源:CatalogController.php


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