[更新]修改商城模块

This commit is contained in:
Anyon 2018-04-02 14:54:54 +08:00
parent 5eedad6efc
commit 86ad22c3f6
2 changed files with 1 additions and 8 deletions

View File

@ -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();

View File

@ -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();