master
wangxinglong 2022-04-07 14:40:32 +08:00
parent f9642ea6cd
commit b9416da959
1 changed files with 6 additions and 0 deletions

View File

@ -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)