* One Park Place, Elmira College, NY, 14901, USA * * QQ Group: 329673575 * BBS: bbs.ecmobile.cn * Fax: +86-10-6561-5510 * Mail: info@geek-zoo.com */ require EC_PATH . '/includes/init.php'; include_once EC_PATH . '/includes/lib_transaction.php'; $categoryGoods = array(); $category = get_categories_tree(); if (!empty($category)) { foreach ($category as $key => $val) { $goods = array(); $children = get_children($val['id']); $goods = gz_get_category_recommend_goods('best', $children); if (count($goods) > 3) { $goods = array_slice($goods, 0, 3); } $ngoods = array(); if (!empty($goods)) { foreach ($goods as $k => $v) { $ngoods[] = array('id' => $v['id'], 'name' => $v['name'], 'market_price' => $v['market_price'], 'shop_price' => $v['shop_price'], 'promote_price' => $v['promote_price'], 'brief' => $v['brief'], 'img' => array('thumb' => API_DATA('PHOTO', $v['goods_img']), 'url' => API_DATA('PHOTO', $v['original_img']), 'small' => API_DATA('PHOTO', $v['thumb']))); } } $categoryGoods[] = array('id' => $val['id'], 'name' => $val['name'], 'goods' => $ngoods); } } // print_r($categoryGoods);exit; function gz_get_category_recommend_goods($type = '', $cats = '', $brand = 0, $min = 0, $max = 0, $ext = '') {
function GZ_guess_love() { include_once GZ_PATH . 'includes/lib_transaction.php'; $categoryGoods = array(); $category = get_categories_tree(); if (!empty($category)) { foreach ($category as $key => $val) { $goods = array(); $children = get_children($val['id']); $goods = gz_get_category_recommend_goods('best', $children); if (count($goods) > 7) { $goods = array_slice($goods, 0, 7); } $ngoods = array(); if (!empty($goods)) { foreach ($goods as $k => $v) { $ngoods[] = array('goods_id' => $v['id'], 'name' => $v['name'], 'market_price' => $v['market_price'], 'shop_price' => $v['shop_price'], 'promote_price' => $v['promote_price'], 'brief' => $v['brief'], 'img' => array('thumb' => API_DATA('PHOTO', $v['goods_img']), 'url' => API_DATA('PHOTO', $v['original_img']), 'small' => API_DATA('PHOTO', $v['thumb']))); } } $categoryGoods[] = array('id' => $val['id'], 'ico' => API_DATA('PHOTO', 'data/cat_ico/' . $val['ico']), 'desc' => $val['desc'], 'name' => $val['name'], 'goods' => $ngoods); } } return $categoryGoods; }