| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use yii\behaviors\TimestampBehavior;
- use yii\db\ActiveRecord;
- /**
- * This is the model class for table "{{%wallet_log_string_code}}".
- *
- * @property integer $id
- * @property integer $store_id
- * @property integer $order_id
- * @property integer $user_id
- * @property integer $saas_id
- * @property integer $type
- * @property integer $source
- * @property string $money
- * @property integer $is_delete
- * @property integer $created_at
- * @property integer $order_type
- * @property string $version
- * @property string $desc
- */
- class WalletLogStringCode extends \yii\db\ActiveRecord
- {
- public static function tableName()
- {
- return '{{%wallet_log_string_code}}';
- }
- public function behaviors()
- {
- return [
- [
- 'class' => TimestampBehavior::class,
- 'attributes' => [
- ActiveRecord::EVENT_BEFORE_INSERT => ['created_at'],
- ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at']
- ]
- ]
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['store_id', 'user_id', 'money', 'before_money'], 'required'],
- [['id', 'store_id', 'user_id', 'saas_id', 'source_id', 'created_at', 'updated_at'], 'integer'],
- [['money', 'before_money'], 'number'],
- [['type'], 'string', 'max' => 32],
- [['currency_code', 'source_table'], 'string', 'max' => 64],
- [['desc'], 'string', 'max' => 255],
- [['extra'], 'string']
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'store_id' => '商城ID',
- 'user_id' => '用户ID',
- 'saas_id' => '联盟ID',
- 'currency_code' => '货币代码',
- 'money' => '资金变动(支持负数)',
- 'before_money' => '变动前金额',
- 'type' => '类型',
- 'source_table' => '关联表',
- 'source_id' => '关联表id',
- 'desc' => '描述',
- 'extra' => '额外信息',
- 'created_at' => '创建时间',
- 'updated_at' => '更新时间',
- ];
- }
- public function getUser()
- {
- return $this->hasOne(User::class, ['id' => 'user_id']);
- }
- }
|