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
6fb23477
Commit
6fb23477
authored
Sep 10, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
运营数据
parent
ceaf1558
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
186 additions
and
1 deletion
+186
-1
OperationData.php
application/index/controller/OperationData.php
+153
-0
GHouses.php
application/model/GHouses.php
+12
-0
Users.php
application/model/Users.php
+12
-0
route.php
application/route.php
+9
-1
No files found.
application/index/controller/OperationData.php
0 → 100644
View file @
6fb23477
<?php
namespace
app\index\controller
;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2018/9/10
* Time: 15:40:20
*/
use
app\index\extend\Basic
;
use
app\model\GHouses
;
use
app\model\Users
;
class
OperationData
extends
Basic
{
private
$gHousesModel
;
private
$userModel
;
public
function
__construct
(
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
gHousesModel
=
new
GHouses
();
$this
->
userModel
=
new
Users
();
}
/**
* 发起微聊用户数
* @return \think\Response
*/
public
function
chatUserNum
(){
$params
=
$this
->
params
;
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$where
[
'create_time'
]
=
[
'between'
,
[
$params
[
'create_time_start'
]
.
' 00:00:00'
,
$params
[
'create_time_end'
]
.
' 23:59:59'
]];
//todo 发起微聊用户数
// $result["chat_user_num"] = ;
return
$this
->
response
(
200
,
'success'
,
$result
);
}
/**
* 客户来电数
* @return \think\Response
*/
public
function
userPhoneNum
(){
$params
=
$this
->
params
;
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$where
[
'create_time'
]
=
[
'between'
,
[
$params
[
'create_time_start'
]
.
' 00:00:00'
,
$params
[
'create_time_end'
]
.
' 23:59:59'
]];
//todo 发起微聊用户数
// $result["chat_user_num"] = ;
return
$this
->
response
(
200
,
'success'
,
$result
);
}
/**
* 新增-注册-登录用户数
* @return \think\Response
*/
public
function
loginNum
(){
$params
=
$this
->
params
;
$between
=
[
'between'
,
[
$params
[
'create_time_start'
]
.
' 00:00:00'
,
$params
[
'create_time_end'
]
.
' 23:59:59'
]];
$where
[
'create_time'
]
=
$between
;
// 新增客户数
$addUserNum
=
$this
->
userModel
->
getAddUserNumForOperation
(
$where
);
$result
[
"add_user_num"
]
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
// 注册客户数
$where
=
[];
$where
[
'create_time'
]
=
$between
;
$where
[
'registration_time'
]
=
array
(
'exp'
,
'is not null'
);
$addUserNum
=
$this
->
userModel
->
getAddUserNumForOperation
(
$where
);
$result
[
"create_user_num"
]
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
// 登录客户数
$where
=
[];
$where
[
'create_time'
]
=
$between
;
$where
[
'last_login_time'
]
=
array
(
'exp'
,
'is not null'
);
$addUserNum
=
$this
->
userModel
->
getAddUserNumForOperation
(
$where
);
$result
[
"login_user_num"
]
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
return
$this
->
response
(
200
,
'success'
,
$result
);
}
/**
* 商铺总量-待租数
* @return \think\Response
*/
public
function
houseNum
(){
$params
=
$this
->
params
;
if
(
!
empty
(
$params
[
'create_time_start'
])
&&
!
empty
(
$params
[
'create_time_end'
]))
{
$where
[
'create_time'
]
=
[
'between'
,
[
$params
[
'create_time_start'
]
.
' 00:00:00'
,
$params
[
'create_time_end'
]
.
' 23:59:59'
]];
}
// 商铺总量
$house_res
=
$this
->
gHousesModel
->
getHouseNum
(
$where
);
$result
[
"house_num"
]
=
$house_res
;
// 待租商铺数量
$where
[
'residue_num'
]
=
array
(
'neq'
,
0
);
$where
[
'total'
]
=
array
(
'neq'
,
0
);
$house_res
=
$this
->
gHousesModel
->
getHouseNum
(
$where
);
$result
[
"have_not_rent_num"
]
=
$house_res
;
return
$this
->
response
(
200
,
'success'
,
$result
);
}
/**
* 各部门商场街铺进场数-商场街铺成交数
* @return \think\Response
*/
public
function
houseBargainNum
(){
$params
=
$this
->
params
;
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$where
[
'create_time'
]
=
[
'between'
,
[
$params
[
'create_time_start'
]
.
' 00:00:00'
,
$params
[
'create_time_end'
]
.
' 23:59:59'
]];
//todo 先查新所有部门
//todo 商场进场数
// $result["chat_user_num"] = ;
//todo 街铺进场数
// $result["chat_user_num"] = ;
//todo 商场成交数
//todo 街铺成交数
// $result["chat_user_num"] = ;
return
$this
->
response
(
200
,
'success'
,
$result
);
}
}
\ No newline at end of file
application/model/GHouses.php
View file @
6fb23477
...
@@ -1558,4 +1558,16 @@ class GHouses extends BaseModel
...
@@ -1558,4 +1558,16 @@ class GHouses extends BaseModel
}
}
public
function
getHouseNum
(
$params
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$params
)
->
count
();
return
$result
;
}
}
}
application/model/Users.php
View file @
6fb23477
...
@@ -884,5 +884,17 @@ class Users extends Model
...
@@ -884,5 +884,17 @@ class Users extends Model
return
$result
;
return
$result
;
}
}
public
function
getAddUserNumForOperation
(
$params
)
{
$field
=
"count(1) as num"
;
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$params
)
->
select
();
//dump($this->getLastSql());
return
$result
;
}
}
}
application/route.php
View file @
6fb23477
...
@@ -319,7 +319,15 @@ Route::group('index', [
...
@@ -319,7 +319,15 @@ Route::group('index', [
'getImageDepotById'
=>
[
'index/ImageDepot/getImageDepotById'
,
[
'method'
=>
'get | post'
]
],
//根据ID获取记录
'getImageDepotById'
=>
[
'index/ImageDepot/getImageDepotById'
,
[
'method'
=>
'get | post'
]
],
//根据ID获取记录
'delImageDepot'
=>
[
'index/ImageDepot/delImageDepot'
,
[
'method'
=>
'get | post'
]
],
//删除
'delImageDepot'
=>
[
'index/ImageDepot/delImageDepot'
,
[
'method'
=>
'get | post'
]
],
//删除
'ceshi'
=>
[
'index/ImageDepot/ceshi'
,
[
'method'
=>
'get | post'
]
],
//
'ceshi'
=>
[
'index/ImageDepot/ceshi'
,
[
'method'
=>
'get | post'
]
],
//
//运营数相关接口
'operationChatUserNum'
=>
[
'index/OperationData/chatUserNum'
,
[
'method'
=>
'get | post'
]
],
//
'operationUserPhoneNum'
=>
[
'index/OperationData/userPhoneNum'
,
[
'method'
=>
'get | post'
]
],
//
'operationLoginNum'
=>
[
'index/OperationData/loginNum'
,
[
'method'
=>
'get | post'
]
],
//
'operationHouseNum'
=>
[
'index/OperationData/houseNum'
,
[
'method'
=>
'get | post'
]
],
//
'operationHouseBargainNum'
=>
[
'index/OperationData/houseBargainNum'
,
[
'method'
=>
'get | post'
]
],
//
]);
]);
...
...
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