123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- declare (strict_types=1);
- namespace app\services\user;
- use app\services\BaseServices;
- use app\dao\user\UserWechatUserDao;
- class UserWechatuserServices extends BaseServices
- {
-
- public function __construct(UserWechatUserDao $dao)
- {
- $this->dao = $dao;
- }
-
- public function getCount(array $where): int
- {
- return $this->dao->getCount($where);
- }
-
- public function getWhereUserList(array $where, string $field): array
- {
- [$page, $limit] = $this->getPageValue();
- $order_string = '';
- $order_arr = ['asc', 'desc'];
- if (isset($where['now_money']) && in_array($where['now_money'], $order_arr)) {
- $order_string = 'now_money ' . $where['now_money'];
- }
- $list = $this->dao->getListByModel($where, $field, $order_string, $page, $limit);
- $count = $this->dao->getCountByWhere($where);
- return [$list, $count];
- }
- }
|