芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/airport-back/models/Payment.php
<?php namespace app\models; use Yii; /** * This is the model class for table "{{%payment}}". * * @property int $id * @property int|null $booking_id * @property int|null $customer_id * @property string|null $amount * @property string|null $payment_method * @property string|null $payment_reference * @property string|null $payment_date * @property int|null $trash * * @property Booking $booking * @property Customer $customer */ class Payment extends \yii\db\ActiveRecord { /** * {@inheritdoc} */ public static function tableName() { return '{{%payment}}'; } /** * {@inheritdoc} */ public function rules() { return [ [['booking_id', 'customer_id', 'trash'], 'integer'], [['payment_date'], 'safe'], [['amount'], 'string', 'max' => 10], [['payment_method', 'payment_reference'], 'string', 'max' => 45], [['booking_id'], 'exist', 'skipOnError' => true, 'targetClass' => Booking::class, 'targetAttribute' => ['booking_id' => 'id']], [['customer_id'], 'exist', 'skipOnError' => true, 'targetClass' => Customer::class, 'targetAttribute' => ['customer_id' => 'id']], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'booking_id' => 'Booking ID', 'customer_id' => 'Customer ID', 'amount' => 'Amount', 'payment_method' => 'Payment Method', 'payment_reference' => 'Payment Reference', 'payment_date' => 'Payment Date', 'trash' => 'Trash', ]; } /** * Gets query for [[Booking]]. * * @return \yii\db\ActiveQuery */ public function getBooking() { return $this->hasOne(Booking::class, ['id' => 'booking_id']); } /** * Gets query for [[Customer]]. * * @return \yii\db\ActiveQuery */ public function getCustomer() { return $this->hasOne(Customer::class, ['id' => 'customer_id']); } }