<img src="../shop-images/ti-pic<?php echo 1; ?> .png" /> <div id="hm_product_ti_word" ><span>查询结果</span></div> <a href="javascript:void(0)" id="hm_product_ti_more" class="shop_home_more"></a> <hr id="hm_product_ti_line" /> <div class="hm_products_infor"> <ul> <?php //$lastResult = $result; //$lastResult = array_slice($lastResult,4,1); //var_dump($lastResult); //$lengthss = count($result); //var_dump($result); $vpm = new VProduct(); $img = new Images(); //根据子类别ID($child['ID'])获取产品信息 $conditionArray = array("status" => "Y", "name" => $_GET['name']); $targetArray = array("ID", "name", "realPrice", "label", "defaultImg"); $productArray = $vpm->muddyQuery($conditionArray, $targetArray); //var_dump($productArray); $lengts = count($productArray); $num = 0; foreach ($productArray as $item2) { if ($num >= 36) { break; } ?> <li><a href="shop-info.php?id=<?php
</div> </div> <!--php开始--> <?php require_once "../admin/web.config.php"; require_once $realLibPath . "model/v_categoryPro.model.php"; require_once $realLibPath . "model/v_product.model.php"; require_once $realLibPath . "model/images.model.php"; //获取所有类别 $vcPro = new VCategoryPro(); $result = $vcPro->query(array("status" => "Y", "parentID" => '0'), array("ID", "name")); $lastResult = $result; $lastResult = array_slice($lastResult, 4, 1); //var_dump($lastResult); $result = array_slice($result, 0, 4); $vpm = new VProduct(); $img = new Images(); //根据类别id获取所有商品信息 foreach ($result as $item) { //获取所有子类信息 $childIdArray = $vcPro->getChildIDArray($item['ID']); ?> <!--开始混便html--> <div id='pro_<?php echo $item['ID']; ?> '> <div id="hm_product"> <img src="../shop-images/ti-pic<?php echo $item['ID']; ?>
<?php require_once "../model/v_product.model.php"; if (!$_POST) { echo "参数未传递!"; } $vp = new VProduct(); echo $vp->handlePost($_POST);
<?php require_once "../admin/web.config.php"; require_once $realLibPath . "model/v_product.model.php"; require_once $realLibPath . "model/v_categoryPro.model.php"; $vcp = new VCategoryPro(); $vpd = new VProduct(); $option = $_POST['option']; switch ($option) { case 'search': //echo 'search'; $conditionArray = array('status' => 'Y', 'name' => $_POST['name']); $targetArray = array("ID", "name", "realPrice", "label", "defaultImg", "selledNum", 'createTime', 'isDiscount', 'isPromotion', 'isPost'); echo $vpd->muddyQueryJson($conditionArray, $targetArray); break; case 'parentCat': //echo 'parentCat'; $childIDArray = $vcp->getChildIDArray($_POST['catID']); $result = array(); foreach ($childIDArray as $item) { $conditionArray = array('status' => 'Y', 'category' => $item['ID']); $targetArray = array("ID", "name", "realPrice", "label", "defaultImg", "selledNum", 'createTime', 'isDiscount', 'isPromotion', 'isPost'); $result = array_merge($result, $vpd->query($conditionArray, $targetArray)); } echo json_encode($result); break; case 'childCat': //echo 'childCat'; $conditionArray = array('status' => 'Y', 'category' => $_POST['catID']); $targetArray = array("ID", "name", "realPrice", "label", "defaultImg", "selledNum", 'createTime', 'isDiscount', 'isPromotion', 'isPost'); echo $vpd->queryJson($conditionArray, $targetArray);