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
49d699cf
Commit
49d699cf
authored
Sep 11, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
系统消息
parent
bc01c200
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
102 additions
and
12 deletions
+102
-12
AppChat.php
application/chat/controller/AppChat.php
+76
-12
InviteTotal.php
application/index/controller/InviteTotal.php
+15
-0
MPushMessage.php
application/model/MPushMessage.php
+11
-0
route.php
application/route.php
+0
-0
No files found.
application/chat/controller/AppChat.php
View file @
49d699cf
...
...
@@ -22,6 +22,7 @@ use app\model\GHousesImgs;
use
app\model\HouseImgs
;
use
app\model\HouseinfoExts
;
use
app\model\HouseInfos
;
use
app\model\MPushMessage
;
use
app\model\Users
;
use
think\Cache
;
use
think\Exception
;
...
...
@@ -361,7 +362,6 @@ class AppChat extends Basic
}
/**
* 获取聊天关系
* @return \think\Response
...
...
@@ -409,9 +409,9 @@ class AppChat extends Basic
public
function
getUserInfoByFrom
()
{
$params
=
$this
->
params
;
/*$params = array(
'id' => 1,
);*/
/*$params = array(
'id' => 1,
);*/
if
(
!
isset
(
$params
[
'id'
]))
{
return
$this
->
response
(
"300"
,
"参数不全"
);
}
...
...
@@ -422,16 +422,16 @@ class AppChat extends Basic
//3.ID
//4.手机号隐藏中间4位
$user
=
new
Users
();
$field
=
'a.id,a.user_name,a.user_nick,a.user_phone,a.user_pic,a.other_pic'
;
$user
=
new
Users
();
$field
=
'a.id,a.user_name,a.user_nick,a.user_phone,a.user_pic,a.other_pic'
;
$params_
[
"a.id"
]
=
$params
[
'id'
];
$result
=
$user
->
getAgentByUserId
(
$field
,
$params_
);
$result
=
$user
->
getAgentByUserId
(
$field
,
$params_
);
if
(
count
(
$result
)
>
0
)
{
$result_
[
"id"
]
=
$result
[
0
][
"id"
];
$result_
[
"agent_id"
]
=
'agent_'
.
$result
[
0
][
"id"
];
$result_
[
"user_name"
]
=
$result
[
0
][
"user_name"
];
$result_
[
"user_nick"
]
=
$result
[
0
][
"user_nick"
];
$result_
[
"user_pic"
]
=
!
empty
(
$result
[
0
][
"user_pic"
])
?
HEADERIMGURL
.
$result
[
0
][
"user_pic"
]
:
$result
[
0
][
"other_pic"
];
$result_
[
"id"
]
=
$result
[
0
][
"id"
];
$result_
[
"agent_id"
]
=
'agent_'
.
$result
[
0
][
"id"
];
$result_
[
"user_name"
]
=
$result
[
0
][
"user_name"
];
$result_
[
"user_nick"
]
=
$result
[
0
][
"user_nick"
];
$result_
[
"user_pic"
]
=
!
empty
(
$result
[
0
][
"user_pic"
])
?
HEADERIMGURL
.
$result
[
0
][
"user_pic"
]
:
$result
[
0
][
"other_pic"
];
$result_
[
"user_phone"
]
=
$result
[
0
][
"user_phone"
];
return
$this
->
response
(
"200"
,
"success!"
,
$result_
);
...
...
@@ -441,5 +441,69 @@ class AppChat extends Basic
}
/**系统消息商铺修改消息
* @return \think\Response
*/
public
function
getSystemMessageByShop
()
{
$params
=
$this
->
params
;
/* $params = array(
"agent_id" => 5740,
'page_no' => '1', //第几页
'page_size' => '15' //每页多少条
);*/
if
(
!
isset
(
$params
[
'agent_id'
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$page_no
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$page_size
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
$field
=
"id,addressee_id,type,message,house_id,create_time"
;
//获取此经纪人的所有盘方楼盘id
$params
[
"addressee_id"
]
=
$params
[
"agent_id"
];
$params
[
"type"
]
=
array
(
"in"
,
array
(
"1,3"
)
);
$msgModel
=
new
MPushMessage
();
$history_result
=
$msgModel
->
getListByWhere
(
$field
,
$params
,
$page_no
,
$page_size
);
return
$this
->
response
(
"200"
,
"request success"
,
array_reverse
(
$history_result
));
}
/**
* 系统消息客户修改消息
* @return \think\Response
*/
public
function
getSystemMessageByUser
()
{
$params
=
$this
->
params
;
/* $params = array(
"agent_id" => 5740,
'page_no' => '1', //第几页
'page_size' => '15' //每页多少条
);*/
if
(
!
isset
(
$params
[
'agent_id'
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$page_no
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$page_size
=
empty
(
$params
[
'page_size'
])
?
15
:
$params
[
'page_size'
];
$field
=
"id,addressee_id,type,message,user_id,create_time"
;
//获取此经纪人的所有盘方楼盘id
$params
[
"addressee_id"
]
=
$params
[
"agent_id"
];
$params
[
"type"
]
=
2
;
$msgModel
=
new
MPushMessage
();
$history_result
=
$msgModel
->
getListByWhere
(
$field
,
$params
,
$page_no
,
$page_size
);
return
$this
->
response
(
"200"
,
"request success"
,
array_reverse
(
$history_result
));
}
}
application/index/controller/InviteTotal.php
0 → 100644
View file @
49d699cf
<?php
namespace
app\index\controller
;
use
app\index\extend\Basic
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/9/11
* Time : 16:37
* Intro:
*/
class
InviteTotal
extends
Basic
{
}
\ No newline at end of file
application/model/MPushMessage.php
View file @
49d699cf
...
...
@@ -211,4 +211,14 @@ class MPushMessage
}
return
$result
;
}
public
function
getListByWhere
(
string
$field
,
array
$params
,
int
$page_no
=
1
,
int
$page_size
=
15
)
:
array
{
$this
->
db_
->
field
(
$field
)
->
where
(
$params
)
->
page
(
$page_no
)
->
limit
(
$page_size
)
->
select
();
}
}
\ No newline at end of file
application/route.php
View file @
49d699cf
This diff is collapsed.
Click to expand it.
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