update($update); } } public function updateCategory($id, $name, $data) { $info = Dever::param('category', $data); if ($info && $info != -1) { $update['top_category_id'] = $info[0]; $num = count($info)+1; $update['level'] = $num; $parent = Dever::param('category_id', $data); $child = Dever::db('product/category')->one(array('category_id' => $id)); if (!$child) { $update['level'] = -1; } Dever::db('product/category')->update(array('where_id' => $parent, 'level' => $num - 1)); } else { $update['level'] = 1; $update['top_category_id'] = -1; } if (isset($update)) { $update['where_id'] = $id; Dever::db('product/category')->update($update); } } /** * 更新属性信息 * * @return mixed */ public function updateAttr($id, $name, $data) { return; $is_sell = Dever::param('is_sell', $data); if ($is_sell > 1) { $update['type'] = 11; } if (isset($update)) { $update['where_id'] = $id; Dever::db('product/category_attr')->update($update); } } public function searchProduct_api() { $where = array(); $cate = Dever::input('cate'); if ($cate) { $where['cate_id'] = $cate; } $id = Dever::input('where_id'); if ($id) { $where['id_no'] = $id; } $data = Dever::search('product/info', $where); if ($data) { $old = $data; $data = array(); foreach ($old as $k => $v) { Dever::load('product/lib/sku')->getList($v, $data); } } return $data; } }