Files
OMS/app/console/controller/admin/stockfreeze.php
2026-01-04 17:22:44 +08:00

103 lines
3.0 KiB
PHP

<?php
/**
* Copyright 2026 ShopeX (https://www.shopex.cn)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class console_ctl_admin_stockfreeze extends desktop_controller{
var $name = "库存冻结";
var $workground = "console_center";
function index(){
$this->display('admin/stockfreeze/product.html');
}
/**
* 显示所有货品冻结.
* @param
* @return
* @access public
* @author sunjing@shopex.cn
*/
function showall()
{
die('此接口已被废弃');
//获取所有有差异的货品
$diff_data = kernel::single('console_storefreeze')->get_all_diff();
$basicMaterialSelect = kernel::single('material_basic_select');
$storefreezeLib = kernel::single('console_storefreeze');
foreach($diff_data as $dk=>$data){
$product_id = $dk;
$rs[$product_id]['bn'] = $data['bn'];
$rs[$product_id]['local_product_store_freeze'] = $data['local_product_store_freeze'];
$rs[$product_id]['real_product_freeze'] = $data['real_product_freeze'];
$rs[$product_id]['real_branch_freeze'] = $data['real_branch_freeze'];
$rs[$product_id]['local_branch_freeze'] = $data['local_branch_freeze']; $ids[] = $product_id;
}
$this->pagedata['data'] = $rs;
$this->pagedata['ids'] =serialize($ids);
$this->pagedata['show'] = 'all';
$this->display('admin/stockfreeze/product.html');
}
/**
* 修正冻结库存.
* @param
* @return
* @access public
* @author sunjing@shopex.cn
*/
function fix_freeze_store()
{
die('此接口已被废弃');
$id = $_POST['product_id'];
//$product_id = unserialize($id) ? unserialize($id) : (array)$id;
$rs = kernel::single('console_storefreeze')->fix_freeze_store($id);
echo json_encode($rs);
}
/**
* 修复冻结库存.
* @param
* @return
* @access public
* @author sunjing@shopex.cn
*/
function repare_freeze_store()
{
die('此接口已被废弃');
$product_ids = $_POST['product_ids'];
$product_ids = unserialize($product_ids) ;
foreach ($product_ids as $product_id ) {
kernel::single('console_storefreeze')->fix_freeze_store($product_id);
}
$rs = 'success';
echo json_encode($rs);
}
}
?>