Commit f9c2975c authored by hujun's avatar hujun

数组分页

parent 57b09f4f
...@@ -443,24 +443,22 @@ class Broker extends Basic ...@@ -443,24 +443,22 @@ class Broker extends Basic
unset($list); unset($list);
if (isset($key_array)) { if (isset($key_array)) {
$total = count($key_array); $total = count($key_array);
$max = 400; $size = 300;;
$page_total = ceil($total / $size);
$m_bank = new AAgentsBank(); $m_bank = new AAgentsBank();
$bank_field = 'agent_id,account,bank,card_no,id_card'; $bank_field = 'agent_id,account,bank,card_no,id_card';
for ($i = 0; $i < $total; $i++) { for ($i = 0; $i < $page_total; $i++) {
$id_string[] = $key_array[$i]; $id_array = array_slice($key_array, $i * $size, $size);
if ($i == $max) { $bank_data = $m_bank->getDataAll($bank_field, ['agent_id'=> ['in', $id_array], 'is_del'=>0]);
$max += 400; foreach ($bank_data as $v2) {
$bank_data = $m_bank->getDataAll($bank_field, ['agent_id'=> ['in', $id_string], 'is_del'=>0]); $key = $v2['agent_id'];
foreach ($bank_data as $v2) { $excel_data[$key]['id_card'] = "\t".$v2['id_card'];
$key = $v2['agent_id']; $excel_data[$key]['account'] = $v2['account'];
$excel_data[$key]['id_card'] = $v2['id_card']; $excel_data[$key]['card_no'] = $v2['card_no'];
$excel_data[$key]['account'] = $v2['account']; $excel_data[$key]['bank'] = $v2['bank'];
$excel_data[$key]['card_no'] = $v2['card_no'];
$excel_data[$key]['bank'] = $v2['bank'];
}
unset($id_string);
unset($bank_data);
} }
unset($id_string);
unset($bank_data);
} }
} }
$export = new ExportExcelUntil(); $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