public function edit() { if (IS_POST) { if ($this->db->edit()) { View::success('操作成功', 'index'); } else { View::error($this->db->getError()); } } else { //商品分类 $cate = new \Admin\Model\ShopCate(); $cateData = $cate->getAll(); View::with('cateData', $cateData); //商品品牌 $brand = new \Admin\Model\ShopBrand(); $brandData = $brand->getAll(); View::with('brandData', $brandData); //获取图集信息 $pics = new \Admin\Model\Pics(); $picsData = $pics->getAll(); View::with('picsData', $picsData); //商品类型列表 $type = new \Admin\Model\ShopType(); $typeData = $type->getAll(); View::with('typeData', $typeData); //商品属性列表 $attr = new \Admin\Model\GoodsAttr(); $attrData = $attr->getAll(Q('goods_id')); View::with('attrData', $attrData); //读取商品信息 $field = $this->db->getOne(); View::with('field', $field)->make(); } }
public function edit() { if (IS_POST) { if ($this->db->edit()) { View::success('操作成功', 'index'); } else { View::error($this->db->getError()); } } else { //搜索页规格分类 $type = new \Admin\Model\ShopType(); $typeData = $type->getAll(); View::with('typeData', $typeData); $data = $this->db->getAll(); $field = $this->db->getOne(); View::with('data', $data)->with('field', $field)->make(); } }