getMemberInfo( )通过openid获取会员信息 * * * * * ~~~ /** * @param string $openid * @return array|false|PDOStatement|string|\think\Model */ function getMemberInfo($openid = '', $field = []) { if ($openid = getOrSetOpenid($openid)) { $user = \think\Db::name('mp_friends')->where(['openid' => $openid])->find(); if (!$field) { return $user; } else { $fields = []; foreach ($field as $key => $val) { $fields[$val] = $user[$val]; } return $fields; } } } ~~~