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

42 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.
*/
class ome_mdl_order_extend extends dbeav_model {
/**
* 添加RouterNum
* @param mixed $orderId ID
* @return mixed 返回值
*/
public function addRouterNum($orderId) {
$extend_detail = $this->db->selectrow("SELECT order_id FROM sdb_ome_order_extend WHERE order_id='".$orderId."'");
if ($extend_detail){
$sql = 'update sdb_ome_order_extend set router_num = router_num + 1 where order_id = "'.$orderId.'"';
}else{
$sql = "insert into sdb_ome_order_extend(order_id,router_num) VALUES('$orderId','1')";
}
$this->db->exec($sql);
}
/**
* 更新BoolExtendStatus
* @param mixed $orderId ID
* @param mixed $boolStatus boolStatus
* @return mixed 返回值
*/
public function updateBoolExtendStatus($orderId, $boolStatus) {
if($boolStatus > 0) {
$extend_detail = $this->db->selectrow("SELECT order_id FROM sdb_ome_order_extend WHERE order_id='".$orderId."'");
if ($extend_detail){
$sql = 'update sdb_ome_order_extend set bool_extendstatus = bool_extendstatus | ' . intval($boolStatus) . ' where order_id = "' . $orderId . '"';
}else{
$sql = "insert into sdb_ome_order_extend(order_id,bool_extendstatus) VALUES('$orderId','$boolStatus')";
}
$this->db->exec($sql);
}
}
}