|
|
@ -8342,16 +8342,15 @@ class FinanceController extends \frontend\controllers\UserBaseController |
|
|
|
$info['linkmans'] = is_array($info['linkmans']) ? $info['linkmans'] : explode(',', $info['linkmans']); |
|
|
|
$info['linkmans'] = is_array($info['linkmans']) ? $info['linkmans'] : explode(',', $info['linkmans']); |
|
|
|
foreach ($info['linkphones'] as $k => $link) { |
|
|
|
foreach ($info['linkphones'] as $k => $link) { |
|
|
|
if(!$link) continue; |
|
|
|
if(!$link) continue; |
|
|
|
$linkman_info = LinkmanT::findOne(['car_id' => $id, 'phone' => $link]); |
|
|
|
$linkman_info = LinkmanT::findOne(['car_id' => $car_info->id, 'phone' => $link]); |
|
|
|
if(!$linkman_info){ |
|
|
|
if(!$linkman_info){ |
|
|
|
$linkman_info = new LinkmanT(); |
|
|
|
$linkman_info = new LinkmanT(); |
|
|
|
} |
|
|
|
} |
|
|
|
$linkman_info->car_id = $id; |
|
|
|
$linkman_info->car_id = $car_info->id; |
|
|
|
$linkman_info->phone = $link; |
|
|
|
$linkman_info->phone = $link; |
|
|
|
$linkman_info->name = $info['linkmans'][$k]; |
|
|
|
$linkman_info->name = $info['linkmans'][$k]; |
|
|
|
$linkman_info->type = '联系人'; |
|
|
|
$linkman_info->type = '联系人'; |
|
|
|
if (!$linkman_info->save()) throw new \Exception("联系人信息保存:" . json_encode($linkman_info->getErrors(),JSON_UNESCAPED_UNICODE)); |
|
|
|
if (!$linkman_info->save()) throw new \Exception("联系人信息保存:" . json_encode($linkman_info->getErrors(),JSON_UNESCAPED_UNICODE)); |
|
|
|
exit(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
unset($car_info,$kehu_info,$linkman_info); |
|
|
|
unset($car_info,$kehu_info,$linkman_info); |
|
|
|
$result['success'] = true; |
|
|
|
$result['success'] = true; |
|
|
|