SCTMES_V5/mes_in_sct/app/event/SetProcessInputAmountEvent.php

30 lines
639 B
PHP
Raw Permalink Normal View History

2025-06-14 18:55:09 +08:00
<?php
namespace app\event;
use Exception;
use libs\db\Db;
use libs\listener\Event;
class SetProcessInputAmountEvent extends Event
{
public function handle($data)
{
$batch = $data['batch'];
//查询批次表
$sql = sprintf(
"UPDATE
\"hf_mes_production_planning_management_batch\" SET input_amount = input_amount + %s
WHERE batch='%s' ;",
1,
$batch
);
$ret = Db::query($sql);
if ($ret < 1 ) {
throw new Exception("批次[{$batch}]电芯数更新失败");
}
return $data;
}
}