This commit is contained in:
weiz 2023-10-28 17:57:18 +08:00
parent 17d3d2598f
commit b5a824f1eb
1 changed files with 4 additions and 4 deletions

View File

@ -136,11 +136,11 @@
//更新动物状态
public function animalStatus(): Json
{
$params = $this->request->post(['animal_id','status','weight']);
$params = $this->request->post(['animal_id','status','animal_weight']);
if(empty($params['animal_id'])){
return $this->fail('参数错误');
}
if(empty($params['status']) && empty($params['weight'])){
if(empty($params['status']) && empty($params['animal_weight'])){
return $this->fail('没有可更改的项');
}
//获取元数据
@ -161,9 +161,9 @@
$textData['状态变更']['新状态'] = $this->getStatusText($params['status']);
}
if(!empty($params['weight'])){
$updateData['animal_weight'] = $params['weight'];
$updateData['animal_weight'] = $params['animal_weight'];
$textData['体重变更']['原体重'] = $data['animal_weight'];
$textData['体重变更']['新体重'] = $params['weight'];
$textData['体重变更']['新体重'] = $params['animal_weight'];
}
//设置数据
$saveData = [