Funcion SUM
<?=app\modules\soporte\models\InvBaterias::find()->where(['id_periodo'=>1])->sum('cantidad');
Funcion orderBy
$resultado = CatPlanteles::find()->orderBy('id')->all();
app\modules\admin\models\EstadoBaja::find()->orderBy('nombre')->asArray()->all()
Funcion Count
<?=app\modules\soporte\models\InvImpresoras::find()->where(['id_plantel'=>$value['id']])->andWhere(['estado'=>1])->count(); ?>
Función group by
InvNobreak::find()->select(['marca'])->where(['id_plantel'=>Yii::$app->user->identity->id_plantel])->groupBy(['marca'])->all();
Funcion queryOne como arreglo
\Yii::$app->db2->createCommand($sql)->queryOne();
$var['var'];
Funcion find ONE
$model = InvBajas::findOne($id_baja);
$model->progresivo;
$model->tipoEquipo->nombre;
$inventario = \Yii::$app->db2->createCommand($sql)->queryOne();
No hay comentarios:
Publicar un comentario