find(array('id' => $id, 'clear_top' => true));
if ($account) {
$string = $account['name'] . '
' . $account['mobile'] . '
' . $account['idcard'] . '
' . $account['key'];
$company = Dever::db('manage/company')->find($account['company_id']);
if ($company) {
$string .= '
' . $company['name'];
}
return $string;
} else {
return '';
}
}
public function search_api()
{
$value = Dever::input('value');
if ($value) {
$company = Dever::load('manage/company.get');
$where = array('key' => $value);
if ($company) {
$where['company_id'] = $company;
}
$data = Dever::db('option/member')->getList($where);
$table = array();
if ($data) {
$table = array();
$table['head'] = array('公司', '序列号', '姓名', '手机号', '类型');
$table['body'] = array();
foreach ($data as $k => $v) {
$company = Dever::db('manage/company')->one($v['company_id']);
if ($v['main'] == 1) {
$main = '主账号';
} else {
$main = '子账号';
}
$table['body'][] = array($company['name'], $v['key'], $v['name'], $v['mobile'], $main);
}
$result[] = array
(
'type' => 'table',
'content' => $table,
);
$html = Dever::show('', $result, false, false);
return $html;
}
return '暂无账号';
} else {
return '';
}
}
}