コード例 #1
0
ファイル: productcat.php プロジェクト: lxthien/batdongsan
 /**
  * Productcat::getSpec()
  * 
  * get all the productCategory's specification (group include)
  * @return void
  */
 function getSpec()
 {
     $productCatSpec = new productcatspec();
     $productCatSpec->where("productcat_id", $this->id);
     $productCatSpec->order_by("position", 'asc');
     $productCatSpec->include_related("productgenspec", "*", TRUE, TRUE);
     $productCatSpec->get_iterated();
     return $productCatSpec;
 }
コード例 #2
0
ファイル: productcats.php プロジェクト: lxthien/batdongsan
 function loadSpecInfo($specId)
 {
     $productCatSpec = new productcatspec();
     $productCatSpec->where("id", $specId);
     $productCatSpec->include_related("productgenspec", "*", TRUE, TRUE);
     $productCatSpec->get();
     $dis['name'] = $productCatSpec->productgenspec->name;
     $dis['description'] = $productCatSpec->productgenspec->description;
     $dis['isGroup'] = $productCatSpec->productgenspec->isGroup;
     $dis['parentcat_id'] = $productCatSpec->productgenspec->parentcat_id;
     $dis['parentcatName'] = $productCatSpec->productgenspec->parentcat->name;
     $dis['id'] = $productCatSpec->id;
     $dis['specElementType'] = $productCatSpec->productgenspec->type;
     header('Content-type: application/json');
     echo json_encode($dis);
     exit;
 }