Files
fdesk/app/crmAdmin/logic/CustomerLogic.php
T
2025-11-17 10:05:29 +08:00

34 lines
707 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 ,string $status_desc = '')
{
$customer = Customer::withTrashed()->find($id);
//强制删除
// $res = $customer->forceDelete();
$customer->status = 3;
$customer->status_desc = $status_desc;
$res = $customer->save();
return $res;
}
}