Hi,
I have challenge here. kindly assist me.
With consideration to the image attached
Here is my code
Here is output
I the output not to return user password.
So, what can I do to achieve that.
Hi,
I have challenge here. kindly assist me.
With consideration to the image attached
Here is my code
Here is output
I the output not to return user password.
So, what can I do to achieve that.
I tried this code but it return null
Codes
'tblScholarshipsGrantsSponsors.sponsor.user' => function($qr) { $qr->select([ "name", "email", "username", "phone", ]) ->one(); },
and
'tblScholarshipsGrantsSponsors.sponsor.user' => function($qr) { return $qr->select([ "name", "email", "username", "phone", ]) ->one(); },
Here is the output
no need of one()
inside with. Add id
in select so relation can join and return result.
You can use where()
like below example to short the code
->where(['scholarship_category' => 10, 'status' => 30]);
by json
-----------_form.php----------------
------------controller -------------
Public function actionImpuesto($codigret)
{
$data[‘impuesto’]=‘’;
$localdata = Impuestcodretenc::find()->where(‘idimpuestcodretenc=’.$codigret)->one();
if ($localdata){
$data['impuesto']=$localdata->impuestcodretporcent;
}
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
return $data;
}