12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- namespace common\models;
- class CategoryWatermark extends Common
- {
- public function getWatermarkInfo()
- {
- $query = self::find();
- $query->andWhere(['del'=>$this->setDel]);
- $query->andWhere(['status'=>1]);
- return $query->one();
- }
- public function rules()
- {
- return [
- [['width','height','position'],'required','message'=>'{attribute}不能为空'],
- ['position','in','range'=>[1,2,3,4,5,6,7,8,9]],
- [['width','height'],'number','max'=>300],
- ['spacing','number','max'=>50],
- ['status','in','range'=>[1,2]],
- ];
- }
- public function attributeLabels()
- {
- return [
- 'width'=>'宽度',
- 'height'=>'高度',
- 'position'=>'水印位置',
- 'spacing'=>'间距',
- ];
- }
- public function FindById($id)
- {
- return self::findOne($id);
- }
- }
|