本文整理汇总了PHP中common\models\User::isUserSeo方法的典型用法代码示例。如果您正苦于以下问题:PHP User::isUserSeo方法的具体用法?PHP User::isUserSeo怎么用?PHP User::isUserSeo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common\models\User
的用法示例。
在下文中一共展示了User::isUserSeo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: behaviors
/**
* @inheritdoc
*/
public function behaviors()
{
return ['access' => ['class' => AccessControl::className(), 'only' => ['index', 'create', 'update', 'delete', 'change'], 'rules' => [['allow' => true, 'actions' => ['index', 'create', 'update', 'delete', 'change'], 'roles' => ['@'], 'matchCallback' => function ($rule, $action) {
//Llamada al método que comprueba si es un vendedor
return \common\models\User::isUserSeo(Yii::$app->user->identity->id);
}], ['allow' => true, 'actions' => ['index', 'create', 'update', 'delete', 'change'], 'roles' => ['@'], 'matchCallback' => function ($rule, $action) {
//Llamada al método que comprueba si es un vendedor
return \common\models\User::isUserProduccion(Yii::$app->user->identity->id);
}]]]];
return ['verbs' => ['class' => VerbFilter::className(), 'actions' => ['delete' => ['POST']]]];
}
示例2: behaviors
/**
* @inheritdoc
*/
public function behaviors()
{
return ['access' => ['class' => AccessControl::className(), 'only' => ['gobierno-federal', 'embajadas', 'gdf', 'estatales', 'partidos-politicos', 'delegaciones', 'create-gob', 'create-embajada', 'create-gdf', 'create-estatales', 'create-ppoliticos', 'create-delegacion', 'create', 'update', 'delete', 'change'], 'rules' => [['allow' => true, 'actions' => ['gobierno-federal', 'embajadas', 'gdf', 'estatales', 'partidos-politicos', 'delegaciones', 'create-gob', 'create-embajada', 'create-gdf', 'create-estatales', 'create-ppoliticos', 'create-delegacion', 'create', 'update', 'delete', 'change'], 'roles' => ['@'], 'matchCallback' => function ($rule, $action) {
//Llamada al método que comprueba si es un vendedor
return \common\models\User::isUserSeo(Yii::$app->user->identity->id);
}], ['allow' => true, 'actions' => ['gobierno-federal', 'embajadas', 'gdf', 'estatales', 'partidos-politicos', 'delegaciones', 'create-gob', 'create-embajada', 'create-gdf', 'create-estatales', 'create-ppoliticos', 'create-delegacion', 'create', 'update', 'delete', 'change'], 'roles' => ['@'], 'matchCallback' => function ($rule, $action) {
//Llamada al método que comprueba si es un vendedor
return \common\models\User::isUserProduccion(Yii::$app->user->identity->id);
}]]]];
return ['verbs' => ['class' => VerbFilter::className(), 'actions' => ['delete' => ['POST']]]];
}
示例3: behaviors
public function behaviors()
{
return ['access' => ['class' => AccessControl::className(), 'only' => ['iniciativa-privada', 'gobierno-federal', 'gdf', 'estatales', 'partidos', 'delegacion', 'intercambio', 'fundacion', 'view', 'change', 'create', 'delete', 'update'], 'rules' => [['allow' => true, 'actions' => ['iniciativa-privada', 'gobierno-federal', 'gdf', 'estatales', 'partidos', 'delegacion', 'intercambio', 'fundacion', 'view', 'change', 'create', 'delete', 'update'], 'roles' => ['@'], 'matchCallback' => function ($rule, $action) {
//Llamada al método que comprueba si es un vendedor
return \common\models\User::isUserVendedor(Yii::$app->user->identity->id);
}], ['allow' => true, 'actions' => ['iniciativa-privada', 'view', 'change', 'create', 'delete', 'update'], 'roles' => ['@'], 'matchCallback' => function ($rule, $action) {
//Llamada al método que comprueba si es un vendedor
return \common\models\User::isUserIP(Yii::$app->user->identity->id);
}], ['allow' => true, 'actions' => ['iniciativa-privada', 'gobierno-federal', 'gdf', 'estatales', 'partidos', 'delegacion', 'intercambio', 'fundacion', 'view', 'change', 'create', 'delete', 'update'], 'roles' => ['@'], 'matchCallback' => function ($rule, $action) {
//Llamada al método que comprueba si es un vendedor
return \common\models\User::isUserSeo(Yii::$app->user->identity->id);
}]]]];
return ['verbs' => ['class' => VerbFilter::className(), 'actions' => ['delete' => ['post']]]];
}
示例4: actionIniciativaPrivada
/** Renderiza el listado de IP con el archivo iniciativa-privada.php */
public function actionIniciativaPrivada()
{
// Obtiene el total de las cuentas
//$cuentas = Cuentas::find()->select('cuenta')->distinct()->where('tipocuenta_id= 1')->createCommand()->getSql();
$query = new Query();
if (\common\models\User::isUserSeo(Yii::$app->user->identity->id)) {
$query->select('count(distinct(cuenta)) as total,username as usuario')->FROM('cuentas, user')->where('tipocuenta_id=1')->andWhere('cuentas.user_id= user.id ')->groupBy('user_id');
} else {
$query->select('count(distinct(cuenta)) as total,username as usuario')->FROM('cuentas, user')->where('tipocuenta_id=1')->andWhere('user.id =' . Yii::$app->user->identity->id)->andWhere('cuentas.user_id= user.id ')->groupBy('user_id');
}
$command = $query->createCommand();
$cuentas = $command->queryAll();
//select count(distinct(cuenta)), username from cuentas, user where tipocuenta_id=1
// and cuentas.user_id = user.id group by user_id ;
//
// Filtrando solo los de Iniciativa Privada
$searchModel = new CuentasSearch(['tipocuenta_id' => 1]);
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
$dataProvider->pagination->pageSize = 20;
return $this->render('iniciativa-privada', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'cuentas' => $cuentas]);
}