refactor(仓储逻辑): 为相关函数增加管理员ID参数

- 在多个控制器和逻辑类中,为相关函数增加了admin_id参数
- 更新了WarehouseProductLogic中的多个方法,使其支持记录管理员ID
- 修改了ChangeLogLogic和SqlChannelLog函数,增加了admin_id字段
This commit is contained in:
mkm 2025-01-06 12:04:18 +08:00
parent 7379406cb9
commit 148e6cf019
20 changed files with 78 additions and 81 deletions

View File

@ -336,7 +336,7 @@ class WorkbenchController extends BaseAdminController
public function update_negative_zero()
{
$parmas = $this->request->get();
$res = WarehouseLogic::updateNegativeZero($parmas);
$res = WarehouseLogic::updateNegativeZero($parmas,$this->adminId);
if($res){
return $this->data([], '操作成功');
}else{

View File

@ -39,7 +39,7 @@ class InventoryTransferController extends BaseAdminController
public function add()
{
$params = (new InventoryTransferValidate())->post()->goCheck('add');
$result = InventoryTransferLogic::add($params);
$result = InventoryTransferLogic::add($params,$this->adminId);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}

View File

@ -242,7 +242,7 @@ class StoreOrderController extends BaseAdminController
$data['purchase'] = $storeProduct['purchase'];
$data['oid'] = $res['id'];
$data['financial_pm'] = 0;
WarehouseProductLogic::add($data);
WarehouseProductLogic::add($data,1,$this->adminId);
$finds = WarehouseProduct::where('oid', $res['id'])->field('sum(nums) as nums,sum(total_price) as total_price')->find();
WarehouseOrder::where('id', $res['id'])->update(['total_price' => $finds['total_price'], 'nums' => $finds['nums']]);
}

View File

@ -62,7 +62,7 @@ class SystemStoreStorageController extends BaseAdminController
if($id==0){
return $this->fail('参数错误');
}
SystemStoreStorageLogic::edit(['id'=>$id,'admin_id'=>$this->adminId]);
SystemStoreStorageLogic::edit(['id'=>$id,'admin_id'=>$this->adminId], $this->adminId);
return $this->success('操作成功',[]);
}

View File

@ -113,7 +113,7 @@ class WarehouseOrderController extends BaseAdminController
$data['oid'] = $res['id'];
$data['financial_pm'] = 0;
$data['price'] = $storeProduct['price'];
WarehouseProductLogic::setOutbound($data);
WarehouseProductLogic::setOutbound($data,1,$this->adminId);
$finds = WarehouseProduct::where('oid', $res['id'])->field('sum(nums) as nums,sum(total_price) as total_price')->find();
WarehouseOrder::where('id', $res['id'])->update(['total_price' => $finds['total_price'], 'nums' => $finds['nums']]);
}

View File

@ -40,28 +40,28 @@ class WarehouseProductController extends BaseAdminController
{
return $this->fail('当前接口废弃');
$params = $this->request->post();
// $params = $this->request->post();
foreach ($params['product_arr'] as $k => $v) {
$data['admin_id'] = $this->adminId;
$data['store_id'] = 0;
$data['supplier_id'] = $params['supplier_id'];
$data['warehouse_id'] = $params['warehouse_id'];
$data['code'] = $params['code'];
$data['product_id'] = $v['product_id'];
$data['nums'] = $v['nums'];
$data['purchase'] = $v['purchase'];
$data['total_price'] = $v['total_price'];
$data['financial_pm'] = 1;
if (!empty($v['manufacture'])) {
$data['manufacture'] = $v['manufacture'];
}
if (!empty($v['expiration_date'])) {
$data['expiration_date'] = $v['expiration_date'];
}
WarehouseProductLogic::add($data);
}
return $this->success('添加成功', [], 1, 1);
// foreach ($params['product_arr'] as $k => $v) {
// $data['admin_id'] = $this->adminId;
// $data['store_id'] = 0;
// $data['supplier_id'] = $params['supplier_id'];
// $data['warehouse_id'] = $params['warehouse_id'];
// $data['code'] = $params['code'];
// $data['product_id'] = $v['product_id'];
// $data['nums'] = $v['nums'];
// $data['purchase'] = $v['purchase'];
// $data['total_price'] = $v['total_price'];
// $data['financial_pm'] = 1;
// if (!empty($v['manufacture'])) {
// $data['manufacture'] = $v['manufacture'];
// }
// if (!empty($v['expiration_date'])) {
// $data['expiration_date'] = $v['expiration_date'];
// }
// WarehouseProductLogic::add($data);
// }
// return $this->success('添加成功', [], 1, 1);
}
@ -90,7 +90,7 @@ class WarehouseProductController extends BaseAdminController
public function delete()
{
$params = (new WarehouseProductValidate())->post()->goCheck('delete');
WarehouseProductLogic::delete($params);
WarehouseProductLogic::delete($params,$this->adminId);
return $this->success('删除成功', [], 1, 1);
}
@ -140,7 +140,7 @@ class WarehouseProductController extends BaseAdminController
public function set_nums()
{
$params=$this->request->post();
$result = WarehouseProductLogic::settNums($params);
$result = WarehouseProductLogic::settNums($params,$this->adminId);
return $this->success('');
}
}

