From 86ad22c3f6fb4ee0ce81aabed99f7f4a2e6fae1f Mon Sep 17 00:00:00 2001 From: Anyon Date: Mon, 2 Apr 2018 14:54:54 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E4=BF=AE=E6=94=B9=E5=95=86?= =?UTF-8?q?=E5=9F=8E=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/goods/controller/Cate.php | 5 ----- application/goods/controller/Product.php | 4 +--- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/application/goods/controller/Cate.php b/application/goods/controller/Cate.php index ad9121d5a..51787d7f9 100644 --- a/application/goods/controller/Cate.php +++ b/application/goods/controller/Cate.php @@ -45,8 +45,6 @@ class Cate extends BasicAdmin */ public function index() { - $brands = Db::name('GoodsBrand')->where(['status' => '1'])->order('sort asc,id asc')->select(); - $this->assign('brands', $brands); $this->title = '产品分类'; $db = Db::name($this->table)->where(['is_deleted' => '0']); return parent::_list($db->order('sort asc,id asc'), false); @@ -100,9 +98,6 @@ class Cate extends BasicAdmin protected function _form_filter(&$vo) { if ($this->request->isGet()) { - // 读取所有品牌列表 - $brands = Db::name('GoodsBrand')->where(['status' => '1'])->order('sort asc,id asc')->select(); - $this->assign('brands', $brands); // 读取上级分类 $where = ['status' => '1', 'is_deleted' => '0']; $_cates = (array)Db::name($this->table)->where($where)->order('sort desc,id desc')->select(); diff --git a/application/goods/controller/Product.php b/application/goods/controller/Product.php index 482f666fc..bee714380 100644 --- a/application/goods/controller/Product.php +++ b/application/goods/controller/Product.php @@ -122,8 +122,7 @@ class Product extends BasicAdmin $goods_id = $this->request->get('id'); $goods = Db::name($this->table)->where(['id' => $goods_id, 'is_deleted' => '0'])->find(); empty($goods) && $this->error('需要编辑的产品不存在!'); - $specWhere = ['goods_id' => $goods_id, 'is_deleted' => '0']; - $goods['list'] = Db::name('GoodsList')->where($specWhere)->select(); + $goods['list'] = Db::name('GoodsList')->where(['goods_id' => $goods_id, 'is_deleted' => '0'])->select(); $this->_form_assign(); return $this->fetch('form', ['vo' => $goods, 'title' => '编辑产品']); } @@ -160,7 +159,6 @@ class Product extends BasicAdmin */ protected function _form_assign() { - // 信息 list($where, $order) = [['status' => '1', 'is_deleted' => '0'], 'sort asc,id desc']; $specs = (array)Db::name('GoodsSpec')->where($where)->order($order)->select(); $brands = (array)Db::name('GoodsBrand')->where($where)->order($order)->select();