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
27ef8902
Commit
27ef8902
authored
Apr 17, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增客方推送
parent
1c61ae7c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
25 deletions
+44
-25
Member.php
application/api/controller/Member.php
+5
-6
Client.php
application/api_broker/controller/Client.php
+13
-15
PushMessageService.php
application/api_broker/service/PushMessageService.php
+22
-0
Users.php
application/model/Users.php
+4
-4
No files found.
application/api/controller/Member.php
View file @
27ef8902
...
...
@@ -2,8 +2,7 @@
namespace
app\api\controller
;
use
app\api\untils\GeTuiUntils
;
use
app\model\AAgents
;
use
app\api_broker\service\PushMessageService
;
use
think\Request
;
use
app\api\extend\Basic
;
use
app\api\untils\MessageUntils
;
...
...
@@ -279,11 +278,11 @@ class Member extends Basic
}
}
$ge_tui
=
new
GeTuiUntils
();
$agent_
=
new
AAgents
();
$agent_data
=
$agent_
->
getAgentInfo
(
'device_id'
,
$referrer_id
);
if
(
!
empty
(
$insert_data
[
'agent_id'
]))
{
$push
=
new
PushMessageService
();
$content
=
'你有新客户【'
.
$user_nick
.
'-'
.
$phone
.
'】成功注册App'
;
$ge_tui
->
public_push_message_for_one
(
$referrer_id
,
$agent_data
[
'device_id'
],
'邀请注册'
,
$content
);
$push
->
pushMessageById
(
$insert_data
[
'agent_id'
],
'邀请注册'
,
$content
);
}
}
}
$insert_data
[
'referrer_id'
]
=
$referrer_id
;
//经纪人邀请
...
...
application/api_broker/controller/Client.php
View file @
27ef8902
...
...
@@ -3,8 +3,8 @@
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\PushMessageService
;
use
app\model\AAgents
;
use
app\model\Agents
;
use
app\model\ULabels
;
use
app\model\Users
;
use
app\model\UPhoneFollowPp
;
...
...
@@ -53,31 +53,29 @@ class Client extends Basic
if
(
$this
->
params
[
'agents_id'
]
!=
$this
->
params
[
'ccr_id'
])
{
$agent
=
new
AAgents
();
$agent_data
=
$agent
->
getAgentInfo
(
'name,phone'
,
$this
->
params
[
'agents_id'
]);
$remark
=
'修改客方为'
.
$agent_data
[
'name'
]
.
'-'
.
$agent_data
[
'phone'
];
}
else
{
$remark
=
'用户编辑'
;
$remark
=
'修改为'
.
$agent_data
[
'name'
]
.
'-'
.
$agent_data
[
'phone'
];
$push
=
new
PushMessageService
();
$push
->
pushMessageById
(
$this
->
params
[
'ccr_id'
]);
$this
->
operating_records
(
$this
->
params
[
'ccr_id'
],
$type
=
3
,
$remark
,
0
,
$this
->
params
[
'id'
]);
}
//编辑
$data
[
'start'
]
=
$this
->
user
->
edit
(
$this
->
params
,
$this
->
params
[
'id'
]);
$this
->
operating_records
(
$this
->
params
[
'ccr_id'
],
$type
=
3
,
$remark
,
0
,
$this
->
params
[
'id'
]);
}
else
{
$table
=
new
AAgents
();
//添加
$data
[
'start'
]
=
$this
->
user
->
edit
(
$this
->
params
);
if
(
$data
[
'start'
]
!=
1
)
{
$this
->
code
=
101
;
$this
->
msg
=
'该用户已存在'
;
}
elseif
(
$data
[
'start'
]
==
1
){
$data
[
'id'
]
=
$this
->
user
->
id
;
$this
->
operating_records
(
$this
->
params
[
'ccr_id'
],
$type
=
3
,
$remark
=
'用户添加'
,
0
,
$data
[
'id'
]);
}
else
{
if
(
$data
[
'start'
]
==
1
)
{
$data
[
'id'
]
=
$this
->
user
->
id
;
//获取客方数据
$name
=
$table
->
where
(
'id'
,
$this
->
params
[
'agents_id'
])
->
value
(
'name'
);
$remark
=
'客方添加为 '
.
$name
;
$agent_data
=
$table
->
getAgentInfo
(
'name,phone'
,
$this
->
params
[
'agents_id'
]);
$remark
=
'新增为'
.
$agent_data
[
'name'
]
.
'-'
.
$agent_data
[
'phone'
];
$this
->
operating_records
(
$this
->
params
[
'ccr_id'
],
$type
=
3
,
$remark
,
0
,
$data
[
'id'
]);
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'该用户已存在'
;
}
}
}
else
{
...
...
application/api_broker/service/PushMessageService.php
View file @
27ef8902
...
...
@@ -139,4 +139,25 @@ class PushMessageService
return
;
}
/**
* 普通消息推送
*
* @param $id
* @param $title
* @param $content
* @return array|void
*/
public
function
pushMessageById
(
$id
,
$title
,
$content
)
{
if
(
empty
(
$id
))
{
return
false
;
}
$ge_tui
=
new
GeTuiUntils
();
$agent
=
new
AAgents
();
$device_id
=
$agent
->
getAgentsById
(
$id
,
'device_id'
);
$result
=
$ge_tui
->
public_push_message_for_one
(
$id
,
$device_id
,
$title
,
$content
);
return
$result
;
}
}
\ No newline at end of file
application/model/Users.php
View file @
27ef8902
...
...
@@ -222,12 +222,12 @@ class Users extends Model
*/
public
function
getClient
(
$id
)
{
if
(
$id
)
{
$data
=
$this
->
field
(
'a.id as user_id,a.user_nick,a.user_phone,a.sex,a.agent_id,a.create_time,b.
real
name,b.phone'
)
$data
=
$this
->
field
(
'a.id as user_id,a.user_nick,a.user_phone,a.sex,a.agent_id,a.create_time,b.name,b.phone'
)
->
alias
(
'a'
)
->
join
(
'agents b'
,
'a.agent_id=b.id'
,
'left'
)
->
join
(
'a
_a
gents b'
,
'a.agent_id=b.id'
,
'left'
)
->
where
(
'a.id'
,
$id
)
->
find
();
$data
[
'agents'
]
=
$data
[
'
real
name'
]
.
'-'
.
$data
[
'phone'
];
unset
(
$data
[
'
real
name'
]);
$data
[
'agents'
]
=
$data
[
'name'
]
.
'-'
.
$data
[
'phone'
];
unset
(
$data
[
'name'
]);
unset
(
$data
[
'phone'
]);
}
else
{
$data
=
false
;
...
...
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