2025-08-01 14:20:12 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace app\crmAdmin\logic;
|
|
|
|
|
|
|
|
|
|
use app\crm\model\Customer;
|
|
|
|
|
|
|
|
|
|
class CustomerLogic
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public function status(int $id,int $status)
|
|
|
|
|
{
|
2025-08-06 15:25:10 +08:00
|
|
|
$customer = Customer::withTrashed()->find($id);
|
2025-08-01 14:20:12 +08:00
|
|
|
$customer->status = $status;
|
|
|
|
|
$res = $customer->save();
|
|
|
|
|
return $res;
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-01 17:18:08 +08:00
|
|
|
public function forceDelete(int $id)
|
2025-08-01 14:20:12 +08:00
|
|
|
{
|
|
|
|
|
$customer = Customer::find($id);
|
2025-08-01 17:18:08 +08:00
|
|
|
//强制删除
|
2025-08-01 14:20:12 +08:00
|
|
|
$res = $customer->forceDelete();
|
|
|
|
|
return $res;
|
|
|
|
|
}
|
|
|
|
|
}
|