如何以表格格式显示数据
$ParentBean = BeanFactory::newBean('Users');
$ParentBean = $ParentBean->retrieve_by_string_fields(
array(
'user_name' => $values = $_POST['name'],
)
);
if ($ParentBean->load_relationship('tc_users')) {
$childData = $ParentBean->tc_users->getBeans();
}
现在我正在用它来显示我的数组
echo '<pre>';
print_r($_POST);
foreach ($childData as $key => $value) {
echo $value->name;
print_r($value);
echo '<br>';
}
结果:
Array
(
[name] => admin
)
saSasLead Object
(
[field_name_map] => Array
(
[id] => Array
(
[name] => id
[vname] => LBL_ID
[type] => id
[required] => 1
[reportable] => 1
[comment] => Unique identifier
[inline_edit] =>
)
[name] => Array
(
[name] => name
[rname] => name
[vname] => LBL_NAME
[type] => name
[link] => 1
[fields] => Array
(
[0] => first_name
[1] => last_name
)
[sort_on] => last_name
[source] => non-db
[group] => last_name
[len] => 255
[db_concat_fields] => Array
(
[0] => first_name
[1] => last_name
)
[importable] => false
)
[date_entered] => Array
(
[name] => date_entered
[vname] => LBL_DATE_ENTERED
[type] => datetime
[group] => created_by_name
[comment] => Date record created
[enable_range_search] => 1
[options] => date_range_search_dom
[inline_edit] =>
)
答案 0 :(得分:1)
您可以通过以下方式获取它:
$data= $accountBean->get_linked_beans(
'contacts',
'Contacts',
array(),
0,
10,
0,
"contacts.primary_address_country = 'USA'");