问题描述
- php看不懂。。。求指导
-
$entityGoodsInfo = array();
if (Utils::isEmptyStr($goodsId['0'])) {
$categoryGoodsList['goodsList'] = array ();
} else {
$filterExp = new Filter();
$filterExp->setQueryFilter(Filter :: $in, "goods_id", $goodsId);
//$filterExp->setQueryFilter(Filter :: $order_by, $nameSort, $orderType[0]);
$categoryGoodsList = $bizservice->getGoodsListByFilter($depotId, $categoryInfo->cat_tablename, $categoryId, $color, $material, $goodsSkuValue, implode("-", $patternValue), $price, $filterExp, $orderNames, $orderType, $curpage, $pageSize);
foreach ($goodsId as $goods_id_value) {
foreach ($categoryGoodsList['goodsList'] as $key => $value) {
if ($value->goods_id == $goods_id_value) {
array_push($entityGoodsInfo, $value);
break;
}
}
}
}
解决方案
$entityGoodsInfo是一个空数组,利用Utils的静态方法isEmptyStr判断$goodsId['0']是否为空,然后执行分支。分支主要是查询和遍历
时间: 2024-11-03 14:48:43