1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace common\models;
- use Yii;
- /**
- * This is the model class for table "{{%mater_type}}".
- *
- * @property integer $id
- * @property string $name
- * @property integer $sort
- * @property integer $status
- * @property integer $c_time
- * @property integer $u_time
- */
- class MaterType extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- const STATUS_YES = 10;
- const STATUS_NO = 0;
- public static function tableName()
- {
- return '{{%mater_type}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['c_time', 'u_time'], 'default','value'=>time()],
- [['status'], 'default','value'=>self::STATUS_YES],
- [['name','c_time'], 'required'],
- [['name'], 'string','max' => 32],
- [['sort','c_time', 'u_time','status'], 'integer'],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'name' => '分类名称',
- 'sort' => '序号',
- 'status' => '状态',
- 'c_time' => '创建时间',
- 'u_time' => '更新时间',
- ];
- }
- }
|