dbms_primeidc_init...1
This commit is contained in:
parent
c87c37dcc6
commit
9de5af04be
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user