123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace app\mobile\controller;
- use app\BaseController;
- use app\mobile\logic\GoodLogic;
- use think\exception\ValidateException;
- use think\facade\Config;
- use think\facade\Validate;
- //商品
- class Good extends BaseController
- {
- //列表
- public function goodList()
- {
- $param = $this->request->only(['page' => 1, 'size' => 10], 'post');
- return GoodLogic::goodList($param);
- }
- //详情
- public function goodInfo()
- {
- $code = $this->request->post('code', '');
- $val = Validate::rule(Config::get('validate_rules.goodInfo'));
- if (!$val->check(['code' => $code])) throw new ValidateException($val->getError());
- return GoodLogic::goodInfo($code);
- }
- }
|