Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
e1123fa0
Commit
e1123fa0
authored
Jan 18, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设置客户邀请人
parent
2c0a7899
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
10 deletions
+48
-10
Member.php
application/api/controller/Member.php
+23
-0
User.php
application/api_broker/controller/User.php
+3
-0
UserService.php
application/index/service/UserService.php
+11
-10
Users.php
application/model/Users.php
+9
-0
route.php
application/route.php
+2
-0
No files found.
application/api/controller/Member.php
View file @
e1123fa0
...
...
@@ -3,6 +3,7 @@
namespace
app\api\controller
;
use
app\api_broker\service\PushMessageService
;
use
app\index\service\UserService
;
use
app\model\AAgents
;
use
think\Request
;
use
app\api\extend\Basic
;
...
...
@@ -535,4 +536,25 @@ class Member extends Basic
}
return
$referrer_user_string
;
}
/**
* 设置客户邀请人
* @return \think\Response
*/
public
function
setUserInvite
()
{
$params
=
$this
->
params
;
/* $params = array(
"user_id" => 1
);*/
if
(
empty
(
$params
[
'user_id'
])
or
empty
(
$params
[
'phone'
]))
{
return
$this
->
response
(
101
,
'参数缺失'
,
''
);
}
$s_index_user
=
new
UserService
();
$result
=
$s_index_user
->
userInvite
(
$params
[
'user_id'
],
$params
[
'phone'
]);
return
$this
->
response
(
"200"
,
"请求成功"
,
$result
);
}
}
\ No newline at end of file
application/api_broker/controller/User.php
View file @
e1123fa0
...
...
@@ -955,4 +955,6 @@ class User extends Basic
}
}
}
\ No newline at end of file
application/index/service/UserService.php
View file @
e1123fa0
...
...
@@ -657,7 +657,7 @@ class UserService
* @param $phone
* @return int
*/
public
function
userInvite
(
$phone
)
public
function
userInvite
(
$
user_id
,
$
phone
)
{
$m_agent
=
new
AAgents
();
// 判断经纪人表是否存在
...
...
@@ -670,16 +670,16 @@ class UserService
return
4
;
}
if
(
$agent_res
){
//todo 邀请人 为 经纪人 经纪人表客户表同时存在
return
4
;
}
else
{
//todo 邀请人 为 经纪人 只存在于客户表
return
4
;
if
(
$agent_res
)
{
// 邀请人 为 经纪人 经纪人表客户表同时存在
$referrer_source
=
20
;
$referrer_id
=
$agent_res
;
}
else
{
// 邀请人 为 经纪人 只存在于客户表
$referrer_source
=
10
;
$referrer_id
=
$user_res
;
}
$this
->
user
->
setUserInvite
(
$user_id
,
$referrer_source
,
$referrer_id
);
}
}
\ No newline at end of file
application/model/Users.php
View file @
e1123fa0
...
...
@@ -1029,5 +1029,14 @@ class Users extends Model
//dump($this->getLastSql());
return
$result
;
}
public
function
setUserInvite
(
$user_id
,
$referrer_source
,
$referrer_id
)
{
$result
=
$this
->
where
([
'id'
=>
$user_id
])
->
update
([
'referrer_source'
=>
$referrer_source
,
'referrer_id'
=>
$referrer_id
]);
//dump($this->getLastSql());
// big_log($this->getLastSql());
return
$result
;
}
}
application/route.php
View file @
e1123fa0
...
...
@@ -443,6 +443,8 @@ Route::group('api', [
'register'
=>
[
'api/member/register'
,
[
'method'
=>
'post'
]],
//注册|邀请注册|编辑
'uploadHeadImg'
=>
[
'api/member/uploadHeadImg'
,
[
'method'
=>
'post'
]],
//头像上传
'setUserInvite'
=>
[
'api/member/setUserInvite'
,
[
'method'
=>
'get | post'
]],
// shop
'getShopList'
=>
[
'api/shop/getShopList'
,
[
'method'
=>
'get|post'
]],
'filtrateCondition'
=>
[
'api/shop/filtrateCondition'
,
[
'method'
=>
'get | post'
]],
...
...
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