mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-09-05 23:59:46 +08:00
[更新]修改商城模块
This commit is contained in:
parent
5eedad6efc
commit
86ad22c3f6
@ -45,8 +45,6 @@ class Cate extends BasicAdmin
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$brands = Db::name('GoodsBrand')->where(['status' => '1'])->order('sort asc,id asc')->select();
|
|
||||||
$this->assign('brands', $brands);
|
|
||||||
$this->title = '产品分类';
|
$this->title = '产品分类';
|
||||||
$db = Db::name($this->table)->where(['is_deleted' => '0']);
|
$db = Db::name($this->table)->where(['is_deleted' => '0']);
|
||||||
return parent::_list($db->order('sort asc,id asc'), false);
|
return parent::_list($db->order('sort asc,id asc'), false);
|
||||||
@ -100,9 +98,6 @@ class Cate extends BasicAdmin
|
|||||||
protected function _form_filter(&$vo)
|
protected function _form_filter(&$vo)
|
||||||
{
|
{
|
||||||
if ($this->request->isGet()) {
|
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'];
|
$where = ['status' => '1', 'is_deleted' => '0'];
|
||||||
$_cates = (array)Db::name($this->table)->where($where)->order('sort desc,id desc')->select();
|
$_cates = (array)Db::name($this->table)->where($where)->order('sort desc,id desc')->select();
|
||||||
|
@ -122,8 +122,7 @@ class Product extends BasicAdmin
|
|||||||
$goods_id = $this->request->get('id');
|
$goods_id = $this->request->get('id');
|
||||||
$goods = Db::name($this->table)->where(['id' => $goods_id, 'is_deleted' => '0'])->find();
|
$goods = Db::name($this->table)->where(['id' => $goods_id, 'is_deleted' => '0'])->find();
|
||||||
empty($goods) && $this->error('需要编辑的产品不存在!');
|
empty($goods) && $this->error('需要编辑的产品不存在!');
|
||||||
$specWhere = ['goods_id' => $goods_id, 'is_deleted' => '0'];
|
$goods['list'] = Db::name('GoodsList')->where(['goods_id' => $goods_id, 'is_deleted' => '0'])->select();
|
||||||
$goods['list'] = Db::name('GoodsList')->where($specWhere)->select();
|
|
||||||
$this->_form_assign();
|
$this->_form_assign();
|
||||||
return $this->fetch('form', ['vo' => $goods, 'title' => '编辑产品']);
|
return $this->fetch('form', ['vo' => $goods, 'title' => '编辑产品']);
|
||||||
}
|
}
|
||||||
@ -160,7 +159,6 @@ class Product extends BasicAdmin
|
|||||||
*/
|
*/
|
||||||
protected function _form_assign()
|
protected function _form_assign()
|
||||||
{
|
{
|
||||||
// 信息
|
|
||||||
list($where, $order) = [['status' => '1', 'is_deleted' => '0'], 'sort asc,id desc'];
|
list($where, $order) = [['status' => '1', 'is_deleted' => '0'], 'sort asc,id desc'];
|
||||||
$specs = (array)Db::name('GoodsSpec')->where($where)->order($order)->select();
|
$specs = (array)Db::name('GoodsSpec')->where($where)->order($order)->select();
|
||||||
$brands = (array)Db::name('GoodsBrand')->where($where)->order($order)->select();
|
$brands = (array)Db::name('GoodsBrand')->where($where)->order($order)->select();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user