|
@@ -2563,7 +2563,8 @@ class Query
|
|
|
// 生成模型对象
|
|
|
if (count($resultSet) > 0) {
|
|
|
foreach ($resultSet as $key => $result) {
|
|
|
- if(count(static::$imageUrl) > 0) {
|
|
|
+ $staticImgUrl = !empty(static::$imageUrl) ? static::$imageUrl : [];//处理php7.2以上版本count报错问题
|
|
|
+ if(count($staticImgUrl) > 0) {
|
|
|
$arrkeys = array_keys($resultSet[0]);
|
|
|
foreach(static::$imageUrl as $n) {
|
|
|
if(in_array($n,$arrkeys)) {
|
|
@@ -2750,7 +2751,8 @@ class Query
|
|
|
// 数据处理
|
|
|
if (!empty($result)) {
|
|
|
if (!empty($this->model)) {
|
|
|
- if(count(static::$imageUrl) > 0) {
|
|
|
+ $staticImgUrl = !empty(static::$imageUrl) ? static::$imageUrl : [];//处理php7.2以上版本count报错问题
|
|
|
+ if(count($staticImgUrl) > 0) {
|
|
|
$arrkeys = array_keys($result);
|
|
|
foreach(static::$imageUrl as $n) {
|
|
|
if(in_array($n,$arrkeys)) {
|