public function actionTest() { $params = []; $a = \yii::$app->request->get('a', 0); if ($a) { $params['idSubtable'] = $a; } $data = API::run('Actions.getEntryPageUrls', $params); $data = json_encode($data); $a = \yii::$app->request->get('a', 0); //$data = $a; //sleep(1); return $this->render('test' . $a, ['data' => $data]); }
public function actionLog() { $data = API::run('Live.getLastVisitsDetails'); $dataProvider = new ArrayDataProvider(['allModels' => $data]); return $this->render('log', ['dataProvider' => $dataProvider]); }
public function search($type) { $params = $segment = []; if (!empty($this->visitorId)) { $segment[] = 'visitorId==' . $this->visitorId; } switch ($type) { case 1: //乐宝用户 $segment[] = 'customVariableValue2==1'; if ($this->userId) { $segment[] = 'userId==' . $this->userId; } else { $segment[] = 'userId!='; //有用户名的用户 } $this->render = 'reg-user'; break; case 2: //永利会 $segment[] = 'customVariableValue2==2'; if ($this->userId) { $segment[] = 'userId==' . $this->userId; } else { $segment[] = 'userId!='; //有用户名的用户 } $this->render = 'reg-user'; break; case 3: //未注册用户 // $segment[] = 'userId=='; $this->render = 'common-user'; break; default: //无注册源的用户 $segment[] = 'customVariableValue2=='; // if ($this->userId) { $segment[] = 'userId==' . $this->userId; } else { $segment[] = 'userId!='; //有用户名的用户 } $this->render = 'reg-user'; } if (!empty($this->regdate) && strpos($this->regdate, " 至 ")) { //如果有选择日期 list($startTime, $endTime) = explode(" 至 ", $this->regdate); $startTime = strtotime($startTime); $endTime = strtotime($endTime); $params['formatDate'] = false; //去掉默认的date查询 $segment[] = 'customVariableValue1>=' . $startTime; $segment[] = 'customVariableValue1<=' . $endTime; } $params['segment'] = implode(';', $segment); $data = API::run('Live.getLastVisitsDetails', $params); if ($this->render == 'reg-user') { $data = $this->getDb($data); } return $data; }
public function actionGetReferrerType() { $data = API::run('Referrers.getReferrerType'); $dataProvider = new ArrayDataProvider(['allModels' => $data]); return $this->render('get-referrer-type', ['dataProvider' => $dataProvider]); }
<?php use kartik\widgets\ActiveForm; use kartik\daterange\DateRangePicker; use app\modules\admin\Module; use kartik\helpers\Html; $form = ActiveForm::begin(['type' => ActiveForm::TYPE_INLINE, 'method' => 'get', 'options' => ['enctype' => 'multipart/form-data', 'style' => 'float:left;margin-top:7px;']]); echo DateRangePicker::widget(['attribute' => "date", 'name' => 'date', 'value' => \app\api\core\API::formatDate(), 'convertFormat' => true, 'pluginOptions' => ['locale' => ['separator' => ',', 'format' => 'Y-m-d'], 'opens' => 'right']]); ?> <div style="display: inline-block"> <?php echo \kartik\widgets\Select2::widget(['name' => 'filter_limit', 'value' => \yii::$app->request->get('filter_limit', 50), 'data' => [20 => 20, 50 => 50, 100 => 100, 200 => 200], 'options' => ['placeholder' => '每页条数']]); ?> </div> <?php echo Html::submitButton('ok', ['class' => 'btn btn-primary']); ActiveForm::end();