Files
fdesk/app/crmAdmin/logic/CustomerLogic.php
T
mzl92 32a7752f8b Merge branch 'develop' into feature/mzl_dev
# Conflicts:
#	.gitignore
#	composer.lock
2025-12-02 14:17:25 +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;
}
}