芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/xmintal-back/models/License.php
<?php namespace app\models; use Yii; /** * This is the model class for table "{{%license}}". * * @property int $id * @property string|null $name * @property string|null $price * @property int|null $month_duration * @property int|null $sort_order * @property string|null $created * @property string|null $updated * @property int|null $trash * @property int|null $active * * @property CustomerLicense[] $customerLicenses */ class License extends \yii\db\ActiveRecord { /** * {@inheritdoc} */ public static function tableName() { return '{{%license}}'; } public function fields(){ return ['id','name','price','month_duration']; } /** * {@inheritdoc} */ public function rules() { return [ [['month_duration', 'sort_order', 'trash', 'active'], 'integer'], [['created', 'updated'], 'safe'], [['name'], 'string', 'max' => 150], [['price'], 'string', 'max' => 10], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'name' => 'Name', 'price' => 'Price', 'month_duration' => 'Month Duration', 'sort_order' => 'Sort Order', 'created' => 'Created', 'updated' => 'Updated', 'trash' => 'Trash', 'active' => 'Active', ]; } /** * Gets query for [[CustomerLicenses]]. * * @return \yii\db\ActiveQuery */ public function getCustomerLicenses() { return $this->hasMany(CustomerLicense::class, ['license_id' => 'id']); } }