1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- /**
- * Created by PhpStorm.
- * User: xiaofeng
- * Date: 2018/3/4
- * Time: 上午9:25
- */
- namespace common\models;
- class About extends Common
- {
- public function rules()
- {
- return [
- [['company','contact'],'required','message'=>'{attribute}不能为空'],
- [['aptitude','copyright'],'string']
- ];
- }
- public function attributeLabels()
- {
- return [
- 'company'=>'公司简介',
- 'aptitude'=>'资质荣誉',
- 'contact'=>'关于我们',
- 'copyright'=>'版权声明'
- ];
- }
- public function getList()
- {
- $query = self::find();
- // $query->andWhere(['del'=>$this->setDel]);
- $query->orderBy(['create_at'=>SORT_DESC]);
- $query->asArray();
- return $query->all();
- }
- /*
- * 调用里面的验证,错误返回数组,正确返回对象
- * */
- public function Authenticator($input)
- {
- $this->load($input,'');
- if(!$this->validate()) return $this->errors;
- return $this;
- }
- public function FindById($id)
- {
- return self::findOne($id);
- }
- }
|