dbms_primeidc_init...1

This commit is contained in:
최준흠 2025-04-09 11:03:50 +09:00
parent c87c37dcc6
commit 9de5af04be
3 changed files with 5 additions and 6 deletions

View File

@ -220,9 +220,9 @@ class QueryBuilder
return $results[0] ?? null; return $results[0] ?? null;
} }
public function count(): int public function count(string $select = "'COUNT(*) as cnt'"): int
{ {
$this->select = ['COUNT(*) as cnt']; $this->select = [$select];
$results = $this->get(); $results = $this->get();
return (int)($results[0]['cnt'] ?? 0); return (int)($results[0]['cnt'] ?? 0);
} }

View File

@ -42,9 +42,9 @@ abstract class CommonService extends Core
} }
return $entitys; return $entitys;
} // } //
final public function getCount(): int final public function getCount(string $select = "'COUNT(*) as cnt'"): int
{ {
$count = $this->getModel()->count(); $count = $this->getModel()->count($select);
// echo "<BR>" . $this->getModel()->getLastQuery(); // echo "<BR>" . $this->getModel()->getLastQuery();
return $count; return $count;
} }

View File

@ -114,9 +114,8 @@ class ServiceService extends CommonService
//사용자별용 서비스 쿠폰 //사용자별용 서비스 쿠폰
public function getCouponCountByClient(string $client_code): int public function getCouponCountByClient(string $client_code): int
{ {
$this->getModel()->select("SUM(coupon) as coupon");
$this->getModel()->where("client_code", "{$client_code}"); $this->getModel()->where("client_code", "{$client_code}");
$this->getModel()->whereNotIn("service_line", ['vpn', 'test', 'solo', 'substitution', 'event']); $this->getModel()->whereNotIn("service_line", ['vpn', 'test', 'solo', 'substitution', 'event']);
return $this->getModel()->getResult()['coupon']; return $this->getCount("SUM(coupon) as cnt");
} }
} }