|
@@ -24,6 +24,7 @@ abstract class BaseDao
|
|
|
{
|
|
|
|
|
|
use CacheDaoTrait;
|
|
|
+
|
|
|
/**
|
|
|
* 当前表名别名
|
|
|
* @var string
|
|
@@ -66,9 +67,12 @@ abstract class BaseDao
|
|
|
* @param array $where
|
|
|
* @return int
|
|
|
*/
|
|
|
- public function getCount(array $where)
|
|
|
+ public function getCount(array $where, $search = false)
|
|
|
{
|
|
|
- return $this->getModel()->where($where)->count();
|
|
|
+ if ($search) {
|
|
|
+ return $this->search($where)->count();
|
|
|
+ } else
|
|
|
+ return $this->getModel()->where($where)->count();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -228,11 +232,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
|
|
|
*/
|