| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?php
- namespace addons\Recharge\common\models;
- use common\models\user\User;
- use Yii;
- /**
- * This is the model class for table "{{%addons_recharge_log}}".
- *
- * @property int $id
- * @property int $mall_id
- * @property int $user_id
- * @property int $recharge_active_id 充值活动id
- * @property int $recharge_order_id 充值订单id
- * @property float $recharge_num 充值金额
- * @property int $give_score 赠送积分
- * @property float $give_balance 赠送余额
- * @property string $give_coupons 赠送优惠券
- * @property string|null $give_content 赠送内容文字描述
- * @property int $created_at
- * @property int $updated_at
- * @property float $give_condition
- */
- class AddonsRechargeLog extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%addons_recharge_log}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'user_id', 'recharge_active_id', 'recharge_order_id', 'give_score', 'created_at', 'updated_at'], 'integer'],
- [['recharge_active_id'], 'required'],
- [['recharge_num', 'give_balance','give_condition'], 'number'],
- [['give_content'], 'string'],
- [['give_coupons'], 'safe'],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => 'Mall ID',
- 'user_id' => 'User ID',
- 'recharge_active_id' => '充值活动id',
- 'recharge_order_id' => '充值订单id',
- 'recharge_num' => '充值金额',
- 'give_score' => '赠送积分',
- 'give_balance' => '赠送余额',
- 'give_coupons' => '赠送优惠券',
- 'give_content' => '赠送内容文字描述',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- ];
- }
- // 关联模型
- public function getUser()
- {
- return $this->hasOne(User::class, ['id' => 'user_id']);
- }
- }
|