Files
fdesk/app/crmAdmin/logic/CustomerLogic.php
T
2025-08-14 20:08:57 +08:00

32 lines
633 B
PHP

<?php
namespace app\crmAdmin\logic;
use app\crm\model\Customer;
class CustomerLogic
{
public function status(int $id,int $status)
{
$customer = Customer::withTrashed()->find($id);
$customer->status = $status;
$res = $customer->save();
if($status == 1){
$customer->restore();
}
return $res;
}
public function forceDelete(int $id)
{
$customer = Customer::withTrashed()->find($id);
//强制删除
// $res = $customer->forceDelete();
$customer->status = 3;
$res = $customer->save();
return $res;
}
}