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

27 lines
795 B
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.
*/
class warehouse_mdl_iso extends dbeav_model{
var $has_many = array('iso_items' => 'iso_items');
//model层新加扩展数据层
function iso_items($iso_id) {
$eoObj = $this->app->model("iso_items");
$rows['items'] = $eoObj->getList('product_name as name,nums as num,bn,price',array('iso_id'=>$iso_id));
$total_num = 0;
$total_price = 0;
foreach($rows['items'] as $v){
$total_num += intval($v['num']);
$total_price += intval($v['num'])*floatval($v['price']);
}
$rows['total_num'] = $total_num;
$rows['total_price'] = $total_price;
return $rows;
}
}