$_GET['term'] 中的这个“术语”来自哪里。. .
该“术语”的含义或内容是什么?
这是一个示例代码:
public function actionSuggest() {
$criteria = new CDbCriteria;
$criteria->select = array('lastName', 'firstName', 'middleName','idNo','yrLevel','gender');
$criteria->addSearchCondition('lastName', $_GET['term']);
$criteria->limit = 10;
$data = Engineering::model()->findAll($criteria);
$arr = array();
foreach ($data as $item) {
$arr[] = array(
'label' => $item->lastName.' '.$item->firstName.' '.$item->middleName[0].'.',
'value' => $item->lastName,
'lastname' => $item->lastName,
'firstname' => $item->firstName,
'middlename' => $item->middleName,
'idno' => $item->idNo,
'gender' => $item->gender,
'yrlevel' => $item->yrLevel,
);
}
echo CJSON::encode($arr);
}