<?php namespace app\api\controller; use think\Controller; class Base extends Controller { protected $middleware = ['Auth']; protected $userId; protected $orgId; protected function initialize() { parent::initialize(); $this->userId = input('userId/d',0); $this->orgId = input('orgId/d',0); // $this->orgId = $this->orgId <= 0 ? 3 : $this->orgId; } }