Files
OMS/app/logisticsmanager/lib/print/data/queueItems.php
2025-12-28 23:13:25 +08:00

51 lines
1.6 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 ykm 2015-12-25
* @describe print_queue_items打印数据整理
*/
class logisticsmanager_print_data_queueItems{
private $mField = array(
'ident',
'delivery_id',
'ident_dly',
);
/**
* queueItems
* @param mixed $oriData ID
* @param mixed $corp corp
* @param mixed $field field
* @param mixed $type type
* @return mixed 返回值
*/
public function queueItems(&$oriData, $corp, $field, $type) {
$pre = __FUNCTION__ . '.';
$itemModel = app::get('ome')->model('print_queue_items');
$strField = kernel::single('logisticsmanager_print_data')->getSelectField($this->mField, $field, $itemModel);
$item = $itemModel->getList($strField, array('delivery_id'=>array_keys($oriData)));
$itemData = array();
foreach($item as $row) {
$itemData[$row['delivery_id']] = $row;
}
foreach($oriData as $key => $value) {
foreach($field as $f) {
if(isset($itemData[$value['delivery_id']][$f])) {
$oriData[$key][$pre . $f] = $itemData[$value['delivery_id']][$f];
} elseif(method_exists($this, $f)) {
$oriData[$key][$pre . $f] = $this->$f($itemData[$value['delivery_id']]);
} else {
$oriData[$key][$pre . $f] = '';
}
}
}
}
private function print_no($itemRow) {
return $itemRow ? $itemRow['ident'] . '_' . $itemRow['ident_dly'] : '';
}
}