列表配置调试及多个电话字段显示调试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:'车辆信息',
url: '{:url("/index/carInfo/")}', //数据接口
where: getUrlParam('Object'),
defaultToolbar: ['filter', 'print', 'exports', {
title: '提示' //标题
,layEvent: 'LAYTABLE_TIPS' //事件名,用于 toolbar 事件中使用
,icon: 'layui-icon-tips' //图标类名
}],
toolbar: true,
page: true, //开启分页
limit: 20,
loading: true,

@ -359,9 +359,9 @@ class CarInfoHandle
$phones = [$source['car_phone']];
$phones_a = [$source_a['car_phone']];
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];
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 = array_unique(array_merge($phones_a, $phones));
@ -369,7 +369,7 @@ class CarInfoHandle
if (count($phones) <= 6) {
array_shift($phones);
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);
if (empty($source_a[$key]))
break;

Loading…
Cancel
Save