/** * 修改商品信息 * @param [type] $cat_id 商品ID * @return [type] [description] */ public function editAction() { $cat_id = $_GET['id']; $modle_name = new CategoryModel(); $curr_cat = $modle_name->getById($cat_id); $cat_list = $modle_name->getList(0); require CURR_VIEW_DIR . 'categoryEdit.html'; }
static function getById($cid) { if (!$cid) { return false; } $model = new CategoryModel(); $result = $model->getById($cid); if (!$result) { return false; } return $result[0]; }