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']); } /** * 通过ID获取 * * @param array $ids * @return array */ public static function getRandFeeByOrderIds(array $ids) { return static::find() ->where(['order_id' => $ids]) ->all(); } }