其实我的问题是,
执行相关下拉,因为如果我选择公司,则应显示属于所选employee_id
的{{1}}列表。
之后,如果我选择company
,则必须显示属于特定employee_id
的{{1}}
names
所以要对属于employee_id的所有名称进行分组,我一直在使用此代码
employee_id
但是在这里,如果我选择一个employee_id作为整数,它的完美示例id company ID Employee ID Name Relationship Dob Age Gender
1 EMPL 00001 Choodamani Spouse 11-Aug-66 49 Female
2 EMPL 00001 Komala Mother 30-Oct-39 76 Female
3 EMPL 00001 Varshini Daughter 29-Apr-04 11 Female
4 EMPL 00001 Vasudevan Employee 15-Jul-62 53 Male
5 EMPL 00002 Siddharth Son 1-Jun-00 15 Male
6 EMPL 00002 Poongavanam Mother 21-Oct-39 76 Female
7 EMPL 00002 Aruna Spouse 16-Sep-68 47 Female
8 EMPL 00002 Abirami Daughter 7-May-97 18 Female
9 EMPL 00002 Murali Employee 7-Oct-67 48 Male
10 EMPL E0003 Kalai Employee 9-Nov-87 24 Male
11 EMPL E0003 Devi Wife 13-Nov-90 22 Male
,$countClaimprocess = Employee::find()
->where(['id' => $id])
->count();
$claimprocess1 = Employee::find()
->select('employee_id')
->where(['id' => $id])
->one();
$claimprocess2 = Employee::find()
->select('importcompany_id')
->where(['id' => $id])
->one();
$claim2 = $claimprocess2->importcompany_id;
$claim = $claimprocess1->employee_id;
$claimprocess = Employee::find()
->where("employee_id = $claim and importcompany_id = $claim2")
->andwhere(" status != 'Deleted' ")
->all();
if($countClaimprocess >= 0)
{
foreach($claimprocess as $claim)
{
echo "<option value='".$claim->id."'>".$claim->name."</option>";
}
}
else{
echo "<option>-</option>";
}
}
。并显示从属名称。
但是,如果我选择employee_id,如00001
或00002
,则不会显示相关名称
所以我需要的是如何将char,interger E0002
的组合转换为interger