123456789101112131415161718192021222324252627282930 |
- <?php
- namespace Product\Lib;
- use Dever;
- class Spec
- {
- # 获取当前的规格
- public function get_api()
- {
- $id = Dever::input('id');
- return $this->getData($id);
- }
- # 获取基本信息列表
- public function getData($info_id, $method = 'getAll')
- {
- $result = array();
- if ($info_id) {
- $result = Dever::db('product/info_spec')->$method(array('info_id' => $info_id));
- if ($result) {
- foreach ($result as $k => $v) {
- $result[$k]['child'] = Dever::db('product/info_spec_value')->$method(array('info_id' => $info_id, 'spec_id' => $v['id']));
- }
- }
- }
- return $result;
- }
- }
|