Files
OMS/app/material/model/codebase.php
2025-12-28 23:13:25 +08:00

60 lines
1.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
/**
* 码库模型层
*
* @author kamisama.xia@gmail.com
* @version 0.1
*/
class material_mdl_codebase extends dbeav_model{
/**
* 码库类型字段格式化
* @param string $row 物料类型字段
* @return string
*/
function modifier_type($row){
$materialConfLib = kernel::single('material_codebase');
$codebaseList = $materialConfLib->getCodeList();
if($codebaseList){
foreach($codebaseList as $code){
if($code['type'] == $row){
return $code['name'];
}
}
}
return "-";
}
/**
* 码库列表项扩展字段
*/
function extra_cols(){
return array(
'column_material_name' => array('label'=>'基础物料名称','width'=>'260','func_suffix'=>'material_name'),
'column_material_bn' => array('label'=>'基础物料编码','width'=>'120','func_suffix'=>'material_bn'),
);
}
/**
* 物料名称扩展字段格式化
*/
function extra_material_name($rows){
return kernel::single('material_extracolumn_codebase_materialname')->process($rows);
}
/**
* 物料编码扩展字段格式化
*/
function extra_material_bn($rows){
return kernel::single('material_extracolumn_codebase_materialbn')->process($rows);
}
}