コード例 #1
0
 /**
  * 根据用户id关联用户表和第三方登录表
  *
  * @param string $open_id 用户身份唯一标识
  * @param string $type 第三方绑定类型 Weixin QQ Weibo
  * @return array|bool
  */
 public function getThirdParty($open_id, $type)
 {
     return self::find()->from(self::tableName() . ' t1')->innerJoin(UserThirdPartyLogin::tableName() . 't2', 't1.id=t2.user_id')->where(['t1.open_id' => $open_id, 't2.type' => $type])->one();
 }