coupon-admin/app/model/Redpack.php

29 lines
979 B
PHP
Raw Normal View History

2021-12-13 11:09:16 +00:00
<?php
namespace app\model;
//红包记录
class Redpack extends Base
{
2022-03-18 03:37:30 +00:00
const userTypeDistribution = "distribution";//领券分销者
const userTypeDistributed = "distributed";//核销分销者
2022-03-15 10:51:28 +00:00
const userTypeAgency = "agency";// 渠道商
2022-03-15 07:10:41 +00:00
/**
* 获取分销红包记录
* @param $distributionUserCode 分销人user_code
* @param $couponMainId 分销的couponMain 优惠券id
* @param $distributedUserCode 被分销人user_code
* 以上三个参数就可以确定 分销数据的唯一性
* */
public static function getDistributionRedpack($distributionUserCode,$couponMainId,$distributedUserCode)
{
return self::where([
["user_type","=",self::userTypeDistribution],
["user_code","=",$distributionUserCode],
["distributed_user_code","=",$distributedUserCode],
["distributed_coupon_main_id","=",$distributedUserCode],
])
->find();
}
2021-12-13 11:09:16 +00:00
}