orderPrintService = Zc::singleton('OrderPrintService'); } public function render($data = array()) { $mallId = $_SESSION[SessionConst::mallId]; $subAccountId = $_SESSION[SessionConst::mallSubAccountId] ?: 0; if (empty($data['opSetting'])) { $data['opSetting'] = $this->orderPrintService->getUserOpSetting($mallId); } if (empty($data['opPageSetting'])) { $data['opPageSetting'] = $this->orderPrintService->getUserOpPageSetting($mallId, $subAccountId); } $exportOrderFieldsInfo = $data['opPageSetting']['default_export_order_fields'] ?: $data['opSetting']['default_export_order_fields']; $data['exportOrderFieldsInfo'] = $this->getExportOrderFieldsInfo($exportOrderFieldsInfo); return $this->renderFile('order/order_export_modal', $data); } private function getExportOrderFieldsInfo($defaultExportOrderFields) { $fieldsMap = OrderPrintTool::getExportFieldsMap(); $data = array(); foreach ($fieldsMap as $group => $fields) { foreach ($fields as $field => $name) { $data[$group][] = array( 'field' => $field, 'name' => $name, 'checked' => in_array($field, $defaultExportOrderFields[$group]) ); } } return $data; } }