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
dea0ff21
Commit
dea0ff21
authored
Sep 12, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
冻结推送
parent
b5aeddc2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
38 deletions
+46
-38
PushMessageService.php
application/api_broker/service/PushMessageService.php
+17
-9
Agent.php
application/index/controller/Agent.php
+29
-29
No files found.
application/api_broker/service/PushMessageService.php
View file @
dea0ff21
...
@@ -262,12 +262,8 @@ class PushMessageService
...
@@ -262,12 +262,8 @@ class PushMessageService
*/
*/
public
function
record
(
$type
,
$house_id
,
$agent_id
,
$operation_id
,
$data
=
[])
public
function
record
(
$type
,
$house_id
,
$agent_id
,
$operation_id
,
$data
=
[])
{
{
$result
=
false
;
$m_push
=
new
MPushMessage
();
$m_push
=
new
MPushMessage
();
switch
(
$type
)
{
switch
(
$type
)
{
case
0
:
$result
=
$m_push
->
addData
(
$data
,
$operation_id
,
$type
);
break
;
case
1
:
case
1
:
$result
=
$m_push
->
addHouseIdArray
(
$house_id
,
$operation_id
,
$type
,
$data
);
$result
=
$m_push
->
addHouseIdArray
(
$house_id
,
$operation_id
,
$type
,
$data
);
break
;
break
;
...
@@ -277,19 +273,22 @@ class PushMessageService
...
@@ -277,19 +273,22 @@ class PushMessageService
case
3
:
case
3
:
$data
[
'house_id'
]
=
$house_id
;
$data
[
'house_id'
]
=
$house_id
;
$result
=
$m_push
->
addAgentIdArray
(
$agent_id
,
$operation_id
,
$type
,
$data
);
$result
=
$m_push
->
addAgentIdArray
(
$agent_id
,
$operation_id
,
$type
,
$data
);
break
;
default
:
$result
=
$m_push
->
addData
(
$data
,
$operation_id
,
$type
);
}
}
return
$result
;
return
$result
;
}
}
/**
/**
*
*
消息推送
*/
*/
public
function
pushRecord
()
public
function
pushRecord
()
{
{
$title
=
''
;
$title
=
$type
=
''
;
$m_push
=
new
MPushMessage
();
$m_push
=
new
MPushMessage
();
$field
=
'id,addressee_id,type,message,house_id'
;
$field
=
'id,addressee_id,type,message,house_id
,user_id
'
;
$where
[
'status'
]
=
0
;
$where
[
'status'
]
=
$id
=
0
;
$push_data
=
$m_push
->
getDateLimit
(
$field
,
$where
,
100
);
$push_data
=
$m_push
->
getDateLimit
(
$field
,
$where
,
100
);
foreach
(
$push_data
[
'data'
]
as
$k
=>
$v
)
{
foreach
(
$push_data
[
'data'
]
as
$k
=>
$v
)
{
...
@@ -300,16 +299,25 @@ class PushMessageService
...
@@ -300,16 +299,25 @@ class PushMessageService
switch
(
$v
[
'type'
])
{
switch
(
$v
[
'type'
])
{
case
1
:
case
1
:
$title
=
"商铺下架"
;
$title
=
"商铺下架"
;
$id
=
$v
[
'house_id'
];
$type
=
'house_info'
;
break
;
break
;
case
2
:
case
2
:
$title
=
"修改客方"
;
$title
=
"修改客方"
;
$type
=
'user_info'
;
break
;
break
;
case
3
:
case
3
:
$title
=
'盘方修改'
;
$title
=
'盘方修改'
;
$id
=
$v
[
'house_id'
];
$type
=
'house_info'
;
break
;
break
;
case
4
:
$title
=
'账号冻结'
;
$id
=
$v
[
'addressee_id'
];
$type
=
'down_line'
;
}
}
$result
=
$this
->
pushAgentAllDeviceId
(
$v
[
'addressee_id'
],
$title
,
$v
[
'message'
],
'house_info'
,
$v
[
'house_id'
]
);
$result
=
$this
->
pushAgentAllDeviceId
(
$v
[
'addressee_id'
],
$title
,
$v
[
'message'
],
$type
,
$id
);
$update_data
[
'status'
]
=
1
;
$update_data
[
'status'
]
=
1
;
$update_data
[
'send_time'
]
=
date
(
'Y-m-d H:i:s'
);
$update_data
[
'send_time'
]
=
date
(
'Y-m-d H:i:s'
);
...
...
application/index/controller/Agent.php
View file @
dea0ff21
...
@@ -22,17 +22,13 @@
...
@@ -22,17 +22,13 @@
namespace
app\index\controller
;
namespace
app\index\controller
;
use
app\api_broker\service\CallPhoneService
;
use
app\api_broker\service\CallPhoneService
;
use
app\api_broker\service\PushMessageService
;
use
app\index\extend\Basic
;
use
app\index\extend\Basic
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\ABindingDevice
;
use
app\model\ABindingDevice
;
use
app\model\Agents
;
use
app\model\AStore
;
use
app\model\BindingPhone
;
use
app\model\Evaluate
;
use
app\model\Evaluate
;
use
app\model\Regions
;
use
think\Exception
;
use
think\Exception
;
use
think\Session
;
use
think\Session
;
use
think\Db
;
class
Agent
extends
Basic
class
Agent
extends
Basic
{
{
...
@@ -83,14 +79,14 @@ class Agent extends Basic
...
@@ -83,14 +79,14 @@ class Agent extends Basic
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
//条件
//条件
// $where['a.status'] = ['IN',['0,1']];
// $where['a.status'] = ['IN',['0,1']];
$where
[
'a.id'
]
=
[
'<>'
,
1
];
$where
[
'a.id'
]
=
[
'<>'
,
1
];
if
(
!
empty
(
$params
[
'search'
]))
{
if
(
!
empty
(
$params
[
'search'
]))
{
$where
[]
=
[
'EXP'
,
"a.name like '%
{
$params
[
'search'
]
}
%' OR a.phone like '%
{
$params
[
'search'
]
}
%'"
];
$where
[]
=
[
'EXP'
,
"a.name like '%
{
$params
[
'search'
]
}
%' OR a.phone like '%
{
$params
[
'search'
]
}
%'"
];
}
}
if
(
!
empty
(
$params
[
'group_name'
]))
{
if
(
!
empty
(
$params
[
'group_name'
]))
{
$where
[
'g.title'
]
=
[
'LIKE'
,
"%
{
$params
[
'group_name'
]
}
%"
];
$where
[
'g.title'
]
=
[
'LIKE'
,
"%
{
$params
[
'group_name'
]
}
%"
];
}
}
if
(
!
empty
(
$params
[
'store_id'
]))
{
if
(
!
empty
(
$params
[
'store_id'
]))
{
...
@@ -134,11 +130,11 @@ class Agent extends Basic
...
@@ -134,11 +130,11 @@ class Agent extends Basic
$params
[
"agent_id"
]
=
$agent_id
;
$params
[
"agent_id"
]
=
$agent_id
;
$field
=
"id,agent_id,device_id,model,is_forbidden,is_pc,create_time,update_time"
;
$field
=
"id,agent_id,device_id,model,is_forbidden,is_pc,create_time,update_time"
;
$result
=
$aBD
->
getDeviceByAgentId
(
$params
,
$field
);
$result
=
$aBD
->
getDeviceByAgentId
(
$params
,
$field
);
if
(
count
(
$result
)
>
0
)
{
if
(
count
(
$result
)
>
0
)
{
return
$this
->
response
(
"200"
,
"success"
,
$result
);
return
$this
->
response
(
"200"
,
"success"
,
$result
);
}
else
{
}
else
{
return
$this
->
response
(
"101"
,
"此账号未绑定过设备"
);
return
$this
->
response
(
"101"
,
"此账号未绑定过设备"
);
}
}
}
}
...
@@ -282,20 +278,25 @@ class Agent extends Basic
...
@@ -282,20 +278,25 @@ class Agent extends Basic
//同时修改设备绑定表
//同时修改设备绑定表
$m_agent_device
=
new
ABindingDevice
();
$m_agent_device
=
new
ABindingDevice
();
$m_agent_device
->
updateDate
([
'is_forbidden'
=>
$is_forbidden
],
[
'agent_id'
=>
$ids
]);
$m_agent_device
->
updateDate
([
'is_forbidden'
=>
$is_forbidden
],
[
'agent_id'
=>
$ids
]);
if
(
$data
[
'status'
]
==
1
)
{
if
(
$data
[
'status'
]
==
1
)
{
$where
[
'a.id'
]
=
$ids
;
$where
[
'a.id'
]
=
$ids
;
$where
[
'b.status'
]
=
1
;
$where
[
'b.status'
]
=
1
;
$agent_phone
=
$m_agent
->
getAgentCallPhone
(
'b.phone_a,b.phone_b,c.phone_x'
,
$where
);
$agent_phone
=
$m_agent
->
getAgentCallPhone
(
'b.phone_a,b.phone_b,c.phone_x'
,
$where
);
if
(
!
empty
(
$agent_phone
[
'data'
])
&&
$agent_phone
[
'status'
]
!=
'fail'
)
{
if
(
!
empty
(
$agent_phone
[
'data'
])
&&
$agent_phone
[
'status'
]
!=
'fail'
)
{
$call
=
new
CallPhoneService
();
$call
=
new
CallPhoneService
();
foreach
(
$agent_phone
[
'data'
]
as
$k
=>
$v
)
{
foreach
(
$agent_phone
[
'data'
]
as
$k
=>
$v
)
{
$call
->
agentsUnBind
(
$v
[
'phone_a'
],
$v
[
'phone_b'
],
$v
[
'phone_x'
],
0
);
$call
->
agentsUnBind
(
$v
[
'phone_a'
],
$v
[
'phone_b'
],
$v
[
'phone_x'
],
0
);
}
}
}
}
$push
=
new
PushMessageService
();
$message_data
[
'message'
]
=
'你的账号被冻结。'
;
$message_data
[
'agent_id'
]
=
$ids
;
$push
->
record
(
0
,
0
,
0
,
$this
->
userId
,
$message_data
);
}
}
return
$this
->
response
(
200
,
'成功'
,
$data
);
return
$this
->
response
(
200
,
'成功'
,
$data
);
}
else
{
}
else
{
...
@@ -336,7 +337,6 @@ class Agent extends Basic
...
@@ -336,7 +337,6 @@ class Agent extends Basic
}
}
/**
/**
* 经纪人列表计算-评价次数和分数
* 经纪人列表计算-评价次数和分数
* 朱伟 2018年07月03日
* 朱伟 2018年07月03日
...
@@ -347,28 +347,28 @@ class Agent extends Basic
...
@@ -347,28 +347,28 @@ class Agent extends Basic
/*$data = array(
/*$data = array(
"agents_id" => '869,5758,5757,5756,5755,5754,5753,5752,5751,5750,5749,5748,5747,5746,5745'
"agents_id" => '869,5758,5757,5756,5755,5754,5753,5752,5751,5750,5749,5748,5747,5746,5745'
);*/
);*/
$agents_ids
=
$data
[
'agents_id'
];
$agents_ids
=
$data
[
'agents_id'
];
if
(
!
isset
(
$agents_ids
))
{
if
(
!
isset
(
$agents_ids
))
{
return
$this
->
response
(
"300"
,
"参数不全"
);
return
$this
->
response
(
"300"
,
"参数不全"
);
}
}
$model
=
new
Evaluate
();
$model
=
new
Evaluate
();
foreach
(
explode
(
','
,
$agents_ids
)
as
$k
=>
$v
)
{
foreach
(
explode
(
','
,
$agents_ids
)
as
$k
=>
$v
)
{
$params
[
'agents_id'
]
=
$v
;
$params
[
'agents_id'
]
=
$v
;
//dump($v);
//dump($v);
$field
=
'sum(evaluate_grade) as agent_evaluate_fraction'
;
$field
=
'sum(evaluate_grade) as agent_evaluate_fraction'
;
$agent_evaluate_num
=
$model
->
getAgentEvaluateNum
(
$params
);
$agent_evaluate_num
=
$model
->
getAgentEvaluateNum
(
$params
);
$agent_evaluate_fraction_res
=
$model
->
getAgentEvaluateFraction
(
$field
,
$params
);
$agent_evaluate_fraction_res
=
$model
->
getAgentEvaluateFraction
(
$field
,
$params
);
$agent_evaluate_fraction
=
0
;
$agent_evaluate_fraction
=
0
;
if
(
$agent_evaluate_fraction_res
[
0
][
'agent_evaluate_fraction'
])
{
if
(
$agent_evaluate_fraction_res
[
0
][
'agent_evaluate_fraction'
])
{
$agent_evaluate_fraction
=
round
(
$agent_evaluate_fraction_res
[
0
][
'agent_evaluate_fraction'
]
/
2
/
$agent_evaluate_num
,
1
);
$agent_evaluate_fraction
=
round
(
$agent_evaluate_fraction_res
[
0
][
'agent_evaluate_fraction'
]
/
2
/
$agent_evaluate_num
,
1
);
}
}
$res
[
'agents_id'
]
=
$v
;
$res
[
'agents_id'
]
=
$v
;
$res
[
'agent_evaluate_num'
]
=
$agent_evaluate_num
;
$res
[
'agent_evaluate_num'
]
=
$agent_evaluate_num
;
$res
[
'agent_evaluate_fraction'
]
=
$agent_evaluate_fraction
;
$res
[
'agent_evaluate_fraction'
]
=
$agent_evaluate_fraction
;
$result
[]
=
$res
;
$result
[]
=
$res
;
}
}
if
(
$result
)
{
if
(
$result
)
{
...
...
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