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
ddfd0261
Commit
ddfd0261
authored
Sep 11, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
邀请注册登录人数
parent
6e075e8d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
6 deletions
+67
-6
InviteTotal.php
application/index/controller/InviteTotal.php
+32
-6
AStore.php
application/model/AStore.php
+16
-0
Users.php
application/model/Users.php
+13
-0
route.php
application/route.php
+6
-0
No files found.
application/index/controller/InviteTotal.php
View file @
ddfd0261
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
namespace
app\index\controller
;
namespace
app\index\controller
;
use
app\index\extend\Basic
;
use
app\index\extend\Basic
;
use
app\model\AStore
;
use
app\model\Users
;
use
app\model\Users
;
/**
/**
...
@@ -17,25 +18,49 @@ class InviteTotal extends Basic
...
@@ -17,25 +18,49 @@ class InviteTotal extends Basic
public
function
getFirstLoginTotal
()
public
function
getFirstLoginTotal
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
$params
=
array
(
/*
$params = array(
"district_id"
=>
1
,
"district_id" =>
5
,
"store_id"
=>
1
,
//
"store_id" => 1,
"start_time"
=>
""
,
"start_time" => "
2018-03-01
",
"end_time"
=>
""
,
"end_time" => "
2018-10-01
",
"page_no" => 1,
"page_no" => 1,
"page_size" => 30
"page_size" => 30
);
);
*/
if
(
empty
(
$params
[
"district_id"
]))
{
if
(
empty
(
$params
[
"district_id"
]))
{
return
$this
->
response
(
"101"
,
"请选择部门或门店"
);
return
$this
->
response
(
"101"
,
"请选择部门或门店"
);
}
else
{
$param
[
"b.district_id"
]
=
$params
[
"district_id"
];
}
if
(
!
empty
(
$params
[
"store_id"
]))
{
$param
[
"b.store_id"
]
=
$params
[
"store_id"
];
}
}
if
(
empty
(
$params
[
"start_time"
])
||
empty
(
$params
[
"end_time"
]))
{
if
(
empty
(
$params
[
"start_time"
])
||
empty
(
$params
[
"end_time"
]))
{
return
$this
->
response
(
"101"
,
"请选择时间"
);
return
$this
->
response
(
"101"
,
"请选择时间"
);
}
else
{
$param
[
"a.create_time"
]
=
array
(
"between"
,
array
(
$params
[
"start_time"
],
$params
[
"end_time"
]
)
);
}
}
$page_no
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$page_no
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$page_size
=
empty
(
$params
[
'page_size'
])
?
30
:
$params
[
'page_size'
];
$page_size
=
empty
(
$params
[
'page_size'
])
?
30
:
$params
[
'page_size'
];
$field
=
'count(a.id) num ,b.id,b.name,b.store_id,b.district_id'
;
$param
[
"a.referrer_source"
]
=
20
;
$userModel
=
new
Users
();
$userModel
=
new
Users
();
$data_list
=
$userModel
->
getInviteTotal
(
$field
,
$param
,
$page_no
,
$page_size
);
$storeModel
=
new
AStore
();
foreach
(
$data_list
as
$key
=>
$item
)
{
$info
=
$storeModel
->
getStoreAndDistrict
(
$item
[
"store_id"
]);
$data_list
[
$key
][
"district_name"
]
=
$info
[
"district_name"
];
$data_list
[
$key
][
"store_name"
]
=
$info
[
"store_name"
];
}
return
$this
->
response
(
"200"
,
"success"
,
$data_list
);
}
}
}
}
\ No newline at end of file
application/model/AStore.php
View file @
ddfd0261
...
@@ -184,6 +184,22 @@ class AStore extends BaseModel
...
@@ -184,6 +184,22 @@ class AStore extends BaseModel
return
$name
;
return
$name
;
}
}
/**
* @param $id
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getStoreAndDistrict
(
$id
)
{
$name
=
$this
->
field
(
'b.district_name,a.store_name'
)
->
alias
(
'a'
)
->
join
(
'a_district b'
,
'a.district_id = b.id'
,
'left'
)
->
where
(
'a.id'
,
$id
)
->
find
();
return
$name
;
}
/**
/**
* 查询门店单个字段信息
* 查询门店单个字段信息
*
*
...
...
application/model/Users.php
View file @
ddfd0261
...
@@ -910,5 +910,18 @@ class Users extends Model
...
@@ -910,5 +910,18 @@ class Users extends Model
//dump($this->getLastSql());
//dump($this->getLastSql());
return
$result
;
return
$result
;
}
}
public
function
getInviteTotal
(
$field
,
$params
,
$page_no
,
$page_size
){
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"a_agents b"
,
"a.referrer_id=b.id"
,
"left"
)
->
where
(
$params
)
->
group
(
"b.id"
)
->
page
(
$page_no
)
->
limit
(
$page_size
)
->
select
();
}
}
}
application/route.php
View file @
ddfd0261
...
@@ -324,6 +324,12 @@ Route::group('index', [
...
@@ -324,6 +324,12 @@ Route::group('index', [
'operationHouseBargainNum'
=>
[
'index/OperationData/houseBargainNum'
,
[
'method'
=>
'get | post'
]
],
//
'operationHouseBargainNum'
=>
[
'index/OperationData/houseBargainNum'
,
[
'method'
=>
'get | post'
]
],
//
'getFirstLoginTotal'
=>
[
'index/InviteTotal/getFirstLoginTotal'
,
[
'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