cxfoot/controllers/SiteController.php
2023-11-22 20:10:26 +08:00

64 lines
1.6 KiB
PHP

<?php
namespace app\controllers;
use app\components\SiteHelper;
use Yii;
use yii\filters\AccessControl;
use yii\web\Response;
use yii\filters\VerbFilter;
class SiteController extends Controller
{
/**
* {@inheritdoc}
*/
public function actions()
{
return [
'error' => [
'class' => 'yii\web\ErrorAction',
],
];
}
public function actionIndex()
{
$code = $this->request->get('code');
$state = $this->request->get('state');
$to_state = "";
if(!empty($state)){
$explode = explode('_',$state);
if(!empty($explode[0])){
$to_state .= "&dev_id={$explode[0]}";
}
if(!empty($explode[1])){
$to_state .= "&store_id={$explode[1]}";
}
if(!empty($explode[2])){
$to_state .= "&time={$explode[2]}";
}
}
$url = SiteHelper::getCustomiseOptionByKey("siteWapDomain", "hump")."/#/White?code={$code}{$to_state}";
// echo $url;
// exit();
return $this->redirect($url);
}
public function actionTodata()
{
$code = $this->request->get('code');
$state = $this->request->get('state');
$to_state = "";
if(!empty($state)){
$to_state = "&id={$state}";
}
$url = SiteHelper::getCustomiseOptionByKey("siteWapDomain", "hump")."/#/dataReporting?code={$code}{$to_state}";
// echo $url;
// exit();
return $this->redirect($url);
}
}