2019-04-02 13:46:30 +08:00

89 lines
2.2 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | framework
// +----------------------------------------------------------------------
// | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
// +----------------------------------------------------------------------
// | 官方网站: http://framework.thinkadmin.top
// +----------------------------------------------------------------------
// | 开源协议 ( https://mit-license.org )
// +----------------------------------------------------------------------
// | github开源项目https://github.com/zoujingli/ThinkAdmin
// +----------------------------------------------------------------------
namespace app\store\controller;
use library\Controller;
/**
* Class GoodsCate
* @package app\store\controller
*/
class GoodsCate extends Controller
{
/**
* 绑定数据表
* @var string
*/
protected $table = 'StoreGoodsCate';
/**
* @return mixed
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public function index()
{
$this->title = '商品分类管理';
return $this->_query($this->table)->like('title')->equal('status')->order('sort asc,id desc')->page();
}
/**
* 添加商品分类信息
* @return mixed
*/
public function add()
{
$this->title = '添加商品分类';
return $this->_form($this->table, 'form');
}
/**
* 编辑商品分类信息
* @return mixed
*/
public function edit()
{
$this->title = '编辑商品分类';
return $this->_form($this->table, 'form');
}
/**
* 商品分类禁用
*/
public function forbid()
{
$this->_save($this->table, ['status' => '0']);
}
/**
* 商品分类禁用
*/
public function resume()
{
$this->_save($this->table, ['status' => '1']);
}
/**
* 删除商品分类
*/
public function del()
{
$this->_delete($this->table);
}
}