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
7d89811f
Commit
7d89811f
authored
Oct 19, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收款推送
parent
8ef0713e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
10 deletions
+58
-10
PushMessageService.php
application/api_broker/service/PushMessageService.php
+35
-10
GHousesToAgents.php
application/model/GHousesToAgents.php
+12
-0
Users.php
application/model/Users.php
+11
-0
No files found.
application/api_broker/service/PushMessageService.php
View file @
7d89811f
...
...
@@ -19,6 +19,7 @@ use app\model\MPushMessage;
use
app\model\OrderModel
;
use
app\model\OReportModel
;
use
app\model\PushFeed
;
use
app\model\Users
;
class
PushMessageService
...
...
@@ -65,29 +66,46 @@ class PushMessageService
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
pushMarchInMessage
(
$report_id
=
0
,
$type
=
1
)
public
function
pushMarchInMessage
(
$report_id
=
0
,
$type
=
1
,
$operation_id
)
{
$report
=
new
OReportModel
();
$field
=
'house_title,user_name,report_store_id,report_agent_id'
;
$field
=
'house_title,user_name,report_store_id,report_agent_id
,a.user_id,b.house_id
'
;
$report_data
=
$report
->
getReportOrder
(
$field
,
[
'a.id'
=>
$report_id
]);
$agent
=
new
AAgents
();
$agent_id
=
[];
if
(
$type
==
1
)
{
$content
=
"客户
{
$report_data
[
'user_name'
]
}
进场【
{
$report_data
[
'house_title'
]
}
】商铺"
;
$title
=
'进场'
;
$data
[
'message'
]
=
"客户
{
$report_data
[
'user_name'
]
}
进场【
{
$report_data
[
'house_title'
]
}
】商铺"
;
}
else
{
$content
=
"【
{
$report_data
[
'house_title'
]
}
】商铺收款"
;
$title
=
'收款'
;
}
$data
[
'message'
]
=
"【
{
$report_data
[
'house_title'
]
}
】商铺收款"
;
$m_user
=
new
Users
();
$client_agent
=
$m_user
->
getUserByWhereValue
(
'agent_id'
,
[
'id'
=>
$report_data
[
'user_id'
]]);
if
(
!
empty
(
$client_agent
))
{
$agent_id
[]
=
$client_agent
;
//客方
}
$agent_house
=
new
GHousesToAgents
();
$house_where
[
'houses_id'
]
=
$report_data
[
'house_id'
];
$house_where
[
'is_del'
]
=
0
;
$house_where
[
'type'
]
=
2
;
$agent_house_id
=
$agent_house
->
getAgentHouseValue
(
'agents_id'
,
$house_where
);
if
(
!
empty
(
$agent_house_id
))
{
$agent_id
[]
=
$agent_house_id
;
//
}
}
$where
[
'store_id'
]
=
$report_data
[
'report_store_id'
];
$where
[
'level'
]
=
[
'in'
,
'20,40'
];
$agent_store
=
$agent
->
getAgentInfo
(
'id'
,
''
,
$where
);
$this
->
pushAgentAllDeviceId
(
$report_data
[
'report_agent_id'
],
$title
,
$content
);
$this
->
pushAgentAllDeviceId
(
$agent_store
[
'id'
],
$title
,
$content
);
$agent_id
[]
=
$report_data
[
'report_agent_id'
];
$agent_id
[]
=
$agent_store
[
'id'
];
$this
->
record
(
2
,
0
,
$agent_id
,
$operation_id
,
$data
);
// $this->pushAgentAllDeviceId($report_data['report_agent_id'], $title, $content);
// $this->pushAgentAllDeviceId($agent_store['id'], $title, $content);
return
;
}
...
...
@@ -321,6 +339,13 @@ class PushMessageService
$id
=
$v
[
'addressee_id'
];
$type
=
'down_line'
;
$is_forbidden
=
1
;
break
;
case
5
:
$title
=
'收款'
;
break
;
case
6
:
$title
=
'进场'
;
break
;
}
$result
=
$this
->
pushAgentAllDeviceId
(
$v
[
'addressee_id'
],
$title
,
$v
[
'message'
],
$type
,
$id
,
$is_forbidden
);
...
...
application/model/GHousesToAgents.php
View file @
7d89811f
...
...
@@ -428,6 +428,18 @@ class GHousesToAgents extends BaseModel
->
column
(
$field
);
}
/**
* @param $field
* @param $type
* @param $houses_id
* @param int $is_del
* @return array
*/
public
function
getAgentHouseValue
(
$field
,
$where
)
{
return
$this
->
where
(
$where
)
->
value
(
$field
);
}
/**
* @param $field
* @param $where
...
...
application/model/Users.php
View file @
7d89811f
...
...
@@ -66,6 +66,17 @@ class Users extends Model
->
Column
(
$fields
);
}
/**
* @param $param
* @param $fields
* @return array
*/
public
function
getUserByWhereValue
(
$param
,
$fields
)
{
return
$this
->
where
(
$param
)
->
value
(
$fields
);
}
/**
* 查询好友邀请记录-后期加分页
* @param $param
...
...
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