w2096 2016-05-27 21:22:17 4018次浏览 4条回复 0 0 0

namespace app\modules\controllers; use Yii;`` 这里输入代码

use yii\helpers\Url;
use yii\web\Controller;
use app\modules\models;
use app\modules\models\OauthOpenid;
class SalesStatisticsControllerController extends Controller
{
    public $title ;
    public function beforeAction($action)
    {
        return parent::beforeAction($action); // TODO: Change the autogenerated stub
        $session = Yii::$app->session;
        $wx = new Wx();
        if($wx ->is_weixin()) {
            if (!empty($session['TokeyOpid']['openid'])) {
                $model = new OauthOpenid();
                $oauth = $model->findOne(['openid' => $session['TokeyOpid']['openid']]);
                if (empty($oauth)) {
                    return $this->redirect(Url::to(['login']));
                }
            }
        }else {
            $model = new UdbUser();
            $user = $model->findOne(['user_name' => $session['user']['user_name']])->toArray();
            if(empty($user)) {
                return $this->redirect(Url::to(['login']));
            }
        }
        return true;
    }

    public function actionIndex(){
        $this->title = '';
//        $this->render('');

    }
}
http://127.0.0.1/index.php?r=formes/trafficstatistics/index 为什么找出现404呀
这样http://127.0.0.1/index.php?r=formes/trafficStatistics/index
还有http://127.0.0.1/index.php?r=formes/TrafficStatistics/index
都不行`
您需要登录后才可以回复。登录 | 立即注册