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
722e8d42
Commit
722e8d42
authored
Sep 11, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发起微聊用户数
parent
f15d008e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
11 deletions
+26
-11
OperationData.php
application/index/controller/OperationData.php
+7
-6
ChatRelation.php
application/model/ChatRelation.php
+19
-5
No files found.
application/index/controller/OperationData.php
View file @
722e8d42
...
...
@@ -39,15 +39,16 @@ class OperationData extends Basic
public
function
chatUserNum
(){
$params
=
$this
->
params
;
$where
[
'create_time'
]
=
[
'between'
,
[
$params
[
'create_time_start'
]
.
' 00:00:00'
,
$params
[
'create_time_end'
]
.
' 23:59:59'
]];
//todo 发起微聊用户数
// 发起微聊用户数
$chatRelationModel
=
new
ChatRelation
();
$where
[
'from_id'
]
=
[
'LIKE'
,
'%user_%'
];
$relationResult
=
$chatRelationModel
->
getChatUserNumOperation
(
$where
);
$result
[
"chat_user_num"
]
=
0
;
$group
=
''
;
$res
=
$chatRelationModel
->
getChatUserNumOperation
(
$where
,
$group
);
$result
[
"chat_user_all_num"
]
=
$res
;
$group
=
'from_id'
;
$res
=
$chatRelationModel
->
getChatUserNumOperation
(
$where
,
$group
);
$result
[
"chat_user_num"
]
=
$res
;
return
$this
->
response
(
200
,
'success'
,
$result
);
}
/**
...
...
application/model/ChatRelation.php
View file @
722e8d42
...
...
@@ -119,13 +119,27 @@ class ChatRelation extends Model
}
}
public
function
getChatUserNumOperation
(
$params
)
/**
* 发起微聊用户数
* @param $params
* @param $group
* @return int|string
*/
public
function
getChatUserNumOperation
(
$params
,
$group
)
{
//dump($params);
$return
=
Db
::
table
(
$this
->
table
)
->
where
(
$params
)
->
count
();
dump
(
$this
->
getLastSql
(
$return
));
if
(
$group
){
$return
=
Db
::
table
(
$this
->
table
)
->
where
(
$params
)
->
group
(
$group
)
->
count
();
}
else
{
$return
=
Db
::
table
(
$this
->
table
)
->
where
(
$params
)
->
count
();
}
//dump($this->getLastSql($return));
return
$return
;
}
...
...
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