更新种植面积
This commit is contained in:
parent
0d613a3a10
commit
170e96505e
|
@ -113,7 +113,7 @@ class LandPlantLogic extends BaseLogic
|
||||||
public static function delete(array $params): bool
|
public static function delete(array $params): bool
|
||||||
{
|
{
|
||||||
$landPlant = LandPlant::findOrEmpty($params['id'])->toArray();
|
$landPlant = LandPlant::findOrEmpty($params['id'])->toArray();
|
||||||
Land::where('id', $landPlant['land_id'])->inc('score', $landPlant['area'])->update();
|
Land::where('id', $landPlant['land_id'])->inc('residual_area', $landPlant['area'])->update();
|
||||||
Db::name('land_plant_action')->where('plant_id', $params['id'])->delete();
|
Db::name('land_plant_action')->where('plant_id', $params['id'])->delete();
|
||||||
return LandPlant::destroy($params['id']);
|
return LandPlant::destroy($params['id']);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue