123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?php
- namespace app\admin\controller\package;
- use app\admin\controller\BaseController;
- use app\admin\server\package\PackageGoodsCategoryServer;
- use app\admin\server\package\PackageGoodsServer;
- class PackageGoodsCategory extends BaseController
- {
- /**
- * Notes:获取产品分类
- * @return \support\Response
- * User: QJF
- * Date: 2022/9/21
- */
- public function getPackageGoodsCategoryList()
- {
- [$page, $limit] = $this->getPage();
- $keywords = $this->request->get('keywords');
- $result = PackageGoodsCategoryServer::getPackageGoodsCategoryList($page, $limit, $keywords);
- return json_success($result, '成功');
- }
- /**
- * Notes:添加产品分类
- * @return \support\Response
- * User: QJF
- * Date: 2022/9/21
- *
- */
- public function addPackageGoodsCategory()
- {
- $param = $this->request->post();
- $this->validateCheck('package\PackageGoodsCategoryValidate',
- [
- 'category_name' => $param['category_name'],
- 'category_title' => $param['category_title'],
- 'category_num' => $param['category_num'],
- ],
- 'add');
- $result = PackageGoodsCategoryServer::insertPackageGoodsCategory($param);
- return json_success($result, '添加成功');
- }
- /**
- * Notes:修改权产品分类
- * @return \support\Response
- * User: QJF
- * Date: 2022/9/19
- */
- public function updatePackageGoodsCategory()
- {
- $param = $this->request->post();
- $this->validateCheck('package\PackageGoodsCategoryValidate',
- [
- 'category_id' => $param['category_id'],
- 'category_name' => $param['category_name'],
- 'category_title' => $param['category_title'],
- 'category_num' => $param['category_num'],
- ], 'update');
- $result = PackageGoodsCategoryServer::updatePackageGoodsCategory($param);
- return json_success($result, '修改成功');
- }
- /**
- * Notes:删除权益包
- * @return \support\Response
- * User: QJF
- * Date: 2022/9/19
- */
- public function delPackageGoodsCategory()
- {
- $category_id = $this->request->get('category_id');
- $this->validateCheck('package\PackageGoodsCategoryValidate', ['category_id' => $category_id], 'del');
- $result = PackageGoodsCategoryServer::delPackageGoodsCategory($category_id);
- if ($result){
- return json_success($result, '成功');
- }else{
- throw new \Exception('失败!');
- }
- }
- /**
- * Notes:查看权益包详情
- * @return \support\Response
- * User: QJF
- * Date: 2022/9/19
- */
- public function infoPackageGoodsCategory()
- {
- $category_id = $this->request->get('category_id');
- $this->validateCheck('package\PackageGoodsCategoryValidate', ['category_id' => $category_id], 'info');
- $result = PackageGoodsCategoryServer::infoPackageCategory($category_id);
- if ($result){
- return json_success($result, '获取成功');
- }else{
- throw new \Exception('获取失败!');
- }
- }
- }
|