<commit_before><?php

namespace app\modules\shop\controllers\m;

use yii;
use app\modules\api\models\common\WechatUser;
use app\core\helpers\ArrayHelper;

class DefaultController extends \app\core\web\MController
{
    public function beforeAction($action)
    {

        echo $action->id;die;
        if (parent::beforeAction($action)){
            $this->initWechat();
            $session = Yii::$app->getSession();

            $wechat_user = $session->get('wechat.wechat_user');

            $this->wechat_user = WechatUser::findOne($wechat_user->id);
            if ($session->has('wechat.sys_user')) {
                $this->sys_user = $session->get('wechat.sys_user');
            }
            return true;
        }
    }
	/**
	 * @name 商品首页
	 */
	public function actionIndex()
	{
		return $this->render('index');
	}

	/**
	 * @name 商品详情
	 */
	public function actionView()
	{
		$this->layout = "@app/modules/m/views/layouts/nofooter.php";
		return $this->render('view', [
			'get' => \Yii::$app->request->get()
		]);
	}

	/**
	 * @name 购物车
	 */
	public function actionCart()
	{
		$this->layout = "@app/modules/m/views/layouts/nofooter.php";
		return $this->render('cart', [
            'wechat' => ArrayHelper::toArray($this->wechat_user)
        ]);
	}
}<commit_msg>goods<commit_after><?php

namespace app\modules\shop\controllers\m;

use yii;
use app\modules\api\models\common\WechatUser;
use app\core\helpers\ArrayHelper;

class DefaultController extends \app\core\web\MController
{
    public function beforeAction($action)
    {
        if (parent::beforeAction($action)){

//            if (!in_array($action->id, ['view','cart'])) {
//                return true;
//            }

            $this->initWechat();
            $session = Yii::$app->getSession();

            $wechat_user = $session->get('wechat.wechat_user');

            $this->wechat_user = WechatUser::findOne($wechat_user->id);
            if ($session->has('wechat.sys_user')) {
                $this->sys_user = $session->get('wechat.sys_user');
            }
            return true;
        }

        return false;
    }
	/**
	 * @name 商品首页
	 */
	public function actionIndex()
	{
		return $this->render('index', [
            'wechat' => ArrayHelper::toArray($this->wechat_user)
        ]);
	}

	/**
	 * @name 商品详情
	 */
	public function actionView()
	{
		$this->layout = "@app/modules/m/views/layouts/nofooter.php";
		return $this->render('view', [
			'get' => \Yii::$app->request->get(),
            'wechat' => ArrayHelper::toArray($this->wechat_user)
		]);
	}

	/**
	 * @name 购物车
	 */
	public function actionCart()
	{
		$this->layout = "@app/modules/m/views/layouts/nofooter.php";
		return $this->render('cart', [
            'wechat' => ArrayHelper::toArray($this->wechat_user)
        ]);
	}
}
{'fraction_non_alphanumeric': 0.17944126074498568, 'fraction_numerical': 0.0, 'mean_word_length': 2.4738805970149254, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6979791', 'n_tokens_mistral': 969, 'n_tokens_neox': 951, 'n_words': 133}