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
a398dce9
Commit
a398dce9
authored
Dec 03, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
评价经纪人推送
parent
9b1b53cc
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
362 additions
and
59 deletions
+362
-59
Broker.php
application/api/controller/Broker.php
+2
-2
PushClientService.php
application/api/service/PushClientService.php
+105
-0
GeTuiUtils.php
application/api/untils/GeTuiUtils.php
+72
-42
OrderLog.php
application/api_broker/controller/OrderLog.php
+5
-0
OrderLogService.php
application/api_broker/service/OrderLogService.php
+0
-5
PushMessageService.php
application/api_broker/service/PushMessageService.php
+3
-4
ReportService.php
application/api_broker/service/ReportService.php
+2
-5
ChatUser.php
application/model/ChatUser.php
+9
-0
ChatUserExt.php
application/model/ChatUserExt.php
+14
-0
OPushMessageModel.php
application/model/OPushMessageModel.php
+128
-0
OReportModel.php
application/model/OReportModel.php
+10
-0
route.php
application/route.php
+1
-0
PushMessageTask.php
application/task/controller/PushMessageTask.php
+11
-1
No files found.
application/api/controller/Broker.php
View file @
a398dce9
...
@@ -151,8 +151,8 @@ class Broker extends Basic
...
@@ -151,8 +151,8 @@ class Broker extends Basic
'update_time'
=>
$date
,
'update_time'
=>
$date
,
];
];
}
}
$resu
tl
=
$evaluate_sign
->
saveAll
(
$sign_data
);
$resu
lt
=
$evaluate_sign
->
saveAll
(
$sign_data
);
foreach
(
$resu
tl
as
$vv
)
{
foreach
(
$resu
lt
as
$vv
)
{
$id_arr
[]
=
$vv
->
id
;
$id_arr
[]
=
$vv
->
id
;
}
}
}
}
...
...
application/api/service/PushClientService.php
0 → 100644
View file @
a398dce9
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/11/30
* Time: 14:58
*/
namespace
app\api\service
;
use
app\api\untils\GeTuiUtils
;
use
app\model\ChatUser
;
use
app\model\ChatUserExt
;
use
app\model\OPushMessageModel
;
use
app\model\OrderModel
;
use
app\model\OReportModel
;
class
PushClientService
{
private
$m_push
;
public
function
__construct
()
{
$this
->
m_push
=
new
OPushMessageModel
();
}
/**
* @param int $report_id
* @param int $order_id
* @param int $type
* @param $message
* @param int $operation_id
* @return bool
*/
public
function
record
(
int
$report_id
,
int
$order_id
,
int
$type
,
$message
,
int
$operation_id
)
{
$order
=
new
OrderModel
();
$house_id
=
$order
->
getFieldValue
(
'house_id'
,
[
'id'
=>
$order_id
]);
$report
=
new
OReportModel
();
$user_id
=
$report
->
getFieldValue
(
'user_id'
,
$report_id
);
$data
[
'message'
]
=
$message
;
$data
[
'order_id'
]
=
$order_id
;
$data
[
'house_id'
]
=
$house_id
;
$data
[
'user_id'
]
=
$user_id
;
return
$this
->
m_push
->
addData
(
$data
,
$operation_id
,
$type
);
}
/**
* 消息推送
*/
public
function
pushRecord
()
{
$title
=
$type
=
''
;
$field
=
'id,addressee_id,type,message,house_id,user_id,order_id'
;
$where
[
'status'
]
=
$id
=
$is_forbidden
=
0
;
$push_data
=
$this
->
m_push
->
getDateLimit
(
$field
,
$where
,
100
);
foreach
(
$push_data
[
'data'
]
as
$k
=>
$v
)
{
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'
]);
$update_data
[
'status'
]
=
1
;
$update_data
[
'send_time'
]
=
date
(
'Y-m-d H:i:s'
);
$this
->
m_push
->
updateData
(
$update_data
,
[
'id'
=>
$v
[
'id'
]
]);
}
return
;
}
/**
* @param $id
* @param $title
* @param $content
* @param int $type
* @param int $user_id
* @param int $is_forbidden
* @param int $house_id
* @param int $order_id
* @return array|bool
* @throws \Exception
*/
public
function
pushAgentAllDeviceId
(
$id
,
$title
,
$content
,
$type
=
0
,
$user_id
=
0
,
$is_forbidden
=
0
,
$house_id
=
0
,
$order_id
=
0
)
{
if
(
empty
(
$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
);
return
$result
;
}
}
\ No newline at end of file
application/api/untils/GeTuiU
n
tils.php
→
application/api/untils/GeTuiUtils.php
100755 → 100644
View file @
a398dce9
...
@@ -8,14 +8,11 @@
...
@@ -8,14 +8,11 @@
namespace
app\api\untils
;
namespace
app\api\untils
;
//define ('TL_GETUI_APPID','A8raBWQxuX9bcVmk3rkWa5');
use
think\Loader
;
//define ('TL_GETUI_APPSECRET','TLNDlz8YsW6J4gexzb4AX3');
//define ('TL_GETUI_APPKEY','dEC3iu81ZC9XbsVLwoiHA6');
define
(
'TL_GETUI_APPID'
,
'A8raBWQxuX9bcVmk3rkWa5'
);
//define ('TL_GETUI_MASTERSECRET','3NNdfsgjCJ6Rmfr9l0EeI1');
define
(
'TL_GETUI_APPSECRET'
,
'TLNDlz8YsW6J4gexzb4AX3'
);
//define ('TL_GETUI_HOST','http://sdk.open.api.igexin.com/apiex.htm');
define
(
'TL_GETUI_APPKEY'
,
'dEC3iu81ZC9XbsVLwoiHA6'
);
define
(
'TL_GETUI_MASTERSECRET'
,
'3NNdfsgjCJ6Rmfr9l0EeI1'
);
define
(
'TL_GETUI_HOST'
,
'http://sdk.open.api.igexin.com/apiex.htm'
);
//define ('TL_GETUI_APPID','Cp63kT0yXMAmxVmekIQVI5');
//define ('TL_GETUI_APPID','Cp63kT0yXMAmxVmekIQVI5');
//define ('TL_GETUI_APPSECRET','6BW6MJoIiK70mC3rJ1nK47');
//define ('TL_GETUI_APPSECRET','6BW6MJoIiK70mC3rJ1nK47');
...
@@ -23,29 +20,54 @@ define ('TL_GETUI_HOST','http://sdk.open.api.igexin.com/apiex.htm');
...
@@ -23,29 +20,54 @@ define ('TL_GETUI_HOST','http://sdk.open.api.igexin.com/apiex.htm');
//define ('TL_GETUI_MASTERSECRET','02DunI3DGL60rXkud74YZ8');
//define ('TL_GETUI_MASTERSECRET','02DunI3DGL60rXkud74YZ8');
//define ('TL_GETUI_HOST','http://sdk.open.api.igexin.com/apiex.htm');
//define ('TL_GETUI_HOST','http://sdk.open.api.igexin.com/apiex.htm');
class
GeTuiU
n
tils
{
class
GeTuiUtils
{
public
function
__construct
()
const
IGT_HOST
=
'http://sdk.open.api.igexin.com/apiex.htm'
;
private
$igt_app_id
=
''
;
private
$igt_app_secret
=
''
;
private
$igt_app_key
=
''
;
private
$igt_app_master_secret
=
''
;
public
function
__construct
(
$user_type
)
{
{
include_once
(
EXTEND_PATH
.
'GETUI_PHP_SDK'
.
DS
.
'IGt.Push.php'
);
include_once
(
EXTEND_PATH
.
'GETUI_PHP_SDK'
.
DS
.
'IGt.Push.php'
);
$this
->
setting
(
$user_type
);
}
/**
* @param $is 1经纪人
*/
public
function
setting
(
$is
)
{
if
(
$is
==
'broker'
)
{
$this
->
igt_app_id
=
'A8raBWQxuX9bcVmk3rkWa5'
;
$this
->
igt_app_secret
=
'TLNDlz8YsW6J4gexzb4AX3'
;
$this
->
igt_app_key
=
'dEC3iu81ZC9XbsVLwoiHA6'
;
$this
->
igt_app_master_secret
=
'3NNdfsgjCJ6Rmfr9l0EeI1'
;
}
else
{
$this
->
igt_app_id
=
'1GnogURb3Y8cjQjmRtxXcA'
;
$this
->
igt_app_secret
=
'qgCUSOcEQi52vRKQe6MYp8'
;
$this
->
igt_app_key
=
'oQuYepflY8A7r0yGK9f9D4'
;
$this
->
igt_app_master_secret
=
'numYAK4xpq8TEZHvaqeAT6'
;
}
}
}
/**
/**
* 个推
* 个推
*
*
* @param $touchuan
* @param $data
* @param $black_title
* @param $content
* @return array
* @return array
* @throws \Exception
*/
*/
function
push_message_for_one
(
$data
)
function
push_message_for_one
(
$data
)
{
{
$cid
=
$data
[
'device_id'
];
$cid
=
$data
[
'device_id'
];
$igt
=
new
\IGeTui
(
TL_GETUI_HOST
,
TL_GETUI_APPKEY
,
TL_GETUI_MASTERSECRET
);
$igt
=
new
\IGeTui
(
self
::
IGT_HOST
,
$this
->
igt_app_key
,
$this
->
igt_app_master_secret
);
//模板
//模板
$template
=
$this
->
onli_all_template
(
$data
[
'touchuan'
],
$data
[
'black_title'
],
$data
[
'content'
]);
$template
=
$this
->
onli
ne
_all_template
(
$data
[
'touchuan'
],
$data
[
'black_title'
],
$data
[
'content'
]);
//个推信息体
//个推信息体
$message
=
new
\IGtSingleMessage
();
$message
=
new
\IGtSingleMessage
();
...
@@ -55,28 +77,31 @@ class GeTuiUntils {
...
@@ -55,28 +77,31 @@ class GeTuiUntils {
$message
->
set_PushNetWorkType
(
0
);
//设置是否根据WIFI推送消息,1为wifi推送,0为不限制推送
$message
->
set_PushNetWorkType
(
0
);
//设置是否根据WIFI推送消息,1为wifi推送,0为不限制推送
//接收方
//接收方
$target
=
new
\IGtTarget
();
$target
=
new
\IGtTarget
();
$target
->
set_appId
(
TL_GETUI_APPID
);
$target
->
set_appId
(
$this
->
igt_app_id
);
$target
->
set_clientId
(
$cid
);
$target
->
set_clientId
(
$cid
);
try
{
try
{
$rep
=
$igt
->
pushMessageToSingle
(
$message
,
$target
);
$rep
=
$igt
->
pushMessageToSingle
(
$message
,
$target
);
}
catch
(
RequestException
$e
)
{
}
catch
(
\
RequestException
$e
)
{
$requ
stId
=
$e
.
getRequestId
();
$requ
estId
=
$e
->
getRequestId
();
$rep
=
$igt
->
pushMessageToSingle
(
$message
,
$target
,
$requstId
);
$rep
=
$igt
->
pushMessageToSingle
(
$message
,
$target
,
$requ
e
stId
);
}
}
return
$rep
;
return
$rep
;
}
}
/**
/**
* 群推
* 群推
* zhuwei
*
* 2017-11-06
* @param $title
* @param $content
* @param $link
* @return mixed|null
* @throws \Exception
*/
*/
function
push_message_for_all
(
$title
,
$content
,
$link
)
function
push_message_for_all
(
$title
,
$content
,
$link
)
{
{
$igt
=
new
\IGeTui
(
TL_GETUI_HOST
,
TL_GETUI_APPKEY
,
TL_GETUI_MASTERSECRET
);
$igt
=
new
\IGeTui
(
self
::
IGT_HOST
,
$this
->
igt_app_key
,
$this
->
igt_app_master_secret
);
$homeurl
=
$this
->
http_host
();
$home
_
url
=
$this
->
http_host
();
$data
[
'black_title'
]
=
$title
;
$data
[
'black_title'
]
=
$title
;
$data
[
'content'
]
=
$content
;
$data
[
'content'
]
=
$content
;
$data
[
'touchuan'
]
=
json_encode
(
array
(
$data
[
'touchuan'
]
=
json_encode
(
array
(
...
@@ -86,9 +111,9 @@ class GeTuiUntils {
...
@@ -86,9 +111,9 @@ class GeTuiUntils {
'url'
=>
$link
,
'url'
=>
$link
,
'name'
=>
$title
,
'name'
=>
$title
,
'id'
=>
'69'
,
'id'
=>
'69'
,
'imageUrl'
=>
$homeurl
.
'/notice_android_logo.png'
));
'imageUrl'
=>
$home
_
url
.
'/notice_android_logo.png'
));
$template
=
$this
->
onli_all_template
(
$data
[
'touchuan'
],
$data
[
'black_title'
],
$data
[
'content'
]);
$template
=
$this
->
onli
ne
_all_template
(
$data
[
'touchuan'
],
$data
[
'black_title'
],
$data
[
'content'
]);
//个推信息体
//个推信息体
//基于应用消息体
//基于应用消息体
...
@@ -98,7 +123,7 @@ class GeTuiUntils {
...
@@ -98,7 +123,7 @@ class GeTuiUntils {
$message
->
set_data
(
$template
);
$message
->
set_data
(
$template
);
$message
->
set_PushNetWorkType
(
0
);
//设置是否根据WIFI推送消息,1为wifi推送,0为不限制推送
$message
->
set_PushNetWorkType
(
0
);
//设置是否根据WIFI推送消息,1为wifi推送,0为不限制推送
//$message->set_speed(1);// 设置群推接口的推送速度,单位为条/秒,例如填写100,则为100条/秒。仅对指定应用群推接口有效。
//$message->set_speed(1);// 设置群推接口的推送速度,单位为条/秒,例如填写100,则为100条/秒。仅对指定应用群推接口有效。
$appIdList
=
array
(
TL_GETUI_APPID
);
$appIdList
=
array
(
$this
->
igt_app_id
);
$message
->
set_appIdList
(
$appIdList
);
$message
->
set_appIdList
(
$appIdList
);
$rep
=
$igt
->
pushMessageToApp
(
$message
);
$rep
=
$igt
->
pushMessageToApp
(
$message
);
return
$rep
;
return
$rep
;
...
@@ -106,29 +131,33 @@ class GeTuiUntils {
...
@@ -106,29 +131,33 @@ class GeTuiUntils {
/**
/**
* 推送模板
* 推送模板
* zhuwei
*
* 2017-11-06
* @param $touchuan
* @param $black_title
* @param $content
* @return \IGtTransmissionTemplate
* @throws \Exception
*/
*/
function
onli_all_template
(
$touchuan
,
$black_title
,
$content
)
function
onli
ne
_all_template
(
$touchuan
,
$black_title
,
$content
)
{
{
$template
=
new
\IGtTransmissionTemplate
();
$template
=
new
\IGtTransmissionTemplate
();
$template
->
set_appId
(
TL_GETUI_APPID
);
//应用appid
$template
->
set_appId
(
$this
->
igt_app_id
);
//应用appid
$template
->
set_appkey
(
TL_GETUI_APPKEY
);
//应用appkey
$template
->
set_appkey
(
$this
->
igt_app_key
);
//应用appkey
$template
->
set_transmissionType
(
2
);
//透传消息类型
$template
->
set_transmissionType
(
2
);
//透传消息类型
$template
->
set_transmissionContent
(
$touchuan
);
//透传内容
$template
->
set_transmissionContent
(
$touchuan
);
//透传内容
//APN高级推送
//APN高级推送
$apn
=
new
\IGtAPNPayload
();
$apn
=
new
\IGtAPNPayload
();
$alertmsg
=
new
\DictionaryAlertMsg
();
$alert
_
msg
=
new
\DictionaryAlertMsg
();
$alertmsg
->
body
=
$content
;
//对应的是在线透传的content
$alert
_
msg
->
body
=
$content
;
//对应的是在线透传的content
$alertmsg
->
actionLocKey
=
"打开同联商业"
;
//滑动打开app
$alert
_
msg
->
actionLocKey
=
"打开同联商业"
;
//滑动打开app
$alertmsg
->
locKey
=
$content
;
//锁屏提示下框
$alert
_
msg
->
locKey
=
$content
;
//锁屏提示下框
$alertmsg
->
title
=
$black_title
;
//标题 锁屏标题
$alert
_
msg
->
title
=
$black_title
;
//标题 锁屏标题
$alertmsg
->
titleLocKey
=
$black_title
;
//下拉通知上部框框
$alert
_
msg
->
titleLocKey
=
$black_title
;
//下拉通知上部框框
$alertmsg
->
titleLocArgs
=
array
(
"TitleLocArg"
);
$alert
_
msg
->
titleLocArgs
=
array
(
"TitleLocArg"
);
$apn
->
alertMsg
=
$alertmsg
;
$apn
->
alertMsg
=
$alert
_
msg
;
$apn
->
badge
=
1
;
//应用icon上显示的数字
$apn
->
badge
=
1
;
//应用icon上显示的数字
$apn
->
sound
=
""
;
$apn
->
sound
=
""
;
$template
->
set_apnInfo
(
$apn
);
$template
->
set_apnInfo
(
$apn
);
...
@@ -147,6 +176,7 @@ class GeTuiUntils {
...
@@ -147,6 +176,7 @@ class GeTuiUntils {
* @param $house_id
* @param $house_id
* @param $order_id
* @param $order_id
* @return array
* @return array
* @throws \Exception
*/
*/
function
public_push_message_for_one
(
$id
,
$device_id
,
$title
,
$content
,
$type
=
'other'
,
$user_id
,
$house_id
,
$order_id
)
function
public_push_message_for_one
(
$id
,
$device_id
,
$title
,
$content
,
$type
=
'other'
,
$user_id
,
$house_id
,
$order_id
)
{
{
...
@@ -190,7 +220,7 @@ class GeTuiUntils {
...
@@ -190,7 +220,7 @@ class GeTuiUntils {
curl_setopt
(
$curl
,
CURLOPT_RETURNTRANSFER
,
1
);
curl_setopt
(
$curl
,
CURLOPT_RETURNTRANSFER
,
1
);
$result
=
curl_exec
(
$curl
);
$result
=
curl_exec
(
$curl
);
if
(
curl_errno
(
$curl
))
{
if
(
curl_errno
(
$curl
))
{
return
'Err
n
o'
.
curl_error
(
$curl
);
return
'Err
N
o'
.
curl_error
(
$curl
);
}
}
curl_close
(
$curl
);
curl_close
(
$curl
);
return
$result
;
return
$result
;
...
...
application/api_broker/controller/OrderLog.php
View file @
a398dce9
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
app\api_broker\controller
;
namespace
app\api_broker\controller
;
use
app\api\service\PushClientService
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\HouseNumUpdateService
;
use
app\api_broker\service\HouseNumUpdateService
;
use
app\api_broker\service\OrderLogService
;
use
app\api_broker\service\OrderLogService
;
...
@@ -128,6 +129,10 @@ class OrderLog extends Basic
...
@@ -128,6 +129,10 @@ class OrderLog extends Basic
$pushMarchIn
=
new
PushMessageService
();
$pushMarchIn
=
new
PushMessageService
();
$pushMarchIn
->
pushMarchInMessage
(
$params
[
"report_id"
],
1
,
$params
[
"report_id"
]);
//推送
$pushMarchIn
->
pushMarchInMessage
(
$params
[
"report_id"
],
1
,
$params
[
"report_id"
]);
//推送
//评价经纪人
$push_client
=
new
PushClientService
();
$push_client
->
record
((
int
)
$params
[
"report_id"
],
(
int
)
$params
[
"order_id"
],
0
,
'评价经纪人'
,
$this
->
agentId
);
return
$this
->
response
(
"200"
,
"request success"
,
[]);
return
$this
->
response
(
"200"
,
"request success"
,
[]);
}
else
{
}
else
{
return
$this
->
response
(
"101"
,
"request faild"
);
return
$this
->
response
(
"101"
,
"request faild"
);
...
...
application/api_broker/service/OrderLogService.php
View file @
a398dce9
...
@@ -2,16 +2,12 @@
...
@@ -2,16 +2,12 @@
namespace
app\api_broker\service
;
namespace
app\api_broker\service
;
use
app\api\untils\GeTuiUntils
;
use
app\model\AAgents
;
use
app\model\FollowUpLogModel
;
use
app\model\FollowUpLogModel
;
use
app\model\GHousesFollowUp
;
use
app\model\GHousesFollowUp
;
use
app\model\GHousesToAgents
;
use
app\model\GHousesToAgents
;
use
app\model\OBargainModel
;
use
app\model\OBargainModel
;
use
app\model\OFinancialAudit
;
use
app\model\OImg
;
use
app\model\OImg
;
use
app\model\OMarchInModel
;
use
app\model\OMarchInModel
;
use
app\model\OPartialCommission
;
use
app\model\OPayLogModel
;
use
app\model\OPayLogModel
;
use
app\model\OrderModel
;
use
app\model\OrderModel
;
use
app\model\ORealIncome
;
use
app\model\ORealIncome
;
...
@@ -21,7 +17,6 @@ use app\model\OTaxes;
...
@@ -21,7 +17,6 @@ use app\model\OTaxes;
use
app\model\Regions
;
use
app\model\Regions
;
use
app\model\UPhoneFollowPp
;
use
app\model\UPhoneFollowPp
;
use
app\model\Users
;
use
app\model\Users
;
use
think\helper\Arr
;
/**
/**
...
...
application/api_broker/service/PushMessageService.php
View file @
a398dce9
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
namespace
app\api_broker\service
;
namespace
app\api_broker\service
;
use
app\api\untils\GeTuiU
n
tils
;
use
app\api\untils\GeTuiUtils
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\ABindingDevice
;
use
app\model\ABindingDevice
;
use
app\model\AStore
;
use
app\model\AStore
;
...
@@ -28,7 +28,7 @@ class PushMessageService
...
@@ -28,7 +28,7 @@ class PushMessageService
public
function
__construct
()
public
function
__construct
()
{
{
$this
->
push
=
new
GeTuiU
ntils
(
);
$this
->
push
=
new
GeTuiU
tils
(
'broker'
);
}
}
/**
/**
...
@@ -258,6 +258,7 @@ class PushMessageService
...
@@ -258,6 +258,7 @@ class PushMessageService
* @param int $house_id
* @param int $house_id
* @param int $order_id
* @param int $order_id
* @return array|bool
* @return array|bool
* @throws \Exception
*/
*/
public
function
pushAgentAllDeviceId
(
$id
,
$title
,
$content
,
$type
=
0
,
$user_id
=
0
,
$is_forbidden
=
0
,
$house_id
=
0
,
$order_id
=
0
)
public
function
pushAgentAllDeviceId
(
$id
,
$title
,
$content
,
$type
=
0
,
$user_id
=
0
,
$is_forbidden
=
0
,
$house_id
=
0
,
$order_id
=
0
)
{
{
...
@@ -385,7 +386,6 @@ class PushMessageService
...
@@ -385,7 +386,6 @@ class PushMessageService
$m_push
->
updateData
(
$update_data
,
[
'id'
=>
$v
[
'id'
]
]);
$m_push
->
updateData
(
$update_data
,
[
'id'
=>
$v
[
'id'
]
]);
}
}
}
}
return
;
return
;
}
}
}
}
\ No newline at end of file
application/api_broker/service/ReportService.php
View file @
a398dce9
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
namespace
app\api_broker\service
;
namespace
app\api_broker\service
;
use
app\api\untils\GeTuiU
n
tils
;
use
app\api\untils\GeTuiUtils
;
use
app\model\GHouses
;
use
app\model\GHouses
;
use
app\model\GHousesToAgents
;
use
app\model\GHousesToAgents
;
use
app\model\OrderModel
;
use
app\model\OrderModel
;
...
@@ -30,14 +30,11 @@ class ReportService
...
@@ -30,14 +30,11 @@ class ReportService
$this
->
oReportModel
=
new
OReportModel
();
$this
->
oReportModel
=
new
OReportModel
();
}
}
/**
/**
* 验证用户信息
* 验证用户信息
*
* @param $user_id
* @param $user_id
* @return array|null
* @return array|null
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
*/
public
function
verifyUser
(
$user_id
)
public
function
verifyUser
(
$user_id
)
{
{
...
...
application/model/ChatUser.php
View file @
a398dce9
...
@@ -77,4 +77,12 @@ class ChatUser extends Model
...
@@ -77,4 +77,12 @@ class ChatUser extends Model
return
$data
;
return
$data
;
}
}
/**
* @param $field
* @param $where
* @return mixed
*/
public
function
getFieldValue
(
$field
,
$where
)
{
return
$this
->
db
->
where
(
$where
)
->
value
(
$field
);
}
}
}
\ No newline at end of file
application/model/ChatUserExt.php
View file @
a398dce9
...
@@ -177,4 +177,17 @@ class ChatUserExt extends BaseModel
...
@@ -177,4 +177,17 @@ class ChatUserExt extends BaseModel
}
}
return
$num
;
return
$num
;
}
}
/**
* @param $field
* @param $where
* @param string $order
* @return mixed
*/
public
function
getInfo
(
$field
,
$where
,
$order
=
'ID DESC'
)
{
return
$this
->
db
->
field
(
$field
)
->
where
(
$where
)
->
order
(
$order
)
->
find
();
}
}
}
\ No newline at end of file
application/model/OPushMessageModel.php
0 → 100644
View file @
a398dce9
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/11/30
* Time: 15:01
*/
namespace
app\model
;
use
think\Db
;
class
OPushMessageModel
{
protected
$table
=
"o_push_message"
;
private
$db_
;
public
function
__construct
()
{
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
/**
* @param $data
* @param $operation_id
* @param $type
* @return bool
*/
public
function
addData
(
$data
,
$operation_id
,
$type
)
{
if
(
isset
(
$data
[
'house_id'
]))
{
$insert_data
[
'house_id'
]
=
$data
[
'house_id'
];
}
if
(
isset
(
$data
[
'message'
]))
{
$insert_data
[
'message'
]
=
$data
[
'message'
];
}
if
(
isset
(
$data
[
'remark'
]))
{
$insert_data
[
'remark'
]
=
$data
[
'remark'
];
}
if
(
isset
(
$data
[
'order_id'
]))
{
$insert_data
[
'order_id'
]
=
$data
[
'order_id'
];
}
if
(
isset
(
$data
[
'user_id'
]))
{
$insert_data
[
'user_id'
]
=
$data
[
'user_id'
];
}
$insert_data
[
'status'
]
=
0
;
$insert_data
[
'type'
]
=
$type
;
$insert_data
[
'operation_id'
]
=
$operation_id
;
$num
=
$this
->
db_
->
insert
(
$insert_data
);
if
(
$num
>
0
)
{
$result
=
true
;
}
else
{
$result
=
false
;
}
return
$result
;
}
/**
* @param $data
* @param $where
* @return int|string
*/
public
function
updateData
(
$data
,
$where
)
{
try
{
$this
->
db_
->
where
(
$where
)
->
update
(
$data
);
$result
[
'status'
]
=
'successful'
;
}
catch
(
\Exception
$e
)
{
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
$e
->
getMessage
();
}
return
$result
;
}
/**
* @param string $field
* @param array $params
* @param int $page_no
* @param int $page_size
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getListByWhere
(
string
$field
,
array
$params
,
int
$page_no
=
1
,
int
$page_size
=
15
)
{
return
$this
->
db_
->
field
(
$field
)
->
where
(
$params
)
->
order
(
" id desc"
)
->
page
(
$page_no
)
->
limit
(
$page_size
)
->
select
();
}
/**
* 获取指定条数
*
* @param $field
* @param $where
* @param $limit
* @return mixed
*/
public
function
getDateLimit
(
$field
,
$where
,
$limit
)
{
try
{
$result
[
'data'
]
=
$this
->
db_
->
field
(
$field
)
->
where
(
$where
)
->
limit
(
$limit
)
->
select
();
$result
[
'status'
]
=
'successful'
;
}
catch
(
\Exception
$e
)
{
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
$e
->
getMessage
();
}
return
$result
;
}
}
\ No newline at end of file
application/model/OReportModel.php
View file @
a398dce9
...
@@ -968,4 +968,13 @@ class OReportModel extends Model
...
@@ -968,4 +968,13 @@ class OReportModel extends Model
->
group
(
'a.report_agent_id '
)
->
group
(
'a.report_agent_id '
)
->
find
();
->
find
();
}
}
/**
* @param $field
* @param $where
* @return mixed
*/
public
function
getFieldValue
(
$field
,
$where
)
{
return
$this
->
db
->
where
(
$where
)
->
value
(
$field
);
}
}
}
\ No newline at end of file
application/route.php
View file @
a398dce9
...
@@ -523,6 +523,7 @@ Route::group('task', [
...
@@ -523,6 +523,7 @@ Route::group('task', [
'updateShopAgeLimit'
=>
[
'task/JobTask/updateShopAgeLimit'
,
[
'method'
=>
'get'
]],
//默认年限
'updateShopAgeLimit'
=>
[
'task/JobTask/updateShopAgeLimit'
,
[
'method'
=>
'get'
]],
//默认年限
'push'
=>
[
'task/PushMessageTask/push'
,
[
'method'
=>
'get'
]],
//推送
'push'
=>
[
'task/PushMessageTask/push'
,
[
'method'
=>
'get'
]],
//推送
'push'
=>
[
'task/PushMessageTask/pushClient'
,
[
'method'
=>
'get'
]],
//推送
'updateLandlordLimit'
=>
[
'task/JobTask/updateLandlordLimit'
,
[
'method'
=>
'get'
]]
//转换房东手机号
'updateLandlordLimit'
=>
[
'task/JobTask/updateLandlordLimit'
,
[
'method'
=>
'get'
]]
//转换房东手机号
]);
]);
...
...
application/task/controller/PushMessageTask.php
View file @
a398dce9
...
@@ -9,15 +9,24 @@
...
@@ -9,15 +9,24 @@
namespace
app\task\controller
;
namespace
app\task\controller
;
use
app\api\service\PushClientService
;
use
app\api_broker\service\PushMessageService
;
use
app\api_broker\service\PushMessageService
;
class
PushMessageTask
class
PushMessageTask
{
{
/**
/**
* 定时推送
* 定时推送
(5分钟)
*/
*/
public
function
push
()
{
public
function
push
()
{
$push
=
new
PushMessageService
();
$push
=
new
PushMessageService
();
$push
->
pushRecord
();
$push
->
pushRecord
();
}
}
/**
* 定时推送 (1分钟)
*/
public
function
pushClient
()
{
$push
=
new
PushClientService
();
$push
->
pushRecord
();
}
}
}
\ No newline at end of file
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