| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use Yii;
- use yii\db\ActiveRecord;
- use yii\behaviors\TimestampBehavior;
- use app\models\WechatConfig;
- use app\models\Option;
- /**
- * This is the model class for table "{{%coupon}}".
- *
- * @property int $id
- * @property int $mini_id
- * @property int $status
- * @property string $alipay_activity_id
- * @property datetime $publish_start_time
- * @property datetime $publish_end_time
- * @property int $store_id
- * @property string $name 优惠券名称
- * @property string $desc 优惠券描述
- * @property string|null $pic_url 缩略图
- * @property int $discount_type 优惠券类型:1=折扣,2=满减
- * @property float $min_price 最低消费金额
- * @property float $sub_price 优惠金额
- * @property float $discount 折扣率
- * @property int $expire_type 到期类型:1=领取后N天过期,2=指定有效期
- * @property int $expire_day 有效天数,expire_type=1时
- * @property int $begin_time 有效期开始时间
- * @property int $end_time 有效期结束时间
- * @property int $created_at 添加时间
- * @property int $is_delete 是否删除
- * @property int $total_count 发放总数量
- * @property int $is_join 是否加入领券中心 1--不加入领券中心 2--加入领券中心
- * @property int $is_alipay_voucher
- * @property int|null $sort 排序按升序排列
- * @property string|null $cat_id_list
- * @property int|null $appoint_type
- * @property int $is_integral 是否加入积分商城 1--不加入 2--加入
- * @property int $integral 兑换需要积分数量
- * @property float $price 售价
- * @property int $total_num 积分商城发放总数
- * @property int $user_num 每人限制兑换数量
- * @property string|null $rule 使用说明
- * @property string|null $goods_id_list
- * @property int|null $mch_id 入驻商id
- * @property int|null $updated_at
- * @property int $is_join_welfare 是否加入到福利中心
- * @property int $is_give
- */
- class AlipayAcitvityVoucherCoupon extends \yii\db\ActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%alipay_activity_voucher_coupon}}';
- }
- const IS_DELETE_YES = 1;//已删除
- const IS_DELETE_NO = 0;//未删除
- const IS_JOIN_YES = 2; //加入领券中心
- const IS_JOIN_NO = 1;//不加入领券中心
- const DISCOUNT_TYPE_ONE = 1;//折扣类型
- const DISCOUNT_TYPE_TWO = 2; //满减类型
- const EXPIRE_TYPE_DAY = 1;//领取后n天过期
- const EXPIRE_TYPE_DATE = 2;//指定有效期
- const IS_INTEGRAL_YES = 2;//加入积分商城
- const IS_INTEGRAL_NO = 1;//不加入积分商城
- const APPOINT_TYPE_CAT = 1;//商品分类
- const APPOINT_TYPE_GOODS = 2;//商品
- const APPOINT_TYPE_FACE = 3;//当面付
- /**
- * saas 加入福利中心
- */
- const IS_JOIN_WELFARE_YES = 1;
- /**
- * saas 不加入福利中心
- */
- const IS_JOIN_WELFARE_NO = 0;
- public function behaviors()
- {
- return [
- [
- 'class' => TimestampBehavior::class,
- 'attributes' => [
- ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'],
- ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'
- ]
- ]
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['store_id', 'name'], 'required'],
- [['store_id', 'discount_type', 'updated_at', 'expire_type', 'expire_day', 'begin_time', 'end_time', 'created_at', 'is_delete', 'total_count', 'is_join', 'sort', 'appoint_type', 'is_integral', 'integral', 'total_num', 'user_num', 'mch_id', 'is_join_welfare', 'is_give','is_business','business_type','is_alipay_voucher'], 'integer'],
- [['min_price', 'sub_price', 'discount', 'price'], 'number'],
- [['name', 'cat_id_list', 'goods_id_list'], 'string', 'max' => 255],
- [['desc'], 'string', 'max' => 2000],
- [['pic_url'], 'string', 'max' => 2048],
- [['rule'], 'string', 'max' => 1000],
- ['discount', 'default', 'value' => 10],
- ['is_integral', 'default', 'value' => 1],
- ['integral', 'default', 'value' => 0],
- ['price', 'default', 'value' => 0],
- ['total_num', 'default', 'value' => 0],
- ['expire_day', 'default', 'value' => 0],
- ['user_num', 'default', 'value' => 0],
- ['sub_price', 'default', 'value' => 0],
- ['total_count', 'default', 'value' => -1],
- [['begin_time', 'end_time'], 'default', 'value' => 0],
- [['is_alipay_voucher', 'mini_id', 'publish_start_time', 'publish_end_time', 'alipay_activity_id', 'status'], 'safe']
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'store_id' => 'Store ID',
- 'name' => '优惠券名称',
- 'desc' => '优惠券描述',
- 'pic_url' => '缩略图',
- 'discount_type' => '优惠券类型:1=折扣,2=满减',
- 'min_price' => '最低消费金额',
- 'sub_price' => '优惠金额',
- 'discount' => '折扣率',
- 'expire_type' => '到期类型:1=领取后N天过期,2=指定有效期',
- 'expire_day' => '有效天数,expire_type=1时',
- 'begin_time' => '有效期开始时间',
- 'end_time' => '有效期结束时间',
- 'created_at' => '添加时间',
- 'is_delete' => '是否删除',
- 'total_count' => '发放总数量',
- 'is_join' => '是否加入领券中心 1--不加入领券中心 2--加入领券中心',
- 'sort' => '排序按降序排列',
- 'cat_id_list' => 'Cat Id List',
- 'appoint_type' => 'Appoint Type',
- 'is_integral' => '是否加入积分商城 1--不加入 2--加入',
- 'integral' => '兑换需要积分数量',
- 'price' => '售价',
- 'total_num' => '积分商城发放总数',
- 'user_num' => '每人限制兑换数量',
- 'rule' => '使用说明',
- 'goods_id_list' => 'Goods Id List',
- 'mch_id' => '入驻商id',
- 'updated_at' => 'Update Time',
- 'is_join_welfare' => '是否加入福利中心 1--不加入福利中心 2--加入福利中心',
- 'is_give' => '是否可转增',
- 'is_business' => '是否是商盟',
- 'business_type' => '展示位置',
- ];
- }
- }
|