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
3f2880b5
Commit
3f2880b5
authored
Feb 09, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店列表分页数据
parent
9d32afdd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
Store.php
application/index/controller/Store.php
+2
-1
AStore.php
application/model/AStore.php
+26
-0
No files found.
application/index/controller/Store.php
View file @
3f2880b5
...
@@ -58,7 +58,8 @@ class Store extends Basic
...
@@ -58,7 +58,8 @@ class Store extends Basic
$join
=
1
;
$join
=
1
;
}
}
$store
=
new
AStore
();
$store
=
new
AStore
();
$this
->
data
=
$this
->
data
=
$store
->
getStoreList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
,
$join
);
$this
->
data
[
'list'
]
=
$store
->
getStoreList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
,
$join
);
$this
->
data
[
'total'
]
=
$store
->
getStoreListTotal
(
$where
,
$join
);
$return
=
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
$return
=
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
else
{
}
else
{
//总监列表
//总监列表
...
...
application/model/AStore.php
View file @
3f2880b5
...
@@ -90,6 +90,8 @@ class AStore extends BaseModel
...
@@ -90,6 +90,8 @@ class AStore extends BaseModel
}
}
/**
/**
* 门店列表
*
* @param int $pageNo
* @param int $pageNo
* @param int $pageSize
* @param int $pageSize
* @param string $order_
* @param string $order_
...
@@ -137,4 +139,27 @@ class AStore extends BaseModel
...
@@ -137,4 +139,27 @@ class AStore extends BaseModel
return
$data
;
return
$data
;
}
}
/**
* 门店列表总数
*
* @param $params
* @param int $join
* @return int|string
*/
public
function
getStoreListTotal
(
$params
,
$join
=
0
)
{
if
(
$join
)
{
$where
[
'b.status'
]
=
0
;
$where
[
'b.level'
]
=
[
'in'
,[
20
,
40
]];
$store_num
=
$this
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.id=b.store_id'
,
'left'
)
->
where
(
$params
)
->
count
();
}
else
{
$store_num
=
$this
->
alias
(
'a'
)
->
where
(
$params
)
->
count
();
}
return
$store_num
;
}
}
}
\ No newline at end of file
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