diff --git a/app/api/service/Identity.php b/app/api/service/Identity.php index b42fc9ad..d11b56e5 100644 --- a/app/api/service/Identity.php +++ b/app/api/service/Identity.php @@ -65,8 +65,8 @@ class Identity extends BaseService // 获取充值方案列表 $model = new \app\api\model\user\Identity(); $planList = $model->getList(['type' => IdentityEnum::MEMBER]); - if (!empty($planList)) { - $planList = $this->cheapPrice($planList); + if (!$planList->isEmpty()) { + $planList = $this->cheapPrice($planList->toArray()); } //计算优惠价格 // 根据指定客户端获取可用的支付方式 @@ -80,7 +80,7 @@ class Identity extends BaseService ]; } - private function cheapPrice($data) + private function cheapPrice($data): array { $one_data = $data[0]; foreach ($data as $key => $value) { @@ -114,8 +114,8 @@ class Identity extends BaseService // 获取充值方案列表 $model = new \app\api\model\user\Identity(); $planList = $model->getList(['type' => IdentityEnum::DEALER]); - if (!empty($planList)) { - $planList = $this->cheapPrice($planList); + if (!$planList->isEmpty()) { + $planList = $this->cheapPrice($planList->toArray()); } // 根据指定客户端获取可用的支付方式 $PaymentModel = new PaymentModel;