Files
huangjingfen/pro_v3.5.1/app/dao/activity/card/CardGiftDao.php
panchengyong 7acbf45ff7 new files
2026-03-07 22:29:07 +08:00

59 lines
1.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
declare (strict_types=1);
namespace app\dao\activity\card;
use app\dao\BaseDao;
use app\model\activity\card\CardGift;
/**
* 礼品卡
* Class CardGiftDao
* @package app\dao\activity\card
*/
class CardGiftDao extends BaseDao
{
/**
* 设置模型
* @return string
*/
protected function setModel(): string
{
return CardGift::class;
}
/**
* 获取礼品卡列表
* @param array $where 查询条件
* @param string $field 查询字段
* @param int $page 页码
* @param int $limit 每页数量
* @param string $order 排序
* @return array
*/
public function getList(array $where, string $field = '*', int $page = 0, int $limit = 0, string $order = '')
{
return $this->search($where)
->field($field)
->when($page && $limit, function ($query) use ($page, $limit) {
$query->page($page, $limit);
})
->when($order, function ($query) use ($order) {
$query->order($order);
})
->select()
->toArray();
}
}