Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
TimeOutAdmin
Project
Overview
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
TimeOut
TimeOutAdmin
Commits
079a4f62
Commit
079a4f62
authored
Dec 05, 2019
by
Tobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
t : sync contact changes
parent
c8f820d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
Webservice_model.php
application/models/Webservice_model.php
+18
-9
No files found.
application/models/Webservice_model.php
View file @
079a4f62
...
...
@@ -1909,18 +1909,27 @@ class Webservice_model extends CI_Model {
}
}
if
(
empty
(
$user_ids
)
||
empty
(
$user_ids
=
implode
(
','
,
$user_ids
))
){
if
(
empty
(
$user_ids
)){
return
array
(
'status'
=>
0
,
'code'
=>
'920'
,
'message'
=>
'No User Found'
);
}
$result
=
$this
->
db
->
query
(
"SELECT CUST.customer_id,CUST.name,CUST.phone,CUST.profile_image,
CUST.profile_image_qr,CHT.type AS friend_status
FROM customer AS CUST
LEFT JOIN chats AS CHT ON ((CUST.customer_id=CHT.from_user OR CUST.customer_id=CHT.to_user) AND CHT.type IN (0,1))
WHERE CUST.customer_id IN (
$user_ids
)
GROUP BY CUST.customer_id"
);
$respArr
[
'status'
]
=
1
;
$respArr
[
'data'
]
=
(
!
empty
(
$result
)
&&
!
empty
(
$result
=
$result
->
result_array
()))
?
$result
:
[];
$chatUsers
=
array
();
foreach
(
$user_ids
AS
$user
)
{
$sql
=
"SELECT CUST.customer_id,CUST.name,CUST.phone,CUST.profile_image,
CUST.profile_image_qr,CHT.type AS friend_status
FROM customer AS CUST
LEFT JOIN chats AS CHT ON (
((CHT.from_user=
$user
AND to_user=
$user_id
) OR
(CHT.to_user=
$user
AND from_user=
$user_id
)) AND
CHT.type IN (0,1))
WHERE CUST.customer_id IN (
$user
)
GROUP BY CUST.customer_id"
;
$result
=
$this
->
db
->
query
(
$sql
)
->
row_array
();
if
(
!
empty
(
$result
)){
$chatUsers
[]
=
$result
;
}
}
$respArr
=
array
(
'status'
=>
1
,
'data'
=>
$chatUsers
);
return
$respArr
;
}
...
...
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