...
|
...
|
@@ -34,4 +34,22 @@ if (!function_exists('http_request')) { |
|
|
|
|
|
return $data;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (!function_exists('insert_openid_info')) {
|
|
|
/**
|
|
|
* 将授权用户信息保存起来
|
|
|
*/
|
|
|
function insert_openid_info($data)
|
|
|
{
|
|
|
$data['upt_time'] = time();
|
|
|
$res = \think\Db::name("openid_info")->where("openid", $data['openid'])->find();
|
|
|
// file_put_contents("ccc.txt", date("Y-m-d H:i:s") . json_encode($data) . PHP_EOL, FILE_APPEND);
|
|
|
if (!empty($res)) {
|
|
|
\think\Db::name("openid_info")->where("openid", $data['openid'])->update($data);
|
|
|
} else {
|
|
|
\think\Db::name("openid_info")->insertGetId($data);
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|