View File

@ -56,7 +56,7 @@ class WarehouseProductStoregeController extends BaseAdminController
public function edit()
{
$params = $this->request->post();
$result = WarehouseProductStoregeLogic::edit($params);
$result = WarehouseProductStoregeLogic::edit($params,$this->adminId);
return $this->success('编辑成功', [], 1, 1);
}

View File

@ -417,7 +417,7 @@ class BeforehandOrderLogic extends BaseLogic
'code' => $res['code'],
'unit' => $arr['unit'] ?? 0,
];
WarehouseProductLogic::setOutbound($data);
WarehouseProductLogic::setOutbound($data,1,$admin_id);
}
$finds = WarehouseProduct::where('oid', $res['id'])->field('sum(nums) as nums,sum(total_price) as total_price')->find();
WarehouseOrder::where('id', $res['id'])->update(['total_price' => $finds['total_price'], 'nums' => $finds['nums']]);
@ -491,7 +491,7 @@ class BeforehandOrderLogic extends BaseLogic
'code' => $res['code'],
'unit' => $arr['unit'] ?? 0,
];
WarehouseProductLogic::setOutbound($data);
WarehouseProductLogic::setOutbound($data,1,$admin_id);
}
$finds = WarehouseProduct::where('oid', $res['id'])->field('sum(nums) as nums,sum(total_price) as total_price')->find();
WarehouseOrder::where('id', $res['id'])->update(['total_price' => $finds['total_price'], 'nums' => $finds['nums']]);

View File

@ -254,7 +254,7 @@ class BeforehandOrderCartInfoLogic extends BaseLogic
StoreProduct::where('id',$v['product_id'])->save($product_arr);
}
if ($data['nums'] > 0) {
WarehouseProductLogic::add($data);
WarehouseProductLogic::add($data,1,$params['admin_id']);
}
PurchaseProductOffer::where('id', $v['id'])->update(['status' => 1, 'is_storage' => 1]);
}

View File

