123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- namespace common\models;
- use Yii;
- /**
- * This is the model class for table "{{%image}}".
- *
- * @property string $id
- * @property integer $type
- * @property integer $topid
- * @property string $pic
- * @property string $thumbnail
- * @property integer $created_at
- * @property integer $status
- * @property integer $updated_at
- */
- class ImageSource extends \yii\db\ActiveRecord
- {
- const TYPE_DESIGNER = 10;//设计师头像
- const TYPE_MANAGER = 11;//项目经理头像
- const TYPE_LIVING_ROOM = 20;//客厅照片
- const TYPE_MASTER_BEDROOM = 30;//主卧照片
- const TYPE_PORTION = 40;//局部美图
- const TYPE_PORTION2 = 70;//局部美图2
- const TYPE_PORTION3 = 71;//局部美图3
- const TYPE_PORTION4 = 72;//局部美图4
- const TYPE_PORTION5 = 73;//局部美图5
- const TYPE_FLAT = 50;//平面图
- const TYPE_BUILD = 44;//施工图1
- const TYPE_BUILD2 = 45;//施工图2
- const TYPE_MATER_GOOD = 85;//建材商品
- const TYPE_COMMENT = 60;//评论图片
- const STATUS_YES = 10; //正常
- const STATUS_NO = 0; //删除
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%image}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['type', 'topid', 'pic', 'created_at','updated_at'], 'required'],
- [['type', 'topid', 'created_at', 'status', 'updated_at'], 'integer'],
- [['pic', 'thumbnail'], 'string', 'max' => 255],
- [['status'], 'default', 'value' => self::STATUS_YES],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'type' => '类型',
- 'topid' => '关联ID',
- 'pic' => '图片地址',
- 'thumbnail' => '缩略图地址',
- 'created_at' => 'Created At',
- 'status' => 'Status',
- 'updated_at' => 'Updated At',
- ];
- }
- }
|