| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <?php
- namespace addons\CloudStock\common\models;
- use common\components\export\CsvTool;
- use common\enums\DownloadEnum;
- use common\enums\PayTypeEnum;
- use common\enums\StatusEnum;
- use common\models\base\BaseActiveRecord;
- use common\models\common\Download;
- use common\models\common\PaymentTrade;
- use common\models\goods\Goods;
- use common\models\order\Order;
- use common\models\user\User;
- use Yii;
- /**
- * This is the model class for table "qimall_addons_cloud_stock_price_difference_order".
- *
- * @property int $id
- * @property int $mall_id 商城id
- * @property int $user_id 补货代理商用户id
- * @property int $trade_id 支付流水记录id
- * @property int $address_id 收货地址id
- * @property string $receiver_name 收货人
- * @property string $receiver_mobile 收货人手机号
- * @property string $address 收货地址
- * @property int $price_difference_gift_package_id 价差礼包id
- * @property float $pay_money 支付金额
- * @property float $shipping_money 运费
- * @property string $order_no 补货订单编号
- * @property string $trade_no 支付流水号
- * @property string $remark 订单备注
- * @property int $is_pay 是否支付
- * @property int $pay_time 支付时间
- * @property int $status 状态[-1:删除;0:禁用;1启用]
- * @property int $created_at
- * @property int $updated_at
- * @property int|null $payment_type 支付类型
- */
- class CloudStockPriceDifferenceOrder extends BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%addons_cloud_stock_price_difference_order}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'user_id', 'order_no'], 'required'],
- [['mall_id', 'user_id', 'trade_id', 'address_id', 'price_difference_gift_package_id', 'is_pay', 'pay_time', 'status', 'created_at', 'updated_at', 'payment_type'], 'integer'],
- [['pay_money', 'shipping_money'], 'number'],
- [['receiver_name', 'address', 'order_no', 'trade_no', 'remark'], 'string', 'max' => 255],
- [['receiver_mobile'], 'string', 'max' => 20],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => 'Mall ID',
- 'user_id' => 'User ID',
- 'trade_id' => 'Trade ID',
- 'address_id' => 'Address ID',
- 'receiver_name' => 'Receiver Name',
- 'receiver_mobile' => 'Receiver Mobile',
- 'address' => 'Address',
- 'price_difference_gift_package_id' => 'Price Difference Gift Package ID',
- 'pay_money' => 'Pay Money',
- 'shipping_money' => 'Shipping Money',
- 'order_no' => 'Order No',
- 'trade_no' => 'Trade No',
- 'remark' => 'Remark',
- 'is_pay' => 'Is Pay',
- 'pay_time' => 'Pay Time',
- 'status' => 'Status',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- 'payment_type' => 'Payment Type',
- ];
- }
- public function getDetail()
- {
- return $this->hasMany(CloudStockPriceDifferenceOrderDetail::class, ['price_difference_order_id' => 'id']);
- }
- public function getFillOrder()
- {
- return $this->hasMany(CloudStockFillOrder::class, ['price_difference_order_id' => 'id']);
- }
- public function getUser()
- {
- return $this->hasOne(User::class, ['id' => 'user_id'])->select(['id', 'nickname', 'avatar_url', 'mobile']);
- }
- public function getPaymentTrade()
- {
- return $this->hasOne(PaymentTrade::class, ['id' => 'trade_id']);
- }
- }
|