You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.6 KiB
47 lines
1.6 KiB
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
|
// +----------------------------------------------------------------------
|
|
// | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
|
|
// +----------------------------------------------------------------------
|
|
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
|
// +----------------------------------------------------------------------
|
|
// | Author: CRMEB Team <admin@crmeb.com>
|
|
// +----------------------------------------------------------------------
|
|
|
|
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();
|
|
}
|
|
}
|
|
|