public function add(){ $goods = D('Goods'); //两个逻辑,收集表单,展示表单 if(!empty($_POST)){ $goods->add($_POST); }else{ $this ->display(); }