mirror of
https://gitee.com/celaraze/chemex.git
synced 2024-12-04 04:08:16 +08:00
39 lines
712 B
PHP
Executable File
39 lines
712 B
PHP
Executable File
<?php
|
|
|
|
|
|
namespace App\Services;
|
|
|
|
|
|
use App\Models\ServiceRecord;
|
|
|
|
class ServiceService
|
|
{
|
|
/**
|
|
* 配件删除.
|
|
*
|
|
* @param $service_id
|
|
*/
|
|
public static function serviceDelete($service_id)
|
|
{
|
|
$service = ServiceRecord::where('id', $service_id)->first();
|
|
if (!empty($service)) {
|
|
$service->delete();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 删除配件(强制).
|
|
*
|
|
* @param $service_id
|
|
*/
|
|
public static function serviceForceDelete($service_id)
|
|
{
|
|
$service = ServiceRecord::where('id', $service_id)
|
|
->withTrashed()
|
|
->first();
|
|
if (!empty($service)) {
|
|
$service->forceDelete();
|
|
}
|
|
}
|
|
}
|