| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <?php
- namespace addons\CloudStock\common\models;
- use common\models\common\PaymentTrade;
- use common\models\order\Order;
- use common\models\user\User;
- use Yii;
- use yii\db\ActiveRecord;
- /**
- * This is the model class for table "{{%addons_cloud_stock_rand_fee_order}}".
- *
- * @property int $id
- * @property int $mall_id
- * @property int $trade_id 支付流水ID
- * @property int $order_id 订单ID
- * @property string $order_no 订单号
- * @property int $user_id 会员ID
- * @property float $rand_fee 订单减免金额
- * @property float $total_rand_fee 减免金额
- * @property string $order_type 订单类型
- * @property int|null $created_at
- */
- class CloudStockRandFeeOrder extends ActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%addons_cloud_stock_rand_fee_order}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'trade_id', 'order_id', 'user_id', 'created_at'], 'integer'],
- [['rand_fee', 'total_rand_fee'], 'number'],
- [['order_no'], 'string', 'max' => 64],
- [['order_type'], 'string', 'max' => 32],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => 'Mall ID',
- 'trade_id' => 'Trade ID',
- 'order_id' => 'Order ID',
- 'order_no' => 'Order No',
- 'user_id' => 'User ID',
- 'rand_fee' => 'Rand Fee',
- 'total_rand_fee' => 'Total Rand Fee',
- 'order_type' => 'Order Type',
- 'created_at' => 'Created At',
- ];
- }
- /**
- * 订单表
- *
- * @return ActiveQuery
- */
- public function getOrder()
- {
- return $this->hasOne(Order::class, ['id' => 'order_id']);
- }
- /**
- * 会员表
- *
- * @return ActiveQuery
- */
- public function getUser()
- {
- return $this->hasOne(User::class, ['id' => 'user_id']);
- }
- /**
- * 流水
- *
- * @return ActiveQuery
- */
- public function getTrade()
- {
- return $this->hasOne(PaymentTrade::class, ['id' => 'trade_id']);
- }
- }
|