// +---------------------------------------------------------------------- namespace app\dao\store; use app\dao\BaseDao; use app\model\store\StoreDrinkLog; /** * 门店用户 * Class StoreDrinkSaveDao * @package app\dao\store */ class StoreDrinkLogDao extends BaseDao { /** * 设置模型 * @return string */ protected function setModel(): string { return StoreDrinkLog::class; } public function getList(array $where, $field = '*', array $with = [], int $page = 0, int $limit = 10) { return $this->search($where)->when(isset($where['uid']) && $where['uid'] != '', function ($query) use ($where) { $query->where('uid',$where['uid']); })->field($field)->when($page && $limit, function ($query) use ($page, $limit) { $query->page($page, $limit); })->order('create desc')->select()->toArray(); } public function getCount(array $where, string $group = '') { return parent::search($where)->when($group, function ($query) use ($group) { $query->group($group); })->count(); } }