2021-11-18 09:57:04 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace app\repository;
|
|
|
|
|
|
|
|
use app\exception\RepositoryException;
|
|
|
|
use app\model\CouponMain;
|
|
|
|
use app\service\Repository;
|
2021-11-25 10:54:59 +00:00
|
|
|
use Exception;
|
2021-11-18 09:57:04 +00:00
|
|
|
use think\Model;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 优惠券 相关操作
|
|
|
|
*
|
|
|
|
* Class CouponRepository
|
|
|
|
* @package app\repository
|
|
|
|
* @method self getInstance(Model $model = null) static
|
|
|
|
*/
|
|
|
|
class CouponRepository extends Repository
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* 优惠券列表
|
|
|
|
*
|
|
|
|
* @param string $businessCode 商家code
|
|
|
|
* @param array $order
|
|
|
|
* @return array
|
|
|
|
* @throws RepositoryException
|
|
|
|
*/
|
|
|
|
public function businessCouponModel($where)
|
|
|
|
{
|
|
|
|
return CouponMain::where($where);
|
|
|
|
}
|
|
|
|
|
2021-11-25 10:54:59 +00:00
|
|
|
/**
|
|
|
|
* 查询商家发布的优惠卷列表
|
|
|
|
*
|
|
|
|
* @param array $where
|
|
|
|
* @param array $fields
|
|
|
|
* @param int $page
|
|
|
|
* @param int $size
|
|
|
|
* @param callable|null $call
|
|
|
|
* @param array $sortOrder
|
|
|
|
* @return array
|
|
|
|
* @throws Exception
|
|
|
|
*/
|
|
|
|
public function findCouponMainList(array $where, array $fields = [], int $page=1, int $size = 0, callable $call=null, array $sortOrder= []): array
|
|
|
|
{
|
|
|
|
return CouponMain::findList($where, $fields, $page, $size, $call, $sortOrder);
|
|
|
|
}
|
|
|
|
|
2021-11-18 09:57:04 +00:00
|
|
|
}
|