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
9987a87b
Commit
9987a87b
authored
Dec 06, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
是否评价检测
parent
4d401290
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
12 deletions
+49
-12
AppointmentTime.php
application/api/controller/AppointmentTime.php
+31
-0
PushClientService.php
application/api/service/PushClientService.php
+14
-10
OPushMessageModel.php
application/model/OPushMessageModel.php
+3
-2
route.php
application/route.php
+1
-0
No files found.
application/api/controller/AppointmentTime.php
View file @
9987a87b
...
...
@@ -11,6 +11,7 @@ use app\model\GHouses;
use
app\model\GHousesImgs
;
use
app\model\GHousesToAgents
;
use
app\model\GImageDepot
;
use
app\model\OPushMessageModel
;
use
app\model\OReportModel
;
use
app\model\Users
;
...
...
@@ -294,5 +295,34 @@ class AppointmentTime extends Basic
}
/**
* 检查是有未评价
*
* @return \think\Response
*/
public
function
checkAppointment
()
{
$data
[
'name'
]
=
$msg
=
""
;
try
{
$m_push
=
new
OPushMessageModel
();
$where
[
'user_id'
]
=
$this
->
userId
;
// $where['user_id'] = 122;
$where
[
'status'
]
=
0
;
$id
=
$m_push
->
getListByWhere
(
'id,operation_id,message'
,
$where
,
1
,
1
);
if
(
empty
(
$id
[
0
][
'id'
]))
{
$data
[
'is_alert'
]
=
0
;
}
else
{
$data
[
'name'
]
=
$id
[
0
][
'message'
];
$data
[
'is_alert'
]
=
1
;
}
}
catch
(
\Exception
$e
)
{
$data
=
[];
$msg
=
"内部错误:"
.
$e
->
getMessage
();
}
return
$this
->
response
(
200
,
$msg
,
$data
);
}
}
\ No newline at end of file
application/api/service/PushClientService.php
View file @
9987a87b
...
...
@@ -44,8 +44,7 @@ class PushClientService
if
(
empty
(
$message
))
{
$m_agent
=
new
AAgents
();
$name
=
$m_agent
->
getAgentsById
(
$operation_id
,
'name'
);
$message
=
'同联商业邀请您评价经纪人'
.
$name
.
'对商铺的带看服务'
;
$message
=
$m_agent
->
getAgentsById
(
$operation_id
,
'name'
);
}
$data
[
'message'
]
=
$message
;
$data
[
'order_id'
]
=
$order_id
;
...
...
@@ -60,7 +59,7 @@ class PushClientService
public
function
pushRecord
()
{
$title
=
$type
=
''
;
$field
=
'id,
addressee
_id,type,message,house_id,user_id,order_id'
;
$field
=
'id,
operation
_id,type,message,house_id,user_id,order_id'
;
$where
[
'status'
]
=
$id
=
$is_forbidden
=
0
;
$push_data
=
$this
->
m_push
->
getDateLimit
(
$field
,
$where
,
100
);
...
...
@@ -68,12 +67,10 @@ class PushClientService
switch
(
$v
[
'type'
])
{
case
0
:
$title
=
"评价经纪人"
;
$id
=
$v
[
'house_id'
];
$type
=
'evaluate'
;
break
;
}
$this
->
pushAgentAllDeviceId
(
$v
[
'addressee_id'
],
$title
,
$v
[
'message'
],
$type
,
$id
,
$is_forbidden
,
$v
[
'house_id'
],
$v
[
'order_id'
]);
$this
->
pushAgentAllDeviceId
(
$v
[
'operation_id'
],
$title
,
$v
[
'message'
],
$type
,
$v
[
'user_id'
],
$is_forbidden
,
$v
[
'house_id'
],
$v
[
'order_id'
]);
$update_data
[
'status'
]
=
1
;
$update_data
[
'send_time'
]
=
date
(
'Y-m-d H:i:s'
);
...
...
@@ -96,16 +93,22 @@ class PushClientService
*/
public
function
pushAgentAllDeviceId
(
$id
,
$title
,
$content
,
$type
=
0
,
$user_id
=
0
,
$is_forbidden
=
0
,
$house_id
=
0
,
$order_id
=
0
)
{
if
(
empty
(
$id
))
{
if
(
empty
(
$
user_
id
))
{
return
false
;
}
$push
=
new
GeTuiUtils
(
'client'
);
$chat
=
new
ChatUser
();
$chat_ext
=
new
ChatUserExt
();
$ext_id
=
$chat
->
getFieldValue
(
'id'
,
[
'uesr_id'
=>
$user_id
,
'type'
=>
2
]);
$push_id
=
$chat_ext
->
getInfo
(
'push_id'
,
[
'ext_id'
=>
$ext_id
,
'is_forbidden'
=>
$is_forbidden
]);
$result
=
$push
->
public_push_message_for_one
(
$user_id
,
$push_id
[
'push_id'
],
$title
,
$content
,
$type
,
$user_id
,
$house_id
,
$order_id
);
$ext_id
=
$chat
->
getFieldValue
(
'id'
,
[
'user_id'
=>
$user_id
,
'type'
=>
2
]);
if
(
empty
(
$ext_id
))
{
$result
=
false
;
}
else
{
$push_id
=
$chat_ext
->
getInfo
(
'push_id'
,
[
'ext_id'
=>
$ext_id
,
'is_forbidden'
=>
$is_forbidden
]);
$result
=
$push
->
public_push_message_for_one
(
$id
,
$push_id
[
'push_id'
],
$title
,
$content
,
$type
,
$user_id
,
$house_id
,
$order_id
);
}
return
$result
;
}
}
\ No newline at end of file
application/model/OPushMessageModel.php
View file @
9987a87b
...
...
@@ -11,13 +11,14 @@ namespace app\model;
use
think\Db
;
class
OPushMessageModel
class
OPushMessageModel
extends
BaseModel
{
protected
$table
=
"u_push_message"
;
private
$db_
;
public
function
__construct
()
public
function
__construct
(
$data
=
[]
)
{
parent
::
__construct
(
$data
);
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
...
...
application/route.php
View file @
9987a87b
...
...
@@ -423,6 +423,7 @@ Route::group('api', [
//post AppointmentTime
'getAppointmentSeeShopList'
=>
[
'api/appointmentTime/getAppointmentSeeShopList'
,
[
'method'
=>
'post|get'
]],
'addAppointmentSeeShop'
=>
[
'api/appointmentTime/addAppointmentSeeShop'
,
[
'method'
=>
'post|get'
]],
'checkAppointment'
=>
[
'api/appointmentTime/checkAppointment'
,
[
'method'
=>
'get'
]],
//tradeLog
...
...
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