12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace common\models;
- use Yii;
- /**
- * This is the model class for table "{{%api_share}}".
- *
- * @property integer $id
- * @property integer $uid
- * @property integer $share_uid
- * @property integer $c_time
- */
- class ApiShare extends \yii\db\ActiveRecord
- {
- public static function tableName()
- {
- return '{{%api_share}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['uid', 'share_uid'], 'required'],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'uid' => 'uid',
- 'share_uid' => '分享着id',
- 'c_time' => 'c_time',
- ];
- }
- public function getUser()
- {
- return $this->hasOne(User::className(),['id'=>'uid'])->select("username,role");
- }
- public function getSuser()
- {
- return $this->hasOne(User::className(),['id'=>'share_uid'])->select("username,role");
- }
- }
|