30 lines
639 B
PHP
30 lines
639 B
PHP
<?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;
|
|
}
|
|
}
|