Commit f9c2975c authored by hujun's avatar hujun

数组分页

parent 57b09f4f
......@@ -443,24 +443,22 @@ class Broker extends Basic
unset($list);
if (isset($key_array)) {
$total = count($key_array);
$max = 400;
$size = 300;;
$page_total = ceil($total / $size);
$m_bank = new AAgentsBank();
$bank_field = 'agent_id,account,bank,card_no,id_card';
for ($i = 0; $i < $total; $i++) {
$id_string[] = $key_array[$i];
if ($i == $max) {
$max += 400;
$bank_data = $m_bank->getDataAll($bank_field, ['agent_id'=> ['in', $id_string], 'is_del'=>0]);
foreach ($bank_data as $v2) {
$key = $v2['agent_id'];
$excel_data[$key]['id_card'] = $v2['id_card'];
$excel_data[$key]['account'] = $v2['account'];
$excel_data[$key]['card_no'] = $v2['card_no'];
$excel_data[$key]['bank'] = $v2['bank'];
}
unset($id_string);
unset($bank_data);
for ($i = 0; $i < $page_total; $i++) {
$id_array = array_slice($key_array, $i * $size, $size);
$bank_data = $m_bank->getDataAll($bank_field, ['agent_id'=> ['in', $id_array], 'is_del'=>0]);
foreach ($bank_data as $v2) {
$key = $v2['agent_id'];
$excel_data[$key]['id_card'] = "\t".$v2['id_card'];
$excel_data[$key]['account'] = $v2['account'];
$excel_data[$key]['card_no'] = $v2['card_no'];
$excel_data[$key]['bank'] = $v2['bank'];
}
unset($id_string);
unset($bank_data);
}
}
$export = new ExportExcelUntil();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment