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
15be56a5
Commit
15be56a5
authored
May 07, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
推送feed流
parent
72dace17
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
110 additions
and
44 deletions
+110
-44
GeTuiUntils.php
application/api/untils/GeTuiUntils.php
+13
-1
Feed.php
application/api_broker/controller/Feed.php
+20
-0
PushMessageService.php
application/api_broker/service/PushMessageService.php
+27
-42
Index.php
application/app/controller/Index.php
+5
-1
feed.html
application/app/view/index/feed.html
+11
-0
PushFeed.php
application/model/PushFeed.php
+17
-0
PushHistory.php
application/model/PushHistory.php
+16
-0
route.php
application/route.php
+1
-0
No files found.
application/api/untils/GeTuiUntils.php
View file @
15be56a5
...
...
@@ -73,12 +73,24 @@ class GeTuiUntils {
* zhuwei
* 2017-11-06
*/
function
push_message_for_all
(
$
data
)
function
push_message_for_all
(
$
title
,
$content
,
$link
)
{
$igt
=
new
\IGeTui
(
TL_GETUI_HOST
,
TL_GETUI_APPKEY
,
TL_GETUI_MASTERSECRET
);
$homeurl
=
$this
->
http_host
();
$data
[
'black_title'
]
=
$title
;
$data
[
'content'
]
=
$content
;
$data
[
'touchuan'
]
=
json_encode
(
array
(
'title'
=>
$title
,
'content'
=>
$content
,
'type'
=>
'url'
,
'url'
=>
$link
,
'name'
=>
$title
,
'id'
=>
'69'
,
'imageUrl'
=>
$homeurl
.
'/notice_android_logo.png'
));
$template
=
$this
->
onli_all_template
(
$data
[
'touchuan'
],
$data
[
'black_title'
],
$data
[
'content'
]);
//个推信息体
//基于应用消息体
$message
=
new
\IGtAppMessage
();
$message
->
set_isOffline
(
true
);
...
...
application/api_broker/controller/Feed.php
0 → 100644
View file @
15be56a5
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/5/7
* Time: 16:47
*/
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
class
Feed
extends
Basic
{
public
function
pushFeed
()
{
}
}
\ No newline at end of file
application/api_broker/service/PushMessageService.php
View file @
15be56a5
...
...
@@ -16,6 +16,8 @@ use app\model\GHouses;
use
app\model\GHousesToAgents
;
use
app\model\OrderModel
;
use
app\model\OReportModel
;
use
app\model\PushFeed
;
use
app\model\PushHistory
;
use
app\model\Users
;
class
PushMessageService
...
...
@@ -87,7 +89,7 @@ class PushMessageService
}
/**
* 成交报告推送
* 成交报告推送
(feed流喜报)
*
* @param int $report_id
* @throws \think\db\exception\DataNotFoundException
...
...
@@ -95,53 +97,36 @@ class PushMessageService
* @throws \think\exception\DbException
*/
public
function
pushBargainMessage
(
$report_id
=
0
){
$agent
=
new
AAgents
();
$agent_house
=
new
GHousesToAgents
();
$user
=
new
Users
();
$field
=
'house_id,house_title,report_agent_name,report_store_id,user_id'
;
$report
=
new
OReportModel
();
$report_data
=
$report
->
getReportOrder
(
$field
,
[
'a.id'
=>
$report_id
]);
$user_agent_id
=
$user
->
getUserById
(
'agent_id'
,
$report_data
[
'user_id'
]);
$key
=
0
;
//客方
if
(
!
empty
(
$user_agent_id
[
'agent_id'
]))
{
$agent_data
[
$key
][
'id'
]
=
$user_agent_id
[
'agent_id'
];
$agent_data
[
$key
][
'device_id'
]
=
$agent
->
getAgentsById
(
$user_agent_id
[
'agent_id'
],
'device_id'
);
$key
++
;
}
$device_id
=
$agent
->
getAgentInfo
(
'id,device_id'
,
''
,
[
'store_id'
=>
$report_data
[
'report_store_id'
],
'level'
=>
[
'in'
,
'20,40'
]
]);
//店长
if
(
$device_id
[
'device_id'
])
{
$agent_data
[
$key
][
'id'
]
=
$device_id
[
'id'
];
$agent_data
[
$key
][
'device_id'
]
=
$device_id
[
'device_id'
];
$key
++
;
}
$report
=
new
OReportModel
();
$feed
=
new
PushFeed
();
$history
=
new
PushHistory
();
$field
=
'house_id,house_title,report_agent_name,report_store_id,user_id'
;
//独家方和盘方
$agent_houser_data
=
$agent_house
->
getHousesAgents
(
$report_data
[
'house_id'
],
'b.id,b.device_id'
,[
'type'
=>
[
'in'
,
'2,3'
]]);
foreach
(
$agent_houser_data
as
$v
)
{
if
(
!
empty
(
$v
[
'device_id'
]))
{
$agent_data
[
$key
][
'id'
]
=
$v
[
'id'
];
$agent_data
[
$key
][
'device_id'
]
=
$v
[
'device_id'
];
$key
++
;
}
}
$report_data
=
$report
->
getReportOrder
(
$field
,
[
'a.id'
=>
$report_id
]);
$store
=
new
AStore
();
$store_name
=
$store
->
getStoreKeyById
(
'store_name'
,
$report_data
[
'report_store_id'
]);
$title
=
'成交就是这么简单'
;
$content
=
"恭喜【
{
$store_name
}
】店【
{
$report_data
[
'report_agent_name'
]
}
】成交【
{
$report_data
[
'house_title'
]
}
】商铺一套"
;
$url
=
$this
->
push
->
http_host
()
.
'/app/feed'
;
foreach
(
$agent_data
as
$k
=>
$v
)
{
$this
->
push
->
public_push_message_for_one
(
$v
[
'id'
],
$v
[
'device_id'
],
'成交就是这么简单'
,
$content
);
}
$feed
->
editData
([
'agent_id'
=>
0
,
'report_id'
=>
$report_id
,
'house_id'
=>
$report_data
[
'house_id'
],
'feed_content'
=>
$content
,
]);
$history
->
editData
([
'title'
=>
$title
,
'content'
=>
$content
,
'link'
=>
$url
,
'read_num'
=>
10
,
//不要问什么,就是产品要加的。PV
'click_num'
=>
10
,
//不要问什么,就是产品要加的。
'feed_id'
=>
$feed
->
id
,
]);
$this
->
push
->
push_message_for_all
(
$title
,
$content
,
$url
);
return
;
}
...
...
application/app/controller/Index.php
View file @
15be56a5
...
...
@@ -5,7 +5,6 @@ namespace app\app\controller;
use
app\model\AppVersion
;
use
app\model\HouseImgs
;
use
app\model\HouseInfos
;
use
think\Controller
;
use
think\Response
;
class
Index
...
...
@@ -66,6 +65,11 @@ class Index
{
return
view
(
'index/more_chengjiao'
);
}
public
function
feed
()
{
return
view
(
'index/feed'
);
}
...
...
application/app/view/index/feed.html
0 → 100644
View file @
15be56a5
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
Title
</title>
</head>
<body>
喜报feed
</body>
</html>
\ No newline at end of file
application/model/PushFeed.php
0 → 100644
View file @
15be56a5
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/5/7
* Time: 17:54
*/
namespace
app\model
;
class
PushFeed
extends
BaseModel
{
}
\ No newline at end of file
application/model/PushHistory.php
0 → 100644
View file @
15be56a5
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/5/7
* Time: 17:54
*/
namespace
app\model
;
class
PushHistory
extends
BaseModel
{
}
\ No newline at end of file
application/route.php
View file @
15be56a5
...
...
@@ -24,6 +24,7 @@ Route::group('app', [
'download'
=>
[
'app/index/download'
,
[
'method'
=>
'get'
]
],
'getShopDetails'
=>
[
'app/index/getShopDetail'
,
[
'method'
=>
'get | post'
]
],
'getVersionNo'
=>
[
'app/index/getVersionNo'
,
[
'method'
=>
'get | post'
]
],
'feed'
=>
[
'app/index/feed'
,
[
'method'
=>
'get'
]
]
]);
Route
::
group
(
'app_broker'
,[
...
...
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