更新删除数据处理

This commit is contained in:
yaooo 2023-11-29 17:29:12 +08:00
parent fd5077e500
commit 7a50e0ec34
3 changed files with 5 additions and 0 deletions

View File

@ -125,6 +125,9 @@ class DeviceLogic extends BaseLogic
*/ */
public static function delete(array $params): bool public static function delete(array $params): bool
{ {
Db::name('product_device')->where('device_id', $params['id'])->delete();
Db::name('device_monitor_data')->where('device_id', $params['id'])->delete();
Db::name('monitor_alarm')->where('device_id', $params['id'])->delete();
return Device::destroy($params['id']); return Device::destroy($params['id']);
} }

View File

@ -108,6 +108,7 @@ class LandPlantLogic extends BaseLogic
*/ */
public static function delete(array $params): bool public static function delete(array $params): bool
{ {
Db::name('land_plant_action')->where('plant_id', $params['id'])->delete();
return LandPlant::destroy($params['id']); return LandPlant::destroy($params['id']);
} }

View File

@ -106,6 +106,7 @@ class ProductLogic extends BaseLogic
public static function delete(array $params): bool public static function delete(array $params): bool
{ {
Db::name('land_product')->where('product_id', $params['id'])->delete(); Db::name('land_product')->where('product_id', $params['id'])->delete();
Db::name('monitor_data')->where('product_id', $params['id'])->delete();
return Product::destroy($params['id']); return Product::destroy($params['id']);
} }