добавлено обновление данных менеджеров по сделкам из битрикса
This commit is contained in:
parent
7a54d26bba
commit
60213e9ebe
@ -13,7 +13,7 @@ class ContractUpdateController
|
|||||||
{
|
{
|
||||||
public function __invoke(Deal $deal, Request $request)
|
public function __invoke(Deal $deal, Request $request)
|
||||||
{
|
{
|
||||||
$status =
|
$contract =
|
||||||
Contract::updateOrCreate(
|
Contract::updateOrCreate(
|
||||||
['deal_id' => $deal->id],
|
['deal_id' => $deal->id],
|
||||||
[
|
[
|
||||||
@ -31,12 +31,19 @@ public function __invoke(Deal $deal, Request $request)
|
|||||||
'base64_image' => $request->plan_image
|
'base64_image' => $request->plan_image
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
$addInfo = $contract->add_info;
|
||||||
|
if ($request->has('manager_name')) {
|
||||||
|
$addInfo['manager']['name'] = $request->manager_name;
|
||||||
|
}
|
||||||
|
if ($request->has('manager_phone')) {
|
||||||
|
$addInfo['manager']['phone'] = $request->manager_phone;
|
||||||
|
}
|
||||||
|
if ($request->has('manager_email')) {
|
||||||
|
$addInfo['manager']['email'] = $request->manager_email;
|
||||||
|
}
|
||||||
|
$contract->add_info = $addInfo;
|
||||||
|
$contract->save();
|
||||||
$agent = $deal->agent;
|
$agent = $deal->agent;
|
||||||
/*if (!$deal->bitrixId)
|
|
||||||
{
|
|
||||||
$deal->bitrixId()->create(['bx_id' => $request->deal_id]);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
$agent->user->notify(new ContractUpdated($deal->contract));
|
$agent->user->notify(new ContractUpdated($deal->contract));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user