chemex/app/Services/ConsumableService.php

39 lines
766 B
PHP
Raw Normal View History

2022-06-24 13:47:11 +08:00
<?php
namespace App\Services;
use App\Models\ConsumableRecord;
class ConsumableService
{
/**
* 配件删除.
*
* @param $consumable_id
*/
public static function consumableDelete($consumable_id)
{
$consumable = ConsumableRecord::where('id', $consumable_id)->first();
if (!empty($consumable)) {
$consumable->delete();
}
}
/**
* 删除配件(强制).
*
* @param $consumable_id
*/
public static function consumableForceDelete($consumable_id)
{
$consumable = ConsumableRecord::where('id', $consumable_id)
->withTrashed()
->first();
if (!empty($consumable)) {
$consumable->forceDelete();
}
}
}