Merge branch 'feature/inv' into develop

This commit is contained in:
2026-02-24 16:16:00 +08:00
2 changed files with 21 additions and 1 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ class InvItemController extends BaseController
}
// 获取应用访问地址
$appUrl = config('app.app_url', 'http://127.0.0.1:25616');
$appUrl = 'https://'.$request->host();
$qrCodeService = new \app\common\service\QrCodeService();
$content = $qrCodeService->generateItemQrCode($id, $appUrl);
+20
View File
@@ -141,6 +141,26 @@ class InvItemService
], $res['stock_qty']);
}
public function beforeServiceUpdate($data, Request $request)
{
$uid = $request->user->uid;
$name = $uid ? User::where('id', $uid)->value('name') : '';
$item = InvItem::where('id', $data['id'])->first();
$change_qty = $data['change_qty'] - $item['stock_qty'];
// 记录库存变化日志
$this->recordStockLog([
'item_id' => $data['id'],
'item_name_snap' => $data['item_name'],
'change_qty' => $change_qty,
'before_qty' => $item['stock_qty'],
'after_qty' => $data['stock_qty'],
'biz_type' => 1,
'biz_no' => '',
'operator_id' => $uid,
'operator_name' => $name,
'remark' => '管理员修改数量',
], $change_qty);
}
/**
* 变动物品库存数量