Express.php 770 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace app\admin\controller;
  3. use app\admin\logic\ExpressLogic;
  4. use app\BaseController;
  5. use think\exception\ValidateException;
  6. use think\facade\Config;
  7. use think\facade\Validate;
  8. class Express extends BaseController
  9. {
  10. //列表
  11. public function list(){
  12. $param = $this->request->only(['page'=>1,'size'=>10,'express_code'=>'','express_name'=>'','mobile'=>'','status'=>''],'post');
  13. return ExpressLogic::list($param);
  14. }
  15. //启禁用
  16. public function status(){
  17. $param = $this->request->only(['id','status'],'post');
  18. $val = Validate::rule(Config::get('validate_rules.status'));
  19. if(!$val->check($param)) throw new ValidateException($val->getError());
  20. return ExpressLogic::status($param);
  21. }
  22. }