Files
fdesk/app/crmAdmin/logic/CustomerLogic.php
T

34 lines
707 B
PHP
Raw Normal View History

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();
2025-08-06 15:28:29 +08:00
2025-08-14 20:08:57 +08:00
if($status == 1){
$customer->restore();
}
2025-08-19 13:54:19 +08:00
2025-08-01 14:20:12 +08:00
return $res;
}
2025-11-17 10:05:29 +08:00
public function forceDelete(int $id ,string $status_desc = '')
2025-08-01 14:20:12 +08:00
{
2025-08-06 15:56:57 +08:00
$customer = Customer::withTrashed()->find($id);
2025-08-01 17:18:08 +08:00
//强制删除
2025-08-14 20:08:57 +08:00
// $res = $customer->forceDelete();
$customer->status = 3;
2025-11-17 10:05:29 +08:00
$customer->status_desc = $status_desc;
2025-08-14 20:08:57 +08:00
$res = $customer->save();
2025-08-01 14:20:12 +08:00
return $res;
}
}