编辑 EOF; $button1 = <<导入货品 EOF; $export_button = <<导出货品 EOF; $skuid_button = <<导入SKU ID EOF; $export_skuid = <<导出SKU ID EOF; return $button.' | '.$button1.' | '.$export_button . ' | ' . $skuid_button . ' | ' . $export_skuid; } public $column_regulation = '库存规则'; public $column_regulation_order = 2; public $column_regulation_width = 200; public function column_regulation($row) { $field_name = $this->col_prefix . 'regulation_id'; $regulation_id = $row[$field_name]; if (empty($regulation_id)) { return '未设置规则'; } $regulationModel = app::get('inventorydepth')->model('regulation'); $regulation = $regulationModel->db_dump($regulation_id); if (!$regulation) { return '规则不存在'; } $status_color = $regulation['using'] == 'true' ? '#0066cc' : '#ff0000'; return << {$regulation['heading']} ({$regulation['bn']}) EOF; } public $column_supply_branch_id = '专用供货仓'; public $column_supply_branch_id_order = 90; public $column_supply_branch_id_width = 200; public function column_supply_branch_id($row) { $field_name = $this->col_prefix . 'supply_branch_id'; if (empty($row[$field_name])) { return '使用店铺默认供货仓'; } $branch_ids = explode(',', $row[$field_name]); $branch_ids = array_map('trim', $branch_ids); $branch_ids = array_filter($branch_ids); if (empty($branch_ids)) { return '使用店铺默认供货仓'; } // 获取仓库名称 $branchModel = app::get('ome')->model('branch'); $branches = $branchModel->getList('name,branch_bn,branch_id', array('branch_id|in' => $branch_ids)); $branch_names = array(); foreach ($branches as $branch) { $branch_names[] = $branch['name'] . ' (' . $branch['branch_bn'] . ')'; } if (empty($branch_names)) { return '供货仓不存在: ' . $row[$field_name] . ''; } return '
' . implode('
', array_map(function($name){ return '' . $name . ''; }, $branch_names)) . '
'; } }