php数组遍历问题 10
$list=$model->page($listRows)->loadList($where,$limit,$formInfo['list_order']);查询出来Ar...
$list = $model->page($listRows)->loadList($where,$limit,$formInfo['list_order']);
查询出来
Array ( [0] => Array ( [tt_type] => 2 ) [1] => Array ( [tt_type] => 1 ) )
但是格式化后tt_type统一变成了1.
$data = array();
if(!empty($list)){
foreach ($list as $key => $value) {
$data[$key]=$value;
foreach ($fieldList as $v) {
$data[$key][$v['field']] = target('Data')->revertField($value[$v['field']],$v['type'],$v['config']);
}
}
}
帮忙看看哪里有问题? 展开
查询出来
Array ( [0] => Array ( [tt_type] => 2 ) [1] => Array ( [tt_type] => 1 ) )
但是格式化后tt_type统一变成了1.
$data = array();
if(!empty($list)){
foreach ($list as $key => $value) {
$data[$key]=$value;
foreach ($fieldList as $v) {
$data[$key][$v['field']] = target('Data')->revertField($value[$v['field']],$v['type'],$v['config']);
}
}
}
帮忙看看哪里有问题? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询