Browse Source

会员升级

Kirin 1 month ago
parent
commit
de11c364f5
3 changed files with 18 additions and 8 deletions
  1. 4 8
      app/dao/BaseDao.php
  2. 13 0
      app/dao/user/UserBillDao.php
  3. 1 0
      app/services/user/UserBillServices.php

+ 4 - 8
app/dao/BaseDao.php

@@ -24,7 +24,6 @@ abstract class BaseDao
 {
 
     use CacheDaoTrait;
-
     /**
      * 当前表名别名
      * @var string
@@ -67,12 +66,9 @@ abstract class BaseDao
      * @param array $where
      * @return int
      */
-    public function getCount(array $where, $search = false)
+    public function getCount(array $where)
     {
-        if ($search) {
-            return $this->search($where)->count();
-        } else
-            return $this->getModel()->where($where)->count();
+        return $this->getModel()->where($where)->count();
     }
 
     /**
@@ -232,11 +228,11 @@ abstract class BaseDao
         return $this->getModel()::whereIn(is_null($key) ? $this->getPk() : $key, $ids)->update($data);
     }
 
-    /**
+	/**
      * 批量更新数据,增加条件
      * @param array $ids
      * @param array $data
-     * @param array $where
+ 	 * @param array $where
      * @param string|null $key
      * @return BaseModel
      */

+ 13 - 0
app/dao/user/UserBillDao.php

@@ -32,6 +32,19 @@ class UserBilldao extends BaseDao
         return UserBill::class;
     }
 
+    /**
+     * 获取某些条件总数
+     * @param array $where
+     * @return int
+     */
+    public function getCount(array $where, $search = false)
+    {
+        if ($search) {
+            return $this->search($where)->count();
+        } else
+            return $this->getModel()->where($where)->count();
+    }
+
     /**
      * 获取列表
      * @param array $where

+ 1 - 0
app/services/user/UserBillServices.php

@@ -277,6 +277,7 @@ class UserBillServices extends BaseServices
         $this->dao = $dao;
     }
 
+
     /**
      *  获取用户记录总和
      * @param $uid