1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- namespace common\models;
- use Yii;
- /**
- * This is the model class for table "bd_user_info".
- *
- * @property integer $id
- * @property integer $uid
- * @property string $nickname
- * @property string $portrait
- * @property string $tel
- * @property integer $updated_at
- */
- class UserInfo extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%user_info}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['uid','updated_at'], 'required'],
- [['uid', 'updated_at'], 'integer'],
- [['nickname', 'tel'], 'string', 'max' => 32],
- [['portrait'], 'string', 'max' => 255],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'uid' => 'Uid',
- 'nickname' => 'Nickname',
- 'portrait' => 'Portrait',
- 'tel' => 'Tel',
- 'updated_at' => 'Updated At',
- ];
- }
- static function imagesUrl($imgurl)
- {
- $str =substr($imgurl,0,4);
- $str2 =substr($imgurl,0,4);
- if($str=='http'||$str2=='https')
- {
- return $imgurl;
- }
- return Yii::getAlias('@imgdomain').'/'.$imgurl;
- }
- }
|