forked from chenyuwulu/chenyu_uniapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phoneapp.php
83 lines (80 loc) · 3 KB
/
phoneapp.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
/**
* chenyu_uniapp模块APP接口定义
*
* @author 尘雨雾录
* @url
*/
defined('IN_IA') or exit('Access Denied');
class Chenyu_uniappModulePhoneapp extends WeModulePhoneapp {
public function doPageIndex(){
global $_GPC, $_W;
$errno = 0;
$message = '返回消息';
$data = array(
'w'=>$_W,
'gpc'=>$_GPC
);
return $this->result($errno, $message, $data);
}
public function doPageMe_userinfo_qq(){
global $_GPC, $_W;
$errno = 0;
$data=array();
$message = '返回消息';
$list = pdo_fetch('select * from '.tablename('chenyu_uniapp_user_app_qq').' where uniacid=:uniacid and openId=:openId ',array(':uniacid'=>$_W['uniacid'],':openId'=>$_GPC['openId']));
if(empty($list)){
$errno = 0;
$info = array(
'uniacid'=>$_W['uniacid'],
'figureurl_qq'=>$_GPC['figureurl_qq'],
'nickName'=>$_GPC['nickName'],
'gender'=>$_GPC['gender'],
'province'=>$_GPC['province'],
'city'=>$_GPC['city'],
'year'=>$_GPC['year'],
'openId'=>$_GPC['openId'],
'createtime'=>time(),
);
$result=pdo_insert('chenyu_uniapp_user_app_qq', $info);
if (!empty($result)) {
$userlist = pdo_fetch("SELECT * FROM ".tablename('chenyu_uniapp_user_app_qq')." WHERE uniacid=:uniacid and openId=:openId ", array(':uniacid'=>$_W['uniacid'],':openId'=>$_GPC['openId']));
$data = $userlist;
}
} else {
$errno = 0;
$data = $list;
}
return $this->result($errno, $message, $data);
}
public function doPageMe_userinfo_wx(){
global $_GPC, $_W;
$errno = 0;
$data=array();
$message = '返回消息';
$list = pdo_fetch('select * from '.tablename('chenyu_uniapp_user_app_wx').' where uniacid=:uniacid and openId=:openId ',array(':uniacid'=>$_W['uniacid'],':openId'=>$_GPC['openId']));
if(empty($list)){
$errno = 0;
$info = array(
'uniacid'=>$_W['uniacid'],
'avatarUrl'=>$_GPC['avatarUrl'],
'nickName'=>$_GPC['nickName'],
'gender'=>$_GPC['gender'],
'province'=>$_GPC['province'],
'city'=>$_GPC['city'],
'country'=>$_GPC['country'],
'openId'=>$_GPC['openId'],
'createtime'=>time(),
);
$result=pdo_insert('chenyu_uniapp_user_app_wx', $info);
if (!empty($result)) {
$userlist = pdo_fetch("SELECT * FROM ".tablename('chenyu_uniapp_user_app_wx')." WHERE uniacid=:uniacid and openId=:openId ", array(':uniacid'=>$_W['uniacid'],':openId'=>$_GPC['openId']));
$data = $userlist;
}
} else {
$errno = 0;
$data = $list;
}
return $this->result($errno, $message, $data);
}
}