Example #1
0
 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);
     break;
 case 'post':
     //echo 'post';
     $conditionArray = array('status' => 'Y', 'isPost' => 'Y');
     $targetArray = array("ID", "name", "realPrice", "label", "defaultImg", "selledNum", 'createTime', 'isDiscount', 'isPromotion', 'isPost');
     echo $vpd->queryJson($conditionArray, $targetArray);
     break;
 case 'promotion':
     $conditionArray = array('status' => 'Y', 'isPromotion' => 'Y');
     $targetArray = array("ID", "name", "realPrice", "label", "defaultImg", "selledNum", 'createTime', 'isDiscount', 'isPromotion', 'isPost');
     echo $vpd->queryJson($conditionArray, $targetArray);
     break;
 case 'discount':
     $conditionArray = array('status' => 'Y', 'isDiscount' => 'Y');
     $targetArray = array("ID", "name", "realPrice", "label", "defaultImg", "selledNum", 'createTime', 'isDiscount', 'isPromotion', 'isPost');