@ -27,7 +27,7 @@ class InventoryTransferLogic extends BaseLogic
* @author admin
* @date 2024/08/13 16:18
*/
public static function add(array $params): bool
public static function add(array $params,$admin_id=0): bool
{
$one_before_nums = 0;
$one_after_nums = 0;
@ -84,20 +84,20 @@ class InventoryTransferLogic extends BaseLogic
if($params['one_type']==1){
$find=StoreBranchProduct::where('product_id', $params['product_id'])->where('store_id', $params['one_id'])->find();
$find->save(['stock' =>bcsub( $find['stock'],$params['nums'],2)]);
SqlChannelLog('StoreBranchProduct', $find['id'], $params['nums'], -1, Request()->url());
SqlChannelLog('StoreBranchProduct', $find['id'], $params['nums'], -1, Request()->url(),$admin_id);
} elseif ($params['one_type'] == 2) {
$find=WarehouseProductStorege::where('product_id', $params['product_id'])->where('warehouse_id', $params['one_id'])->find();
$find->save(['nums' =>bcsub( $find['nums'],$params['nums'],2)]);
SqlChannelLog('WarehouseProductStorege', $find['id'], $params['nums'], -1, Request()->url());
SqlChannelLog('WarehouseProductStorege', $find['id'], $params['nums'], -1, Request()->url(),$admin_id);
}
if($params['two_type']==1){
$find=StoreBranchProduct::where('product_id', $params['product_id'])->where('store_id', $params['two_id'])->find();
$find->save(['stock' =>bcadd( $find['stock'],$params['nums'],2)]);
SqlChannelLog('StoreBranchProduct', $find['id'], $params['nums'], 1, Request()->url());
SqlChannelLog('StoreBranchProduct', $find['id'], $params['nums'], 1, Request()->url(),$admin_id);
} elseif ($params['two_type'] == 2) {
$find=WarehouseProductStorege::where('product_id', $params['product_id'])->where('warehouse_id', $params['two_id'])->find();
$find->save(['nums' =>bcadd( $find['nums'],$params['nums'],2)]);
SqlChannelLog('WarehouseProductStorege', $find['id'], $params['nums'], 1, Request()->url());
SqlChannelLog('WarehouseProductStorege', $find['id'], $params['nums'], 1, Request()->url(),$admin_id);
}
Db::commit();
return true;

View File

@ -267,17 +267,17 @@ class WarehouseLogic extends BaseLogic
/**
* 负库存更新归0
*/
public static function updateNegativeZero($parmas)
public static function updateNegativeZero($parmas,$admin_id=0)
{
if ($parmas['type'] == 1) {
$res = StoreProduct::where('id', $parmas['id'])->update(['stock' => 0]);
SqlChannelLog('StoreProduct', $parmas['id'], 0, 0, Request()->url());
SqlChannelLog('StoreProduct', $parmas['id'], 0, 0, Request()->url(),$admin_id);
} elseif ($parmas['type'] == 2) {
$res = StoreBranchProduct::where('id', $parmas['id'])->update(['stock' => 0]);
SqlChannelLog('StoreBranchProduct', $parmas['id'], 0, 0, Request()->url());
SqlChannelLog('StoreBranchProduct', $parmas['id'], 0, 0, Request()->url(),$admin_id);
} elseif ($parmas['type'] == 3) {
$res = WarehouseProductStorege::where('id', $parmas['id'])->update(['nums' => 0]);
SqlChannelLog('WarehouseProductStorege', $parmas['id'], 0, 0, Request()->url());
SqlChannelLog('WarehouseProductStorege', $parmas['id'], 0, 0, Request()->url(),$admin_id);
}
return $res;
}

View File

@ -77,7 +77,7 @@ class StoreBranchProductLogic extends BaseLogic
* @author admin
* @date 2024/06/07 13:56
*/
public static function stock(array $params, $type = 1): bool
public static function stock(array $params, $type = 1,$admin_id=0): bool
{
Db::startTrans();
try {
@ -88,7 +88,7 @@ class StoreBranchProductLogic extends BaseLogic
$branchStock = bcadd($storeBranchProduct['stock'], $params['nums'], 2);
StoreBranchProduct::update(['stock' => $branchStock, 'total_price' => bcmul($branchStock, $find['purchase'], 2)],['id'=> $params['id']]);
SqlChannelLog('StoreBranchProduct', $params['id'], $params['nums'], 1, Request()->url());
SqlChannelLog('StoreBranchProduct', $params['id'], $params['nums'], 1, Request()->url(),$admin_id);
StoreProduct::update(['stock' => $stock, 'total_price' => bcmul($stock, $find['purchase'], 2)],['id'=> $params['product_id']]);
} else {
@ -96,7 +96,7 @@ class StoreBranchProductLogic extends BaseLogic
$stock = bcsub($find['stock'], $params['nums'], 2);
StoreBranchProduct::where('id', $params['id'])->update(['stock' => $branchStock, 'total_price' => bcmul($branchStock, $find['purchase'], 2)],['id'=>$params['id']]);
SqlChannelLog('StoreBranchProduct', $params['id'], $params['nums'], -1, Request()->url());
SqlChannelLog('StoreBranchProduct', $params['id'], $params['nums'], -1, Request()->url(),$admin_id);
StoreProduct::where('id', $params['product_id'])->update(['stock' => $stock, 'total_price' => bcmul($stock, $find['purchase'], 2)],['id'=>$params['product_id']]);
}

View File

@ -59,7 +59,7 @@ class SystemStoreStorageLogic extends BaseLogic
* @author admin
* @date 2024/06/06 17:06
*/
public static function edit(array $params): bool
public static function edit(array $params,$admin_id=0): bool
{
Db::startTrans();
try {
@ -70,13 +70,13 @@ class SystemStoreStorageLogic extends BaseLogic
$branch_product=StoreBranchProduct::where(['product_id'=>$find['product_id'],'store_id'=>$find['store_id']])->find();
if($branch_product){
$branch_product->save(['stock'=>$branch_product['stock']+$find['nums']]);
SqlChannelLog('StoreBranchProduct', $branch_product['id'], $find['nums'], 1,Request()->url());
SqlChannelLog('StoreBranchProduct', $branch_product['id'], $find['nums'], 1,Request()->url(),$admin_id);
}else{
$storeProduct = StoreProduct::where('id', $find['product_id'])->findOrEmpty();
$storeBranchProduct = StoreProductLogic::ordinary(['id' => $find['product_id']], $find['store_id'], 0, $storeProduct);
$storeBranchProduct->stock = $find['nums'];
$storeBranchProduct->save();
SqlChannelLog('StoreBranchProduct', $storeBranchProduct['id'], $find['nums'], 1,Request()->url());
SqlChannelLog('StoreBranchProduct', $storeBranchProduct['id'], $find['nums'], 1,Request()->url(),$admin_id);
}
}else{
$find->save(['status'=>1,'staff_id'=>$params['staff_id']??0,'admin_id'=>$params['admin_id']??0,'mark'=>'确认时间:'.date('Y-m-d H:i:s',time())]);

View File

@ -67,7 +67,7 @@ class WarehouseOrderLogic extends BaseLogic
if (!empty($v['expiration_date'])) {
$data['expiration_date'] = $v['expiration_date'];
}
WarehouseProductLogic::add($data);
WarehouseProductLogic::add($data,1,$params['admin_id']);
}
Db::commit();
return true;
@ -118,7 +118,7 @@ class WarehouseOrderLogic extends BaseLogic
$data['purchase'] = $v['prices'];
$data['total_price'] = bcmul($v['prices'], $v['nums'], 2);
}
WarehouseProductLogic::add($data);
WarehouseProductLogic::add($data,1,$params['admin_id']);
}
$find = WarehouseProduct::where('oid', $params['id'])->field('sum(nums) as nums,sum(total_price) as total_price')->find();
if ($find) {

View File

@ -33,7 +33,7 @@ class WarehouseProductLogic extends BaseLogic
* @author admin
* @date 2024/07/31 16:55
*/
public static function add(array $params, $type = 1)
public static function add(array $params, $type = 1,$admin_id=0)
{
// Db::startTrans();
try {
@ -53,7 +53,7 @@ class WarehouseProductLogic extends BaseLogic
$total_price = bcmul($after_nums, $storeProduct['purchase'], 2);
}
WarehouseProductStorege::update(['nums' => $after_nums, 'total_price' => $total_price], ['id' => $storege['id']]);
SqlChannelLog('WarehouseProductStorege', $storege['id'], $after_nums, 1, Request()->url());
SqlChannelLog('WarehouseProductStorege', $storege['id'], $after_nums, 1, Request()->url(),$admin_id);
}
} else {
@ -77,7 +77,7 @@ class WarehouseProductLogic extends BaseLogic
$data['nums'] = -$params['nums'];
}
$storege = WarehouseProductStorege::create($data);
SqlChannelLog('WarehouseProductStorege', $storege['id'], -$params['nums'], 1, Request()->url());
SqlChannelLog('WarehouseProductStorege', $storege['id'], -$params['nums'], 1, Request()->url(),$admin_id);
}
}
@ -110,7 +110,7 @@ class WarehouseProductLogic extends BaseLogic
$data['expiration_date'] = strtotime($params['expiration_date']);
}
$res = WarehouseProduct::create($data);
SqlChannelLog('WarehouseProduct', $res['id'], $params['nums'], $params['financial_pm'] == 1 ? 1 : -1, Request()->url());
SqlChannelLog('WarehouseProduct', $res['id'], $params['nums'], $params['financial_pm'] == 1 ? 1 : -1, Request()->url(),$admin_id);
return $res;
} catch (\Throwable $e) {
@ -121,7 +121,7 @@ class WarehouseProductLogic extends BaseLogic
/**
* 设置出库商品
*/
public static function setOutbound(array $params, $type = 1)
public static function setOutbound(array $params, $type = 1,$admin_id=0)
{
Db::startTrans();
try {
@ -144,7 +144,7 @@ class WarehouseProductLogic extends BaseLogic
$after_nums = bcsub($storege['nums'], $params['nums']);
$total_price = bcmul($after_nums, $params['purchase'], 2);
WarehouseProductStorege::update(['nums' => bcsub($storege['nums'], $params['nums']), 'total_price' => $total_price], ['id' => $storege['id']]);
SqlChannelLog('WarehouseProductStorege', $storege['id'], bcsub($storege['nums'], $params['nums']), -1, Request()->url());
SqlChannelLog('WarehouseProductStorege', $storege['id'], bcsub($storege['nums'], $params['nums']), -1, Request()->url(),$admin_id);
} else {
$data = [
'warehouse_id' => $params['warehouse_id'],
@ -153,7 +153,7 @@ class WarehouseProductLogic extends BaseLogic
'total_price' => 0
];
$storege = WarehouseProductStorege::create($data);
SqlChannelLog('WarehouseProductStorege', $storege->id, -$params['nums'], -1, Request()->url());
SqlChannelLog('WarehouseProductStorege', $storege->id, -$params['nums'], -1, Request()->url(),$admin_id);
}
} else {
$storege['nums'] = 0;
@ -182,7 +182,7 @@ class WarehouseProductLogic extends BaseLogic
'mark' => $params['mark'] ?? '',
];
$res = WarehouseProduct::create($data);
SqlChannelLog('WarehouseProduct', $res->id, $params['nums'], $params['financial_pm'] == 1 ? 1 : -1, Request()->url());
SqlChannelLog('WarehouseProduct', $res->id, $params['nums'], $params['financial_pm'] == 1 ? 1 : -1, Request()->url(),$admin_id);
Db::commit();
return $res;
@ -249,17 +249,17 @@ class WarehouseProductLogic extends BaseLogic
* @author admin
* @date 2024/07/31 16:55
*/
public static function delete(array $params): bool
public static function delete(array $params,$admin_id=0): bool
{
$res = WarehouseProduct::where('id', $params['id'])->find();
if ($res) {
$res->delete();
if ($res['financial_pm'] == 1) {
$find = WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->dec('nums', $res['nums'])->save();
SqlChannelLog('WarehouseProductStorege', $find['id'], $res['nums'], -1, Request()->url());
SqlChannelLog('WarehouseProductStorege', $find['id'], $res['nums'], -1, Request()->url(),$admin_id);
} elseif ($res['financial_pm'] == 0) {
$find = WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])->where('product_id', $res['product_id'])->inc('nums', $res['nums'])->save();
SqlChannelLog('WarehouseProductStorege', $find['id'], $res['nums'], 1, Request()->url());
SqlChannelLog('WarehouseProductStorege', $find['id'], $res['nums'], 1, Request()->url(),$admin_id);
}
$find = WarehouseProduct::where('oid', $res['oid'])->field('sum(nums) as nums,sum(total_price) as total_price')->find();
if ($find) {
@ -300,14 +300,14 @@ class WarehouseProductLogic extends BaseLogic
* @param $id
* @return void
*/
public static function settNums($params)
public static function settNums($params,$admin_id=0)
{
Db::startTrans();
try {
$res = WarehouseProduct::where('id', $params['id'])->find();
if ($res) {
self::decStock($res);
self::incStock($res, $params);
self::decStock($res,$admin_id);
self::incStock($res, $params,$admin_id);
$datas = [
'nums' => $params['nums'],
'total_price' => bcmul($params['nums'], $res['price'], 2),
@ -344,28 +344,28 @@ class WarehouseProductLogic extends BaseLogic
}
//减少
private static function decStock($res)
private static function decStock($res,$admin_id=0)
{
$res1 = WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])
->where('product_id', $res['product_id'])->find();
$res1->save(['nums'=>bcsub($res1['nums'], $res['nums'],2)]);
SqlChannelLog('WarehouseProductStorege', $res1['id'], $res['nums'], -1, Request()->url());
SqlChannelLog('WarehouseProductStorege', $res1['id'], $res['nums'], -1, Request()->url(),$admin_id);
$res->save(['nums'=>bcsub($res['nums'], $res['nums'],2)]);
SqlChannelLog('WarehouseProduct', $res['id'], $res['nums'], -1, Request()->url());
SqlChannelLog('WarehouseProduct', $res['id'], $res['nums'], -1, Request()->url(),$admin_id);
}
//增加
private static function incStock($res, $params)
private static function incStock($res, $params,$admin_id=0)
{
$res1 = WarehouseProductStorege::where('warehouse_id', $res['warehouse_id'])
->where('product_id', $res['product_id'])
->find();
$res1->save(['nums'=>bcadd($res1['nums'], $params['nums'],2)]);
SqlChannelLog('WarehouseProductStorege', $res1['id'], $res['nums'], 1, Request()->url());
SqlChannelLog('WarehouseProductStorege', $res1['id'], $res['nums'], 1, Request()->url(),$admin_id);
$res->save(['nums'=>bcadd($res['nums'], $params['nums'],2)]);
SqlChannelLog('WarehouseProduct', $res['id'], $res['nums'], 1, Request()->url());
SqlChannelLog('WarehouseProduct', $res['id'], $res['nums'], 1, Request()->url(),$admin_id);
}
}

View File

@ -116,11 +116,11 @@ class WarehouseProductReturnLogic extends BaseLogic
}
$res=WarehouseProductStorege::where(['product_id' => $find['product_id'], 'warehouse_id' => $find['warehouse_id']])->find();
$res->save(['nums' =>bcadd( $res['nums'],$params['nums'],2)]);
SqlChannelLog('WarehouseProductStorege', $res['id'], $params['nums'], 1, Request()->url());
SqlChannelLog('WarehouseProductStorege', $res['id'], $params['nums'], 1, Request()->url(),$params['admin_id']);
} elseif ($params['financial_pm'] == 0 && $params['return_type'] == 2) {
$res=WarehouseProductStorege::where(['product_id' => $find['product_id'], 'warehouse_id' => $find['warehouse_id']])->find();
$res->save(['nums' =>bcsub( $res['nums'],$params['nums'],2)]);
SqlChannelLog('WarehouseProductStorege', $res['id'], $params['nums'], -1, Request()->url());
SqlChannelLog('WarehouseProductStorege', $res['id'], $params['nums'], -1, Request()->url(),$params['admin_id']);
}
}

