/** * 返回更新国家信息 * @access public */ function update() { $id = get_post_value('id'); $field = array('category_2.category_1_id', 'category_2.category_2_id', 'category_2.category_2_cn', 'category_2.category_2_th', 'category_3.category_3_id', 'category_3.category_3_cn', 'category_3.category_3_th', 'category_3.category_3_url', 'category_3.orders', 'category_3.status', 'category_3.created', 'category_3.created_name', 'category_3.audit_name', 'category_3.start_time', 'category_3.end_time'); $m = new Category(); $m->clear(); $m->setField($field); $m->setTable('vcb_product_category_3 AS category_3'); $m->setJoin('vcb_product_category_2 as category_2', 'category_2.category_2_id=category_3.category_2_id'); $m->setWhere('category_3.status', '!=', '60000'); $m->setWhere('category_3.category_3_id', '=', $id); $data = $m->select(); $this->assign('data', $data); $data = $m->getCategory_2($data[0]['category_1_id']); $this->assign('category_2', $data); }
function get_category_2() { $category_1 = get_post_value('category_1'); $m = new Category(); $data = $m->getCategory_2($category_1); $this->assign('json', $data); $this->setReturnType('json'); }
function get_category_2() { $m = new Category(); $data = $m->getCategory_2(); return $data; }