Files
OMS/app/ome/lib/freeze/stock/log.php
2026-01-04 19:08:31 +08:00

52 lines
2.6 KiB
PHP

<?php
/**
* Copyright 2012-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 ome_freeze_stock_log{
/**
* changeLog
* @param mixed $data 数据
* @return mixed 返回值
*/
public function changeLog($data){
$tmpdata = array(
'log_type'=>$data['log_type'],
'mark_no'=>$data['mark_no'],
'shop_id'=> $GLOBALS['frst_shop_id'] ? $GLOBALS['frst_shop_id'] : '',
'shop_type'=>$GLOBALS['frst_shop_type'] ? $GLOBALS['frst_shop_type'] : '',
'order_bn'=>$GLOBALS['frst_order_bn'] ? $GLOBALS['frst_order_bn'] : '',
'delivery_bn'=>$GLOBALS['frst_delivery_bn'] ? $GLOBALS['frst_delivery_bn'] : '',
'oper_id'=>defined('FRST_OPER_ID') ? FRST_OPER_ID : kernel::single('desktop_user')->get_id(),
'oper_name'=>defined('FRST_OPER_NAME') ? FRST_OPER_NAME : (kernel::single('desktop_user')->get_name() ? kernel::single('desktop_user')->get_name() : 'system'),
'oper_time'=>$data['oper_time'],
'trigger_object_type'=>defined('FRST_TRIGGER_OBJECT_TYPE') ? FRST_TRIGGER_OBJECT_TYPE : '',
'trigger_action_type'=>defined('FRST_TRIGGER_ACTION_TYPE') ? FRST_TRIGGER_ACTION_TYPE : '',
'branch_id'=>$data['branch_id'] ? $data['branch_id'] : '',
'branch_name'=>$data['branch_name'] ? $data['branch_name'] : '',
'product_id'=>$data['product_id'],
'goods_id'=>$data['goods_id'] ? $data['goods_id'] : '',
'bn'=>$data['bn'] ? $data['bn'] : '',
'stock_action_type'=>$data['stock_action_type'],
'last_num'=>$data['last_num'] ? $data['last_num'] : '0',
'change_num'=>$data['change_num'],
'current_num'=>$data['current_num'] ? $data['current_num'] : '0',
);
if(isset($GLOBALS['frst_domain']) && in_array($_SERVER['SERVER_NAME'],$GLOBALS['frst_domain'])){
app::get('ome')->model('freeze_stock_log')->save($tmpdata);
}
}
}