From b9416da95933f3cfa3e64c0249c993679adb7d2c Mon Sep 17 00:00:00 2001 From: wangxinglong <2371974647@qq.com> Date: Thu, 7 Apr 2022 14:40:32 +0800 Subject: [PATCH] setter --- app/repository/BusinessRepository.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/repository/BusinessRepository.php b/app/repository/BusinessRepository.php index 845d303..329e7a4 100644 --- a/app/repository/BusinessRepository.php +++ b/app/repository/BusinessRepository.php @@ -229,6 +229,9 @@ class BusinessRepository extends Repository */ public function agencyHasBusinessCount($agencyCode) { + if(empty($agencyCode)){ + return 0; + } return Business::where("agency_code", $agencyCode)->count(); } @@ -239,6 +242,9 @@ class BusinessRepository extends Repository */ public function agencyHasCouponCount($agencyCode) { + if(empty($agencyCode)){ + return 0; + } return Business::alias("a") ->join("coupon_main b", "a.code =b.business_code") ->where("a.agency_code", $agencyCode)