列表配置调试及多个电话字段显示调试2

master
zhaocheng 2 years ago
parent 892132843c
commit e3a91dd636
  1. 6
      app/view/index/index.html
  2. 6
      extend/service/CarInfoHandle.php

@ -223,11 +223,7 @@
title:'车辆信息', title:'车辆信息',
url: '{:url("/index/carInfo/")}', //数据接口 url: '{:url("/index/carInfo/")}', //数据接口
where: getUrlParam('Object'), where: getUrlParam('Object'),
defaultToolbar: ['filter', 'print', 'exports', { toolbar: true,
title: '提示' //标题
,layEvent: 'LAYTABLE_TIPS' //事件名,用于 toolbar 事件中使用
,icon: 'layui-icon-tips' //图标类名
}],
page: true, //开启分页 page: true, //开启分页
limit: 20, limit: 20,
loading: true, loading: true,

@ -359,9 +359,9 @@ class CarInfoHandle
$phones = [$source['car_phone']]; $phones = [$source['car_phone']];
$phones_a = [$source_a['car_phone']]; $phones_a = [$source_a['car_phone']];
foreach (['id_phone', 'insured_phone', 'link_phone_1', 'link_phone_2', 'link_phone_3'] as $key) { foreach (['id_phone', 'insured_phone', 'link_phone_1', 'link_phone_2', 'link_phone_3'] as $key) {
if (preg_match('/^1[3-9][0-9]{9}/', $source_a[$key]) && !in_array($phones_a, $source_a[$key])) if (preg_match('/^1[3-9][0-9]{9}/', $source_a[$key]) && !in_array($source_a[$key], $phones_a))
$phones_a[] = $source_a[$key]; $phones_a[] = $source_a[$key];
if (preg_match('/^1[3-9][0-9]{9}/', $source[$key]) && !in_array($phones, $source[$key])) if (preg_match('/^1[3-9][0-9]{9}/', $source[$key]) && !in_array($source[$key], $phones))
$phones[] = $source[$key]; $phones[] = $source[$key];
} }
$phones = array_unique(array_merge($phones_a, $phones)); $phones = array_unique(array_merge($phones_a, $phones));
@ -369,7 +369,7 @@ class CarInfoHandle
if (count($phones) <= 6) { if (count($phones) <= 6) {
array_shift($phones); array_shift($phones);
foreach (['id_phone', 'insured_phone', 'link_phone_1', 'link_phone_2', 'link_phone_3'] as $key) { foreach (['id_phone', 'insured_phone', 'link_phone_1', 'link_phone_2', 'link_phone_3'] as $key) {
if (!in_array($phones, $source_a[$key])) if (!in_array($source_a[$key], $phones))
$source_a[$key] = array_shift($phones); $source_a[$key] = array_shift($phones);
if (empty($source_a[$key])) if (empty($source_a[$key]))
break; break;

Loading…
Cancel
Save