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

64 lines
2.0 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 omevirtualwms_mdl_dataStatus extends dbeav_model {
/**
* table_name
* @param mixed $full full
* @return mixed 返回值
*/
public function table_name($full=null)
{
if ($full)
return kernel::database()->prefix.'omevirtualwms_data_status';
else
return 'data_status';
}
/**
* 保存
* @param mixed $data 数据
* @param mixed $mustUpdate mustUpdate
* @return mixed 返回操作结果
*/
public function save(&$data, $mustUpdate=null)
{
if (current($this->dump(array('bn'=>$data['bn'], 'type'=>$data['type']),'count(*) as cnt')) == 0)
return $this->insert($data);
else
return $this->update($data,array('bn'=>$data['bn'], 'type'=>$data['type']));
}
/**
* scanANDclean
* @return mixed 返回值
*/
public function scanANDclean()
{
/* $sql = 'delete from sdb_omevirtualwms_data_status where type=\'stockin\' and bn in ( select appropriation_bn from sdb_omestorage_appropriation where in_status not in (0,1) and otype=\'0\' )';
$this->db->query($sql);
$sql = 'delete from sdb_omevirtualwms_data_status where type=\'stockout\' and bn in ( select appropriation_bn from sdb_omestorage_appropriation where in_status not in (3,4) and otype=\'1\' )';
$this->db->query($sql); */
$sql = 'delete from sdb_omevirtualwms_data_status where type=\'reship\' and bn in ( select reship_bn from sdb_ome_reship where status!=\'ready\' and status!=\'progress\' )';
$this->db->query($sql);
$sql = 'delete from sdb_omevirtualwms_data_status where type=\'delivery\' and bn in ( select delivery_bn from sdb_ome_delivery where status!=\'ready\' and status!=\'accept\' and status!=\'progress\' )';
$this->db->query($sql);
}
}