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
368fec2c
Commit
368fec2c
authored
Oct 09, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户邀请数
parent
e05e7d1e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
0 deletions
+53
-0
OperationData.php
application/index/controller/OperationData.php
+38
-0
Users.php
application/model/Users.php
+13
-0
route.php
application/route.php
+2
-0
No files found.
application/index/controller/OperationData.php
View file @
368fec2c
...
...
@@ -306,4 +306,41 @@ class OperationData extends Basic
}
/**
* 客户邀请数
* @return \think\Response
*/
public
function
userInviteNum
()
{
$params
=
$this
->
params
;
$between
=
[
'between'
,
[
$params
[
'create_time_start'
]
.
' 00:00:00'
,
$params
[
'create_time_end'
]
.
' 23:59:59'
]
];
$where
[
'create_time'
]
=
$between
;
$where
[
'referrer_id'
]
=
array
(
'gt'
,
0
);
$where
[
'referrer_source'
]
=
array
(
'gt'
,
0
);
$field
=
'count(1) as num,create_time'
;
//select SUM(total) AS total FROM `order` GROUP BY DAY(trade_time)
switch
(
$params
[
'type'
])
{
case
0
://
日
$group
=
'DAY(create_time)'
;
break
;
case
1
://
周
$group
=
'WEEK(create_time)'
;
break
;
case
2
://
月
$group
=
'MONTH(create_time)'
;
break
;
default
:
$group
=
'DAY(create_time)'
;
}
$order
=
'create_time DESC'
;
// 新增客户数
$addUserNum
=
$this
->
userModel
->
userInviteNum
(
$field
,
$where
,
$group
,
$order
);
// dump($addUserNum);
return
$this
->
response
(
200
,
'success'
,
$addUserNum
);
}
}
\ No newline at end of file
application/model/Users.php
View file @
368fec2c
...
...
@@ -1260,5 +1260,18 @@ class Users extends Model
return
$result
;
}
public
function
userInviteNum
(
$field
,
$params
,
$group
,
$order
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$params
)
->
group
(
$group
)
->
order
(
$order
)
->
select
();
// dump($this->getLastSql());
return
$result
;
}
}
application/route.php
View file @
368fec2c
...
...
@@ -447,6 +447,8 @@ Route::group('index', [
'operationHouseNum'
=>
[
'index/OperationData/houseNum'
,
[
'method'
=>
'get | post'
]],
'operationHouseBargainNum'
=>
[
'index/OperationData/houseBargainNum'
,
[
'method'
=>
'get | post'
]],
'getFirstLoginTotal'
=>
[
'index/InviteTotal/getFirstLoginTotal'
,
[
'method'
=>
'get | post'
]],
'userInviteNum'
=>
[
'index/OperationData/userInviteNum'
,
[
'method'
=>
'get | post'
]],
//后台业绩日报,周报
'getPerformanceReportList'
=>
[
'index/PerformanceReport/getPerformanceReportList'
,
[
'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