Files
OMS/app/ome/model/delivery/order.php
2025-12-28 23:13:25 +08:00

62 lines
2.1 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.
*/
class ome_mdl_delivery_order extends dbeav_model{
function insertParentOrderByItems($parent_id, $items){
if (!is_array($items)) return false;
$filter['delivery_id'] = $items;
$rows = $this->getList('order_id', $filter, 0, -1);
if ($rows){
foreach ($rows as $item){
$new_order['delivery_id'] = $parent_id;
$new_order['order_id'] = $item['order_id'];
$this->save($new_order);
$new_order = NULL;
}
return true;
}
return false;
}
#根据物流单号,获取会员备注与订单备注
/**
* 获取MarkInfo
* @param mixed $dly_id ID
* @param mixed $_column _column
* @return mixed 返回结果
*/
public function getMarkInfo($dly_id,$_column=null){
if(!empty($_column)){
$column = 'orders.'.$_column;
$sql = "
select
$column from sdb_ome_orders orders
join sdb_ome_delivery_order on orders.order_id=sdb_ome_delivery_order.order_id
and sdb_ome_delivery_order.delivery_id=".$dly_id;
}else{
$sql = '
select
orders.order_bn,orders.custom_mark,orders.mark_text from sdb_ome_orders orders
join sdb_ome_delivery_order on orders.order_id=sdb_ome_delivery_order.order_id
and sdb_ome_delivery_order.delivery_id='.$dly_id;
}
return $this->db->select($sql);
}
public function getOrderInfo($filed = null,$delivery_id = array()){
$sql = '
select '
.$filed.'
from sdb_ome_orders
left join sdb_ome_delivery_order
on sdb_ome_delivery_order.order_id=sdb_ome_orders.order_id
where sdb_ome_delivery_order.delivery_id in ('.$delivery_id.')';
return $this->db->select($sql);
}
}
?>