审核
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
|
||||
namespace app\crm\service;
|
||||
|
||||
use app\crm\logic\CustomerLogic;
|
||||
use app\crmAdmin\logic\CustomerLogic;
|
||||
use app\crm\model\CarType;
|
||||
use app\crm\model\Channel;
|
||||
use app\crm\model\Country;
|
||||
use app\crm\model\Customer;
|
||||
use app\crm\model\CustomerHis;
|
||||
use app\crm\model\Follow;
|
||||
use app\crm\utils\Util;
|
||||
use config\constants\Constants;
|
||||
@@ -35,6 +36,7 @@ class CustomerService
|
||||
}else{
|
||||
$where[] = ['user_id', $user_id];
|
||||
}
|
||||
$where[] = ['status', 1];
|
||||
|
||||
|
||||
$grade = [];
|
||||
@@ -100,6 +102,34 @@ class CustomerService
|
||||
return $customer;
|
||||
}
|
||||
|
||||
public function report($params)
|
||||
{
|
||||
$id = $params['id'];
|
||||
$userId = $params['user_id'];
|
||||
|
||||
$where = [
|
||||
'id' => $id,
|
||||
'user_id' => $userId,
|
||||
];
|
||||
$customer = Customer::where($where)->withTrashed()->first();
|
||||
if(empty($customer)){
|
||||
return false;
|
||||
}
|
||||
|
||||
CustomerHis::create([
|
||||
'customer_id' => $id,
|
||||
'user_his' => $userId,
|
||||
'user_id' => 0,
|
||||
]);
|
||||
|
||||
$customer->status = 2;
|
||||
$res = $customer->save();
|
||||
|
||||
//软删除
|
||||
$customer->delete();
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $customer
|
||||
|
||||
Reference in New Issue
Block a user