12345678910111213141516171819202122232425262728293031323334 |
- <?php
- /**
- * Created by PhpStorm.
- * User: xiaofeng
- * Date: 2018/3/3
- * Time: 下午2:25
- */
- namespace common\models;
- //use yii\db\ActiveRecord;
- class UserRn extends Common
- {
- public function rules()
- {
- return [
- [['rid','nid','type'],'required','message'=>'请输入完整的信息'],
- ['type','in','range'=>[1,2]],
- ];
- }
- public function FindId()
- {
- return self::find()->andFilterWhere(['rid'=>$this->rid])
- ->andFilterWhere(['type'=>$this->type])
- ->one();
- }
- public function FindRid()
- {
- return self::find()->andWhere(['rid'=>$this->rid,'type'=>$this->type])->asArray()->all();
- }
- }
|