| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use Yii;
- use yii\db\ActiveRecord;
- use yii\behaviors\TimestampBehavior;
- /**
- * This is the model class for table "{{%coupon_auto_send}}".
- *
- * @property int $id Id
- * @property int $store_id 商城
- * @property int $coupon_id 优惠券id
- * @property int $event 触发事件:1=分享,2=购买并付款
- * @property int|null $send_times 最多发放次数,0表示不限制
- * @property int|null $created_at 添加时间
- * @property int $is_delete 是否删除
- * @property int|null $mch_id 入驻商id
- * @property int|null $updated_at 更新时间
- * @property int|null $amount 现金
- * @property int|null $day_num 单人单日获取数量
- * @property int|null $day_count 单人总获取数量
- * @property int|null $status 状态
- */
- class CouponAutoSend extends \yii\db\ActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%coupon_auto_send}}';
- }
- const IS_DELETE_YES = 1;//已删除
- const IS_DELETE_NO = 0;//未删除
- const EVENT_SHARE = 1; // 分享
- const EVENT_RECHARGE = 2; // 充值赠送
- const EVENT_PAY = 3; // 现金积分购买
- const EVENT_QRCODE = 4; // 二维码领取
- const EVENT_NEWUSER = 5; // 新人专享
- const EVENT_ORDER = 6; // 下单赠送
- const EXT_REG = 1; // 注册
- const EXT_FIRST_ORDER = 2; // 首单
- const EXT_SECOND_ORDER = 3; // 次单
- 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', 'coupon_id'], 'required'],
- [['store_id', 'event', 'send_times', 'created_at', 'is_delete', 'mch_id', 'updated_at', 'day_num', 'day_count', 'status'], 'integer'],
- [['coupon_id'],'string'],
- [['amount', 'money'], 'number'],
- [['ext_type'], 'safe'],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'Id',
- 'store_id' => '商城',
- 'coupon_id' => '优惠券id',
- 'event' => '触发事件:1=分享,2=购买并付款',
- 'ext_type' => '附加条款:1=注册,',
- 'send_times' => '最多发放次数,0表示不限制',
- 'created_at' => '添加时间',
- 'is_delete' => '是否删除',
- 'mch_id' => '入驻商id',
- 'updated_at' => '更新时间',
- 'amount' => '现金',
- 'day_num' => '单人单日获取数量',
- 'day_count' => '单人总获取量',
- 'money' => '需要现金',
- ];
- }
- }
|