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
ea26e994
Commit
ea26e994
authored
Jul 09, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
27e1270b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
14 deletions
+59
-14
AppChat.php
application/chat/controller/AppChat.php
+12
-12
ChatService.php
application/chat/service/ChatService.php
+2
-1
ChatUser.php
application/model/ChatUser.php
+1
-1
ChatUserExt.php
application/model/ChatUserExt.php
+44
-0
No files found.
application/chat/controller/AppChat.php
View file @
ea26e994
...
...
@@ -77,16 +77,16 @@ class AppChat extends Basic
*/
public
function
userChat
()
{
/* $params = array(
"user_id" => 118,
"mobile" => "15821506182",
"source" => 1 //1经纪人 2用户
"device_id" => "ssss1231231123123",
"push_id" => "ssss1231231123123"
$params
=
$this
->
params
;
$params
=
array
(
"user_id"
=>
80
,
"mobile"
=>
"15821506182"
,
"source"
=>
1
,
//1经纪人 2用户
"device_id"
=>
"ssss1231231123123"
,
"push_id"
=>
"ssss1231231123123"
);*/
);
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
'user_id'
])
||
!
isset
(
$params
[
'mobile'
])
||
!
isset
(
$params
[
'source'
])
||
!
isset
(
$params
[
'push_id'
]))
{
return
$this
->
response
(
ErrorCodeConst
::
ERROR_CODE_PARAM_NOT_EXIST
,
"请求参数错误"
);
...
...
@@ -321,10 +321,10 @@ class AppChat extends Basic
public
function
getChatRelation
()
{
$params
=
$this
->
params
;
/* $params = array(
"target" => "121"
);*/
if
(
!
isset
(
$params
[
'target'
])
)
{
/* $params = array(
"target" => "121"
);*/
if
(
!
isset
(
$params
[
'target'
]))
{
return
$this
->
response
(
"300"
,
"参数不全"
);
}
$target
=
$params
[
"target"
];
...
...
application/chat/service/ChatService.php
View file @
ea26e994
...
...
@@ -83,6 +83,7 @@ class ChatService
return
[
"code"
=>
"101"
,
"msg"
=>
"没有找到用户信息"
];
}
else
{
$id
=
$this
->
insertChatUser
(
$source
,
$user_id
,
$mobile
,
$only_id
);
echo
$id
;
//todo 保存或更新push_id
if
(
$id
>
0
)
{
$this
->
savePushId
(
$id
,
$device_id
,
$push_id
);
...
...
@@ -107,7 +108,7 @@ class ChatService
$params
[
"push_id"
]
=
$push_id
;
$params
[
"is_forbidden"
]
=
0
;
$params
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$params
[
"update
d_at
"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$params
[
"update
_time
"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$this
->
chatUserExtModel
->
addChatUserExt
(
$params
);
return
true
;
}
...
...
application/model/ChatUser.php
View file @
ea26e994
...
...
@@ -35,7 +35,7 @@ class ChatUser extends Model
{
Db
::
startTrans
();
try
{
$res
=
$this
->
save
(
$params
);
$res
=
$this
->
insertGetId
(
$params
);
Db
::
commit
();
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
...
...
application/model/ChatUserExt.php
View file @
ea26e994
...
...
@@ -9,6 +9,8 @@
namespace
app\model
;
use
think\Db
;
class
ChatUserExt
extends
BaseModel
{
// 设置当前模型对应的完整数据表名称
...
...
@@ -63,4 +65,45 @@ class ChatUserExt extends BaseModel
return
$res
;
}
/**
* bin
* @param $params
* @return array
*/
private
function
wxInfoBin
(
$params
)
{
$arr
=
[];
if
(
isset
(
$params
[
"id"
]))
{
$arr
[
"id"
]
=
$params
[
"id"
];
}
else
{
$arr
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
}
if
(
isset
(
$params
[
"wx_open_id"
]))
{
$arr
[
"wx_open_id"
]
=
$params
[
"wx_open_id"
];
}
if
(
isset
(
$params
[
"wx_union_id"
]))
{
$arr
[
"wx_union_id"
]
=
$params
[
"wx_union_id"
];
}
if
(
isset
(
$params
[
"buyer_nick"
]))
{
$arr
[
"buyer_nick"
]
=
$params
[
"buyer_nick"
];
}
if
(
isset
(
$params
[
"buyer_img"
]))
{
$arr
[
"buyer_img"
]
=
$params
[
"buyer_img"
];
}
if
(
isset
(
$params
[
"sex"
]))
{
$arr
[
"sex"
]
=
$params
[
"sex"
];
}
if
(
isset
(
$params
[
"province"
]))
{
$arr
[
"province"
]
=
$params
[
"province"
];
}
if
(
isset
(
$params
[
"city"
]))
{
$arr
[
"city"
]
=
$params
[
"city"
];
}
if
(
isset
(
$params
[
"source"
]))
{
$arr
[
"source"
]
=
$params
[
"source"
];
}
$arr
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
return
$arr
;
}
}
\ 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