Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
quxiu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冷斌
quxiu
Commits
d93cbcf0
Commit
d93cbcf0
authored
Apr 09, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
798e65fb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
148 additions
and
106 deletions
+148
-106
api/Appapi/Api/User.php
+29
-0
api/Appapi/Domain/User.php
+7
-0
api/Appapi/Model/User.php
+112
-106
No files found.
api/Appapi/Api/User.php
View file @
d93cbcf0
...
@@ -200,6 +200,11 @@ class Api_User extends PhalApi_Api {
...
@@ -200,6 +200,11 @@ class Api_User extends PhalApi_Api {
'uid'
=>
array
(
'name'
=>
'uid'
,
'type'
=>
'int'
,
'min'
=>
1
,
'require'
=>
true
,
'desc'
=>
'用户ID'
),
'uid'
=>
array
(
'name'
=>
'uid'
,
'type'
=>
'int'
,
'min'
=>
1
,
'require'
=>
true
,
'desc'
=>
'用户ID'
),
'token'
=>
array
(
'name'
=>
'token'
,
'type'
=>
'string'
,
'require'
=>
true
,
'desc'
=>
'用户token'
),
'token'
=>
array
(
'name'
=>
'token'
,
'type'
=>
'string'
,
'require'
=>
true
,
'desc'
=>
'用户token'
),
),
),
'signBonus'
=>
array
(
'uid'
=>
array
(
'name'
=>
'uid'
,
'type'
=>
'int'
,
'min'
=>
1
,
'require'
=>
true
,
'desc'
=>
'用户ID'
),
'token'
=>
array
(
'name'
=>
'token'
,
'type'
=>
'string'
,
'require'
=>
true
,
'desc'
=>
'用户token'
),
'coin'
=>
array
(
'name'
=>
'coin'
,
'type'
=>
'int'
,
'min'
=>
1
,
'require'
=>
true
,
'desc'
=>
'钻石'
),
),
'setDistribut'
=>
array
(
'setDistribut'
=>
array
(
'uid'
=>
array
(
'name'
=>
'uid'
,
'type'
=>
'int'
,
'min'
=>
1
,
'require'
=>
true
,
'desc'
=>
'用户ID'
),
'uid'
=>
array
(
'name'
=>
'uid'
,
'type'
=>
'int'
,
'min'
=>
1
,
'require'
=>
true
,
'desc'
=>
'用户ID'
),
'token'
=>
array
(
'name'
=>
'token'
,
'type'
=>
'string'
,
'require'
=>
true
,
'desc'
=>
'用户token'
),
'token'
=>
array
(
'name'
=>
'token'
,
'type'
=>
'string'
,
'require'
=>
true
,
'desc'
=>
'用户token'
),
...
@@ -1577,6 +1582,30 @@ class Api_User extends PhalApi_Api {
...
@@ -1577,6 +1582,30 @@ class Api_User extends PhalApi_Api {
return
$rs
;
return
$rs
;
}
}
public
function
signBonus
()
{
$rs
=
array
(
'code'
=>
0
,
'msg'
=>
'分享成功'
,
'info'
=>
array
());
$uid
=
checkNull
(
$this
->
uid
);
$token
=
checkNull
(
$this
->
token
);
$checkToken
=
checkToken
(
$uid
,
$token
);
if
(
$checkToken
==
700
){
$rs
[
'code'
]
=
$checkToken
;
$rs
[
'msg'
]
=
'您的登陆状态失效,请重新登陆!'
;
return
$rs
;
}
$domain
=
new
Domain_User
();
$info
=
$domain
->
signBonus
(
$uid
,
$this
->
coin
);
if
(
!
$info
){
$rs
[
'code'
]
=
1001
;
$rs
[
'msg'
]
=
'分享失败'
;
return
$rs
;
}
return
$rs
;
}
/**
/**
* 设置分销上级
* 设置分销上级
* @desc 用于用户首次登录设置分销关系
* @desc 用于用户首次登录设置分销关系
...
...
api/Appapi/Domain/User.php
View file @
d93cbcf0
...
@@ -282,6 +282,13 @@ class Domain_User {
...
@@ -282,6 +282,13 @@ class Domain_User {
}
}
public
function
signBonus
(
$uid
,
$coin
)
{
$model
=
new
Model_User
();
$rs
=
$model
->
signBonus
(
$uid
,
$coin
);
return
$rs
;
}
public
function
equipment
(
$uid
)
public
function
equipment
(
$uid
)
{
{
$model
=
new
Model_User
();
$model
=
new
Model_User
();
...
...
api/Appapi/Model/User.php
View file @
d93cbcf0
...
@@ -23,17 +23,17 @@ class Model_User extends PhalApi_Model_NotORM
...
@@ -23,17 +23,17 @@ class Model_User extends PhalApi_Model_NotORM
$info
[
'vip'
]
=
getUserVip
(
$uid
);
$info
[
'vip'
]
=
getUserVip
(
$uid
);
$info
[
'liang'
]
=
getUserLiang
(
$uid
);
$info
[
'liang'
]
=
getUserLiang
(
$uid
);
$configpri
=
getConfigPri
();
$configpri
=
getConfigPri
();
$info
[
'auth_islimit'
]
=
$configpri
[
'auth_islimit'
];
$info
[
'auth_islimit'
]
=
$configpri
[
'auth_islimit'
];
$anchor_certification
=
0
;
$anchor_certification
=
0
;
$auth
=
DI
()
->
notorm
->
users_auth
->
where
(
"uid=?"
,
$uid
)
->
fetchOne
();
$auth
=
DI
()
->
notorm
->
users_auth
->
where
(
"uid=?"
,
$uid
)
->
fetchOne
();
if
(
!
empty
(
$auth
))
{
if
(
!
empty
(
$auth
))
{
$anchor_certification
=
3
;
$anchor_certification
=
3
;
if
(
$auth
[
'status'
]
==
0
)
{
if
(
$auth
[
'status'
]
==
0
)
{
$anchor_certification
=
2
;
$anchor_certification
=
2
;
}
}
if
(
$auth
[
'status'
]
==
1
)
{
if
(
$auth
[
'status'
]
==
1
)
{
$anchor_certification
=
1
;
$anchor_certification
=
1
;
}
}
}
}
...
@@ -48,19 +48,19 @@ class Model_User extends PhalApi_Model_NotORM
...
@@ -48,19 +48,19 @@ class Model_User extends PhalApi_Model_NotORM
protected
function
getFamilyRole
(
$uid
)
protected
function
getFamilyRole
(
$uid
)
{
{
$id
=
$type
=
0
;
$id
=
$type
=
0
;
$familyinfo
=
DI
()
->
notorm
->
family
->
where
(
"uid="
.
$uid
)
->
fetchOne
();
$familyinfo
=
DI
()
->
notorm
->
family
->
where
(
"uid="
.
$uid
)
->
fetchOne
();
$user_family
=
DI
()
->
notorm
->
users_family
->
where
(
"uid="
.
$uid
)
->
fetchOne
();
$user_family
=
DI
()
->
notorm
->
users_family
->
where
(
"uid="
.
$uid
)
->
fetchOne
();
if
(
!
empty
(
$familyinfo
))
{
if
(
!
empty
(
$familyinfo
))
{
$type
=
1
;
$type
=
1
;
$id
=
$familyinfo
[
'id'
];
$id
=
$familyinfo
[
'id'
];
}
}
if
(
!
empty
(
$user_family
))
{
if
(
!
empty
(
$user_family
))
{
$type
=
$user_family
[
'role'
]
?
2
:
3
;
$type
=
$user_family
[
'role'
]
?
2
:
3
;
$id
=
$user_family
[
'familyid'
];
$id
=
$user_family
[
'familyid'
];
}
}
return
[
$type
,
$id
];
return
[
$type
,
$id
];
}
}
/* 判断昵称是否重复 */
/* 判断昵称是否重复 */
...
@@ -177,9 +177,7 @@ class Model_User extends PhalApi_Model_NotORM
...
@@ -177,9 +177,7 @@ class Model_User extends PhalApi_Model_NotORM
return
1005
;
return
1005
;
}
}
$info
=
DI
()
->
notorm
->
users
->
select
(
"ban_cash"
)
$info
=
DI
()
->
notorm
->
users
->
select
(
"ban_cash"
)
->
where
(
'id=? and user_type="2"'
,
$uid
)
->
fetchOne
();
->
where
(
'id=? and user_type="2"'
,
$uid
)
->
fetchOne
();
if
(
$info
[
'ban_cash'
])
{
if
(
$info
[
'ban_cash'
])
{
return
1008
;
return
1008
;
...
@@ -348,9 +346,10 @@ class Model_User extends PhalApi_Model_NotORM
...
@@ -348,9 +346,10 @@ class Model_User extends PhalApi_Model_NotORM
$total
=
$rechange
[
'money'
]
+
$rechange
[
'give'
];
$total
=
$rechange
[
'money'
]
+
$rechange
[
'give'
];
DI
()
->
notorm
->
users
->
where
(
'id = ?'
,
$uid
)
->
update
([
'coin'
=>
new
NotORM_Literal
(
"coin +
{
$total
}
"
),
DI
()
->
notorm
->
users
->
where
(
'id = ?'
,
$uid
)
->
update
([
'votes'
=>
new
NotORM_Literal
(
"votes -
{
$rechange
[
'money'
]
}
"
),
'coin'
=>
new
NotORM_Literal
(
"coin +
{
$total
}
"
),
]);
'votes'
=>
new
NotORM_Literal
(
"votes -
{
$rechange
[
'money'
]
}
"
),
]);
return
0
;
return
0
;
}
}
...
@@ -371,19 +370,22 @@ class Model_User extends PhalApi_Model_NotORM
...
@@ -371,19 +370,22 @@ class Model_User extends PhalApi_Model_NotORM
public
function
attentList
(
$uid
)
public
function
attentList
(
$uid
)
{
{
$start
=
strtotime
(
date
(
"Y-m-d"
,
strtotime
(
"-15 day"
)));
$start
=
strtotime
(
date
(
"Y-m-d"
,
strtotime
(
"-15 day"
)));
$end
=
strtotime
(
date
(
'Y-m-d 23:59:59'
));
$end
=
strtotime
(
date
(
'Y-m-d 23:59:59'
));
$info
=
DI
()
->
notorm
->
users_attention
->
select
(
"uid"
)
->
where
(
"touid =
{
$uid
}
and addtime between
{
$start
}
and
{
$end
}
"
)
->
order
(
'addtime desc'
)
->
fetchAll
();
$info
=
DI
()
->
notorm
->
users_attention
->
select
(
"uid"
)
->
where
(
"touid =
{
$uid
}
and addtime between
{
$start
}
and
{
$end
}
"
)
->
order
(
'addtime desc'
)
->
fetchAll
();
foreach
(
$info
as
$k
=>
$v
)
{
foreach
(
$info
as
$k
=>
$v
)
{
$userinfo
=
getUserInfo
(
$v
[
'uid'
]);
$userinfo
=
getUserInfo
(
$v
[
'uid'
]);
$v
[
'user_nicename'
]
=
$userinfo
[
'user_nicename'
];
$v
[
'user_nicename'
]
=
$userinfo
[
'user_nicename'
];
$v
[
'avatar'
]
=
$userinfo
[
'avatar'
];
$v
[
'avatar'
]
=
$userinfo
[
'avatar'
];
$v
[
'avatar_thumb'
]
=
$userinfo
[
'avatar_thumb'
];
$v
[
'avatar_thumb'
]
=
$userinfo
[
'avatar_thumb'
];
$v
[
'level'
]
=
$userinfo
[
'level'
];
$v
[
'level'
]
=
$userinfo
[
'level'
];
$v
[
'level_anchor'
]
=
$userinfo
[
'level_anchor'
];
$v
[
'level_anchor'
]
=
$userinfo
[
'level_anchor'
];
$v
[
'isattent'
]
=
isAttention
(
$uid
,
$v
[
'uid'
]);
$v
[
'isattent'
]
=
isAttention
(
$uid
,
$v
[
'uid'
]);
$info
[
$k
]
=
$v
;
$info
[
$k
]
=
$v
;
}
}
return
$info
;
return
$info
;
...
@@ -891,22 +893,7 @@ class Model_User extends PhalApi_Model_NotORM
...
@@ -891,22 +893,7 @@ class Model_User extends PhalApi_Model_NotORM
if
(
$coin
)
{
if
(
$coin
)
{
$set
=
DI
()
->
notorm
->
experlevel_set
->
where
(
'id=1'
)
->
fetchOne
();
$set
=
DI
()
->
notorm
->
experlevel_set
->
where
(
'id=1'
)
->
fetchOne
();
$loginCoin
=
!
empty
(
$set
[
'login'
])
?
$set
[
'login'
]
:
0
;
$loginCoin
=
!
empty
(
$set
[
'login'
])
?
$set
[
'login'
]
:
0
;
DI
()
->
notorm
->
users
->
where
(
'id=?'
,
$uid
)
->
update
([
"coin"
=>
new
NotORM_Literal
(
"coin +
{
$coin
}
"
),
DI
()
->
notorm
->
users
->
where
(
'id=?'
,
$uid
)
->
update
([
"consumption"
=>
new
NotORM_Literal
(
"consumption +
{
$loginCoin
}
"
)]);
"consumption"
=>
new
NotORM_Literal
(
"consumption +
{
$loginCoin
}
"
),
]);
/* 记录 */
$insert
=
[
"type"
=>
'income'
,
"action"
=>
'loginbonus'
,
"uid"
=>
$uid
,
"touid"
=>
$uid
,
"giftid"
=>
$bonus_day
,
"giftcount"
=>
'0'
,
"totalcoin"
=>
$coin
,
"showid"
=>
'0'
,
"addtime"
=>
$nowtime
,
];
DI
()
->
notorm
->
users_coinrecord
->
insert
(
$insert
);
}
}
}
}
...
@@ -914,6 +901,30 @@ class Model_User extends PhalApi_Model_NotORM
...
@@ -914,6 +901,30 @@ class Model_User extends PhalApi_Model_NotORM
}
}
public
function
signBonus
(
$uid
,
$coin
)
{
$signinfo
=
DI
()
->
notorm
->
users_sign
->
select
(
"bonus_day"
)
->
where
(
'uid=?'
,
$uid
)
->
fetchOne
();
if
(
!
$signinfo
)
{
return
0
;
}
$bonus_day
=
$signinfo
[
'bonus_day'
];
DI
()
->
notorm
->
users
->
where
(
'id=?'
,
$uid
)
->
update
([
"coin"
=>
new
NotORM_Literal
(
"coin +
{
$coin
}
"
),]);
/* 记录 */
$insert
=
[
"type"
=>
'income'
,
"action"
=>
'loginbonus'
,
"uid"
=>
$uid
,
"touid"
=>
$uid
,
"giftid"
=>
$bonus_day
,
"giftcount"
=>
'0'
,
"totalcoin"
=>
$coin
,
"showid"
=>
'0'
,
"addtime"
=>
time
(),
];
DI
()
->
notorm
->
users_coinrecord
->
insert
(
$insert
);
return
1
;
}
public
function
equipment
(
$uid
)
public
function
equipment
(
$uid
)
{
{
$Liang
=
DI
()
->
notorm
->
liang
;
$Liang
=
DI
()
->
notorm
->
liang
;
...
@@ -959,32 +970,32 @@ class Model_User extends PhalApi_Model_NotORM
...
@@ -959,32 +970,32 @@ class Model_User extends PhalApi_Model_NotORM
public
function
setliang
(
$params
)
public
function
setliang
(
$params
)
{
{
$Liang
=
DI
()
->
notorm
->
liang
;
$Liang
=
DI
()
->
notorm
->
liang
;
$isexist
=
$Liang
->
where
(
"uid=
{
$params
[
'uid'
]
}
and id=
{
$params
[
'id'
]
}
"
)
->
fetchOne
();
$isexist
=
$Liang
->
where
(
"uid=
{
$params
[
'uid'
]
}
and id=
{
$params
[
'id'
]
}
"
)
->
fetchOne
();
if
(
!
$isexist
)
{
if
(
!
$isexist
)
{
return
1
;
return
1
;
}
}
DI
()
->
notorm
->
liang
->
where
(
"uid=
{
$params
[
'uid'
]
}
"
)
->
update
(
array
(
'state'
=>
0
)
);
DI
()
->
notorm
->
liang
->
where
(
"uid=
{
$params
[
'uid'
]
}
"
)
->
update
(
[
'state'
=>
0
]
);
$setstatus
=
$params
[
'state'
]
?
0
:
1
;
$setstatus
=
$params
[
'state'
]
?
0
:
1
;
$data
=
array
(
$data
=
[
'state'
=>
$setstatus
,
'state'
=>
$setstatus
,
)
;
]
;
DI
()
->
notorm
->
liang
->
where
(
"uid=
{
$params
[
'uid'
]
}
and id=
{
$params
[
'id'
]
}
"
)
->
update
(
$data
);
DI
()
->
notorm
->
liang
->
where
(
"uid=
{
$params
[
'uid'
]
}
and id=
{
$params
[
'id'
]
}
"
)
->
update
(
$data
);
$Users
=
DI
()
->
notorm
->
users
;
$Users
=
DI
()
->
notorm
->
users
;
$goodnum
=
$isexist
[
'name'
];
$goodnum
=
$isexist
[
'name'
];
$key
=
'liang_'
.
$params
[
'uid'
];
$key
=
'liang_'
.
$params
[
'uid'
];
if
(
$setstatus
==
1
)
{
if
(
$setstatus
==
1
)
{
$Users
->
where
(
"id=
{
$params
[
'uid'
]
}
"
)
->
update
([
'goodnum'
=>
$goodnum
]);
$Users
->
where
(
"id=
{
$params
[
'uid'
]
}
"
)
->
update
([
'goodnum'
=>
$goodnum
]);
$isexist
=
DI
()
->
notorm
->
liang
->
where
(
"uid=
{
$params
[
'uid'
]
}
and status=1 and state=1"
)
->
fetchOne
();
$isexist
=
DI
()
->
notorm
->
liang
->
where
(
"uid=
{
$params
[
'uid'
]
}
and status=1 and state=1"
)
->
fetchOne
();
if
(
$isexist
)
{
if
(
$isexist
)
{
setcaches
(
$key
,
$isexist
);
setcaches
(
$key
,
$isexist
);
}
}
}
else
{
}
else
{
$Users
->
where
(
"id=
{
$params
[
'uid'
]
}
"
)
->
update
([
'goodnum'
=>
0
]);
$Users
->
where
(
"id=
{
$params
[
'uid'
]
}
"
)
->
update
([
'goodnum'
=>
0
]);
delcache
(
$key
);
delcache
(
$key
);
}
}
...
@@ -994,33 +1005,33 @@ class Model_User extends PhalApi_Model_NotORM
...
@@ -994,33 +1005,33 @@ class Model_User extends PhalApi_Model_NotORM
public
function
setcar
(
$params
)
public
function
setcar
(
$params
)
{
{
$setstatus
=
$params
[
'state'
]
?
0
:
1
;
$setstatus
=
$params
[
'state'
]
?
0
:
1
;
$Car_u
=
DI
()
->
notorm
->
users_car
;
$Car_u
=
DI
()
->
notorm
->
users_car
;
$isexist
=
$Car_u
->
where
(
"uid=
{
$params
[
'uid'
]
}
and carid=
{
$params
[
'id'
]
}
"
)
->
fetchOne
();
$isexist
=
$Car_u
->
where
(
"uid=
{
$params
[
'uid'
]
}
and carid=
{
$params
[
'id'
]
}
"
)
->
fetchOne
();
if
(
!
$isexist
)
{
if
(
!
$isexist
)
{
return
1
;
return
1
;
}
}
$data1
=
array
(
$data1
=
[
'status'
=>
0
,
'status'
=>
0
,
)
;
]
;
// $Car_u->where("uid={$params['uid']}")->update($data1);
// $Car_u->where("uid={$params['uid']}")->update($data1);
DI
()
->
notorm
->
users_car
->
where
(
'uid = ?'
,
$params
[
'uid'
])
->
update
(
$data1
);
DI
()
->
notorm
->
users_car
->
where
(
'uid = ?'
,
$params
[
'uid'
])
->
update
(
$data1
);
$data
=
array
(
$data
=
[
'status'
=>
$setstatus
,
'status'
=>
$setstatus
,
)
;
]
;
DI
()
->
notorm
->
users_car
->
where
(
"uid=
{
$params
[
'uid'
]
}
and carid=
{
$params
[
'id'
]
}
"
)
->
update
(
$data
);
DI
()
->
notorm
->
users_car
->
where
(
"uid=
{
$params
[
'uid'
]
}
and carid=
{
$params
[
'id'
]
}
"
)
->
update
(
$data
);
$key
=
'car_'
.
$params
[
'uid'
];
$key
=
'car_'
.
$params
[
'uid'
];
if
(
$setstatus
)
{
if
(
$setstatus
)
{
$isexist
=
DI
()
->
notorm
->
users_car
->
where
(
"uid=
{
$params
[
'uid'
]
}
and status=1"
)
->
fetchOne
();
$isexist
=
DI
()
->
notorm
->
users_car
->
where
(
"uid=
{
$params
[
'uid'
]
}
and status=1"
)
->
fetchOne
();
if
(
$isexist
)
{
if
(
$isexist
)
{
setcaches
(
$key
,
$isexist
);
setcaches
(
$key
,
$isexist
);
}
}
}
else
{
}
else
{
delcache
(
$key
);
delcache
(
$key
);
}
}
...
@@ -1034,18 +1045,18 @@ class Model_User extends PhalApi_Model_NotORM
...
@@ -1034,18 +1045,18 @@ class Model_User extends PhalApi_Model_NotORM
return
$role
;
return
$role
;
}
}
$list
=
DI
()
->
notorm
->
users_family
->
select
(
'id, uid'
)
->
where
(
"familyid=
{
$familyId
}
and state=0"
)
->
fetchAll
();
$list
=
DI
()
->
notorm
->
users_family
->
select
(
'id, uid'
)
->
where
(
"familyid=
{
$familyId
}
and state=0"
)
->
fetchAll
();
foreach
(
$list
as
$k
=>
$v
)
{
foreach
(
$list
as
$k
=>
$v
)
{
$userinfo
=
getUserInfo
(
$v
[
'uid'
]);
$userinfo
=
getUserInfo
(
$v
[
'uid'
]);
$v
[
'user_nicename'
]
=
$userinfo
[
'user_nicename'
];
$v
[
'user_nicename'
]
=
$userinfo
[
'user_nicename'
];
$v
[
'avatar'
]
=
$userinfo
[
'avatar'
];
$v
[
'avatar'
]
=
$userinfo
[
'avatar'
];
$v
[
'avatar_thumb'
]
=
$userinfo
[
'avatar_thumb'
];
$v
[
'avatar_thumb'
]
=
$userinfo
[
'avatar_thumb'
];
$v
[
'sex'
]
=
$userinfo
[
'sex'
];
$v
[
'sex'
]
=
$userinfo
[
'sex'
];
$v
[
'level'
]
=
$userinfo
[
'level'
];
$v
[
'level'
]
=
$userinfo
[
'level'
];
$v
[
'level_anchor'
]
=
$userinfo
[
'level_anchor'
];
$v
[
'level_anchor'
]
=
$userinfo
[
'level_anchor'
];
$list
[
$k
]
=
$v
;
$list
[
$k
]
=
$v
;
}
}
return
$list
;
return
$list
;
...
@@ -1058,15 +1069,15 @@ class Model_User extends PhalApi_Model_NotORM
...
@@ -1058,15 +1069,15 @@ class Model_User extends PhalApi_Model_NotORM
return
$role
;
return
$role
;
}
}
$data
=
array
(
$data
=
[
'state'
=>
2
,
'state'
=>
2
,
'uptime'
=>
time
(),
'uptime'
=>
time
(),
'istip'
=>
'1'
,
'istip'
=>
'1'
,
'reason'
=>
''
'reason'
=>
''
,
)
;
]
;
$result
=
DI
()
->
notorm
->
users_family
->
where
(
"id=
{
$id
}
and familyid=
{
$familyId
}
"
)
->
update
(
$data
);
$result
=
DI
()
->
notorm
->
users_family
->
where
(
"id=
{
$id
}
and familyid=
{
$familyId
}
"
)
->
update
(
$data
);
if
(
$result
)
{
if
(
$result
)
{
return
1
;
return
1
;
}
}
...
@@ -1076,9 +1087,7 @@ class Model_User extends PhalApi_Model_NotORM
...
@@ -1076,9 +1087,7 @@ class Model_User extends PhalApi_Model_NotORM
public
function
inviteList
(
$uid
)
public
function
inviteList
(
$uid
)
{
{
//id, user_nicename, avatar,avatar_thumb,
//id, user_nicename, avatar,avatar_thumb,
$users
=
DI
()
->
notorm
->
users
->
select
(
" create_time"
)
$users
=
DI
()
->
notorm
->
users
->
select
(
" create_time"
)
->
where
(
'pid=? and user_type="2"'
,
$uid
)
->
fetchAll
();
->
where
(
'pid=? and user_type="2"'
,
$uid
)
->
fetchAll
();
// foreach ($users as $key => $user) {
// foreach ($users as $key => $user) {
// $users[$key]['create_time'] = date('Y-m-d H:i:s', $user['create_time']);
// $users[$key]['create_time'] = date('Y-m-d H:i:s', $user['create_time']);
// }
// }
...
@@ -1098,36 +1107,33 @@ class Model_User extends PhalApi_Model_NotORM
...
@@ -1098,36 +1107,33 @@ class Model_User extends PhalApi_Model_NotORM
if
(
$type
==
1
)
{
if
(
$type
==
1
)
{
$where
.=
" and addtime between
{
$start
}
and
{
$end
}
"
;
$where
.=
" and addtime between
{
$start
}
and
{
$end
}
"
;
$list
=
DI
()
->
notorm
->
users_family
->
select
(
'id, uid'
)
->
where
(
$where
)
->
fetchAll
();
$list
=
DI
()
->
notorm
->
users_family
->
select
(
'id, uid'
)
->
where
(
$where
)
->
fetchAll
();
}
}
if
(
in_array
(
$type
,
[
2
,
3
]))
{
if
(
in_array
(
$type
,
[
2
,
3
]))
{
$list
=
DI
()
->
notorm
->
users_family
->
select
(
'id, uid'
)
->
where
(
$where
)
->
fetchAll
();
$list
=
DI
()
->
notorm
->
users_family
->
select
(
'id, uid'
)
->
where
(
$where
)
->
fetchAll
();
}
}
foreach
(
$list
as
$k
=>
$v
){
foreach
(
$list
as
$k
=>
$v
)
{
$result
=
DI
()
->
notorm
->
users_live
$result
=
DI
()
->
notorm
->
users_live
->
select
(
"uid"
)
->
where
(
"islive= '1' and uid=
{
$v
[
'uid'
]
}
"
)
->
fetchOne
();
->
select
(
"uid"
)
->
where
(
"islive= '1' and uid=
{
$v
[
'uid'
]
}
"
)
->
fetchOne
();
if
(
$type
==
2
&&
!
$result
)
{
if
(
$type
==
2
&&
!
$result
)
{
unset
(
$list
[
$k
]);
unset
(
$list
[
$k
]);
continue
;
continue
;
}
}
$userinfo
=
getUserInfo
(
$v
[
'uid'
]);
$userinfo
=
getUserInfo
(
$v
[
'uid'
]);
$v
[
'user_nicename'
]
=
$userinfo
[
'user_nicename'
];
$v
[
'user_nicename'
]
=
$userinfo
[
'user_nicename'
];
$v
[
'avatar'
]
=
$userinfo
[
'avatar'
];
$v
[
'avatar'
]
=
$userinfo
[
'avatar'
];
$v
[
'avatar_thumb'
]
=
$userinfo
[
'avatar_thumb'
];
$v
[
'avatar_thumb'
]
=
$userinfo
[
'avatar_thumb'
];
$v
[
'sex'
]
=
$userinfo
[
'sex'
];
$v
[
'sex'
]
=
$userinfo
[
'sex'
];
$v
[
'level'
]
=
$userinfo
[
'level'
];
$v
[
'level'
]
=
$userinfo
[
'level'
];
$v
[
'level_anchor'
]
=
$userinfo
[
'level_anchor'
];
$v
[
'level_anchor'
]
=
$userinfo
[
'level_anchor'
];
$v
[
'isLive'
]
=
$result
?
1
:
0
;
$v
[
'isLive'
]
=
$result
?
1
:
0
;
$list
[
$k
]
=
$v
;
$list
[
$k
]
=
$v
;
}
}
return
[
return
[
'list'
=>
array_values
(
$list
),
'list'
=>
array_values
(
$list
),
'count'
=>
count
(
$list
)
'count'
=>
count
(
$list
)
,
];
];
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment