123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- <?php
- namespace app\abutment\controller;
- use app\abutment\logic\Index as IndexLogic;
- use app\BaseController;
- use think\exception\ValidateException;
- use think\facade\Config;
- use think\facade\Validate;
- class Index extends BaseController
- {
-
- public function getPlatformList()
- {
- $param = $this->request->filter('trim')->only(['keyword' => '', 'page' => 1, 'size' => 15], 'post');
- $val = Validate::rule(Config::get('validate_rules.common'));
- if (!$val->check($param)) throw new ValidateException($val->getError());
- return IndexLogic::getPlatformList($param['keyword'], $param['page'], $param['size']);
- }
-
- public function getCatList()
- {
- $param = $this->request->filter('trim')->only(['keyword' => '', 'pid' => 0], 'post');
- $val = Validate::rule(Config::get('validate_rules.getCatList'));
- if (!$val->check($param)) throw new ValidateException($val->getError());
- return IndexLogic::getCatList($param['keyword'], $param['pid']);
- }
-
- public function getBrandList()
- {
- $param = $this->request->filter('trim')->only(['keyword' => '', 'page' => 1, 'size' => 15], 'post');
- $val = Validate::rule(Config::get('validate_rules.common'));
- if (!$val->check($param)) throw new ValidateException($val->getError());
- return IndexLogic::getBrandList($param['keyword'], $param['page'], $param['size']);
- }
-
- public function getUnitList()
- {
- $param = $this->request->filter('trim')->only(['keyword' => '', 'page' => 1, 'size' => 15], 'post');
- $val = Validate::rule(Config::get('validate_rules.common'));
- if (!$val->check($param)) throw new ValidateException($val->getError());
- return IndexLogic::getUnitList($param['keyword'], $param['page'], $param['size']);
- }
-
- public function getSpecsTitleList()
- {
- $param = $this->request->filter('trim')->only(['keyword' => ''], 'post');
- $val = Validate::rule(Config::get('validate_rules.keyword'));
- if (!$val->check($param)) throw new ValidateException($val->getError());
- return IndexLogic::getSpecsTitleList($param['keyword']);
- }
-
- public function getSpecsValueByTitleList()
- {
- $param = $this->request->filter('trim')->only(['spec_id'], 'post');
- $val = Validate::rule(Config::get('validate_rules.getSpecsValueByTitleList'));
- if (!$val->check($param)) throw new ValidateException($val->getError());
- return IndexLogic::getSpecsValueByTitleList($param['spec_id']);
- }
-
- public function getAreaList()
- {
- $param = $this->request->filter('trim')->only(['level' => 1, 'pid_code' => ''], 'post');
- $val = Validate::rule(Config::get('validate_rules.getAreaList'));
- if (!$val->check($param)) throw new ValidateException($val->getError());
- return IndexLogic::getAreaList($param['level'], $param['pid_code']);
- }
-
- public function getCompanyNoList()
- {
- $param = $this->request->filter('trim')->only(['keyword' => ''], 'post');
- $val = Validate::rule(Config::get('validate_rules.keyword'));
- if (!$val->check($param)) throw new ValidateException($val->getError());
- return IndexLogic::getCompanyNoList($param['keyword']);
- }
- }
|