getAll(array('info_id' => $id)); } return $result; } # 获取某个商品的sku商品列表 public function getList($info, &$data) { if ($info['spec_type'] == 2) { $where['info_id'] = $info['id']; $sku = Dever::db('product/info_sku')->select($where); if ($sku) { foreach ($sku as $k => $v) { $copy = $info; $key = str_replace('-', ',', $v['key']); $spec = Dever::db('product/info_spec_value')->getGroupData(array('ids' => $key)); if ($spec) { $copy['name'] .= '-' . $spec['name']; $copy['id'] .= '-' . $v['key']; if (isset($copy['value'])) { $copy['value'] = $copy['id']; } } $data[] = $copy; } } } else { $data[] = $info; } return $data; } # 获取基本信息列表 public function getData($info_id, $sku_id = false) { $where['info_id'] = $info_id; if ($sku_id) { $where['id'] = $sku_id; } $sku = Dever::db('product/info_sku')->select($where); return $sku; if ($sku) { foreach ($sku as $k => $v) { $key = str_replace('-', ',', $v['key']); $spec = Dever::db('product/info_spec_value')->getData(array('ids' => $key)); if ($spec) { $copy['name'] .= '-' . $spec['name']; $copy['id'] .= '-' . $v['key']; if (isset($copy['value'])) { $copy['value'] = $copy['id']; } } $data[] = $copy; } } return $data; } }