| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use app\constants\OptionSetting;
- use app\modules\alliance\models\CurrencyForm;
- use app\plugins\scanCodePay\models\Order as ScanCodePayOrder;
- use app\plugins\scanCodePay\models\Order as ScanOrder;
- use yii\db\ActiveRecord;
- use yii\behaviors\TimestampBehavior;
- use Yii;
- use yii\helpers\Json;
- /**
- * This is the model class for table "{{%red_packet_record}}".
- *
- * @property integer $id
- * @property integer $user_id
- * @property integer $saas_id
- * @property integer $currency_id
- * @property integer $packet_id
- * @property float $amount
- * @property integer $store_id
- * @property integer $created_at
- */
- class RedPacketRecord extends \yii\db\ActiveRecord
- {
- public static function tableName()
- {
- return '{{%red_packet_record}}';
- }
- public function behaviors()
- {
- return [
- [
- 'class' => TimestampBehavior::class,
- 'attributes' => [
- ActiveRecord::EVENT_BEFORE_INSERT => ['created_at'],
- ]
- ]
- ];
- }
- public function rules()
- {
- return [
- [['packet_id', 'user_id', 'amount'], 'required'],
- [['packet_id', 'user_id','store_id','id','currency_id','is_receive'], 'integer'],
- [['created_at'], 'safe'],
- [['amount'], 'number', 'min' => 0.01],
- ];
- }
- public function getPacket()
- {
- return $this->hasOne(RedPacket::class, ['id' => 'packet_id']);
- }
- }
|