增加同步crm
This commit is contained in:
@@ -7,6 +7,7 @@ use app\common\traits\crud\CrudServiceTrait;
|
||||
use app\common\model\InquiryLog;
|
||||
use support\exception\BusinessException;
|
||||
use support\Request;
|
||||
use Webman\RedisQueue\Redis as RedisQueueRedis;
|
||||
|
||||
class InquiryLogService
|
||||
{
|
||||
@@ -39,7 +40,7 @@ class InquiryLogService
|
||||
$data = $this->preProcess('Release', $data, $request);
|
||||
$config = $this->buildQueryConfig($request, 'release');
|
||||
$updated = $this->logicUpdateBy($config, $data);
|
||||
return $this->postProcess('Release', $updated);
|
||||
return $this->postProcess('Release', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -50,7 +51,7 @@ class InquiryLogService
|
||||
$data = $this->preProcess('Allocation', $data, $request);
|
||||
$config = $this->buildQueryConfig($request, 'allocation');
|
||||
$updated = $this->logicUpdateBy($config, $data);
|
||||
return $this->postProcess('Allocation', $updated);
|
||||
return $this->postProcess('Allocation', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,7 +140,7 @@ class InquiryLogService
|
||||
throw new BusinessException('数据不存在');
|
||||
}
|
||||
if ($info->status != 0) {
|
||||
throw new BusinessException('询单已发布');
|
||||
throw new BusinessException('询单已被发布');
|
||||
}
|
||||
$data['r_time'] = time();
|
||||
$data['status'] = 1;
|
||||
@@ -158,8 +159,29 @@ class InquiryLogService
|
||||
if ($info->status == 2) {
|
||||
throw new BusinessException('询单已被分配');
|
||||
}
|
||||
if ($info->status == 0) {
|
||||
$data['r_time'] = time();
|
||||
}
|
||||
$data['t_time'] = time();
|
||||
$data['status'] = 2;
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布后置处理
|
||||
*/
|
||||
protected function afterServiceRelease($res)
|
||||
{
|
||||
RedisQueueRedis::send('inquiry-to-crm', $res);
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分配后置处理
|
||||
*/
|
||||
protected function afterServiceAllocation($res)
|
||||
{
|
||||
RedisQueueRedis::send('inquiry-to-crm', $res);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user