View File

@ -37,14 +37,14 @@ class WarehouseProductStoregeLogic extends BaseLogic
* @author admin
* @date 2024/08/01 10:22
*/
public static function edit(array $params): bool
public static function edit(array $params,$admin_id=0): bool
{
Db::startTrans();
try {
$find=WarehouseProductStorege::where('id',$params['id'])->find();
if($find){
$find->save(['nums'=>$params['nums']]);
SqlChannelLog('WarehouseProductStorege', $params['id'], $params['nums'], 0,Request()->url());
SqlChannelLog('WarehouseProductStorege', $params['id'], $params['nums'], 0,Request()->url(),$admin_id);
}
Db::commit();
return true;

View File

@ -315,13 +315,9 @@ class IndexController extends BaseApiController
public function aa(){
$boyd = $this->request->post();
// 计算body的MD5值
$microtime = microtime(true);
// 将秒和微秒数转换为毫秒级时间戳
$millisecondTimestamp = number_format($microtime * 1000, 0, '', '');
// 输出结果
$time = $millisecondTimestamp;
$time = $this->request->header('timestamp');
// 需要签名的数据
$data = [

View File

@ -7,7 +7,7 @@ use app\common\model\change_log\ChangeLog;
class ChangeLogLogic extends BaseLogic
{
public function insert($model='',$link_id=0,$nums=0,$pm=0,$url=''):void
public function insert($model='',$link_id=0,$nums=0,$pm=0,$url='',$admin_id=0):void
{
$info=\Chance\Log\facades\OperationLog::getLog();
ChangeLog::create([
@ -17,6 +17,7 @@ class ChangeLogLogic extends BaseLogic
'pm' => $pm,
'mark' => $info,
'url' => $url,
'admin_id' => $admin_id,
'create_time' => time()
]);
\Chance\Log\facades\OperationLog::clearLog();

View File

@ -555,9 +555,9 @@ function channelLog($data, $type, $title = '更新前')
* @param pm 1:增加 -1:减少
* @param url 请求地址
*/
function SqlChannelLog($model='', $id=0, $nums=0,$pm=0,$url=''):void
function SqlChannelLog($model='', $id=0, $nums=0,$pm=0,$url='',$admin_id=0):void
{
(new ChangeLogLogic())->insert($model, $id, $nums, $pm, $url);
(new ChangeLogLogic())->insert($model, $id, $nums, $pm, $url,$admin_id);
}
// if (!function_exists('getNewOrderSn')) {