Files
huangjingfen/pro_v3.5.1/app/dao/activity/coupon/StoreCouponDao.php
panchengyong c1e74d8e68 chore(php): 统一 ScottPan 文件头与注释域名替换
- 按 docs/renew-code-comment.md 将 PHP 文件头改为带边框的 Author 注释\n- 注释中的 crmeb.com 替换为 uj345.cn(代码字符串中的外链未改)\n- 新增 docs/renew-code-comment.md 说明

Made-with: Cursor
2026-03-29 11:22:58 +08:00

71 lines
2.1 KiB
PHP

<?php
// +----------------------------------------------------------------------
// | Author: ScottPan Team
// +----------------------------------------------------------------------
namespace app\dao\activity\coupon;
use app\dao\BaseDao;
use app\model\activity\coupon\StoreCoupon;
/**
* 优惠卷
* Class StoreCouponDao
* @package app\dao\activity\coupon
*/
class StoreCouponDao extends BaseDao
{
/**
* 设置模型
* @return string
*/
protected function setModel(): string
{
return StoreCoupon::class;
}
/**
* 获取文章列表
* @param array $where
* @param int $page
* @param int $limit
* @return mixed
*/
public function getList(array $where, int $page, int $limit)
{
return $this->search($where)->page($page, $limit)->order('sort desc,id desc')->select()->toArray();
}
/**
* 写入优惠卷
* @param $cid
* @param int $total_count
* @param int $start_time
* @param int $end_time
* @param int $remain_count
* @param int $status
* @param int $is_permanent
* @param int $full_reduction
* @param int $is_give_subscribe
* @param int $is_full_give
* @return \crmeb\basic\BaseModel|\think\Model
*/
public function setIssue($cid, $total_count = 0, $start_time = 0, $end_time = 0, $remain_count = 0, $status = 0, $is_permanent = 0, $full_reduction = 0, $is_give_subscribe = 0, $is_full_give = 0)
{
$add_time = time();
$data['cid'] = $cid;
$data['start_time'] = $start_time;
$data['end_time'] = $end_time;
$data['total_count'] = $total_count;
$data['remain_count'] = $remain_count;
$data['is_permanent'] = $is_permanent;
$data['status'] = $status;
$data['is_give_subscribe'] = $is_give_subscribe;
$data['is_full_give'] = $is_full_give;
$data['full_reduction'] = $full_reduction;
$data['add_time'] = $add_time;
return $this->getModel()->create(compact('cid', 'start_time', 'end_time', 'total_count', 'remain_count', 'is_permanent', 'status', 'is_give_subscribe', 'is_full_give', 'full_reduction', 'add_time'));
}
}