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
769a7aa8
Commit
769a7aa8
authored
Aug 14, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
store
parent
6cd72985
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
3 deletions
+46
-3
Store.php
application/index/controller/Store.php
+11
-3
AStore.php
application/model/AStore.php
+35
-0
No files found.
application/index/controller/Store.php
View file @
769a7aa8
...
...
@@ -40,7 +40,6 @@ class Store extends Basic
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$field
=
'a.id,a.district_id,a.store_name,a.create_time'
;
$where
[
'a.status'
]
=
0
;
$where
[
'b.level'
]
=
[
'in'
,
'20,40'
];
//门店名
if
(
!
empty
(
$this
->
params
[
'store_id'
]))
{
$where
[
'a.id'
]
=
$this
->
params
[
'store_id'
];
...
...
@@ -56,18 +55,27 @@ class Store extends Basic
//店长姓名
if
(
!
empty
(
$this
->
params
[
'agents_name'
]))
{
$is_join
=
1
;
$where
[
'b.name'
]
=
[
'LIKE'
,
'%'
.
$this
->
params
[
'agents_name'
]
.
'%'
];
}
//店长手机号
if
(
!
empty
(
$this
->
params
[
'agents_phone'
]))
{
$is_join
=
1
;
$where
[
'b.phone'
]
=
[
'LIKE'
,
$this
->
params
[
'agents_phone'
]
.
'%'
];
}
$store
=
new
AStore
();
$m_agent
=
new
AAgents
();
$m_district
=
new
ADistrict
();
$list
=
$store
->
getStoreAgentList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
);
$this
->
data
[
'total'
]
=
$store
->
getStoreAgentListTotal
(
$where
);
if
(
isset
(
$is_join
))
{
$where
[
'b.level'
]
=
[
'in'
,
'20,40'
];
$list
=
$store
->
getStoreAgentList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
);
$this
->
data
[
'total'
]
=
$store
->
getStoreAgentListTotal
(
$where
);
}
else
{
$list
=
$store
->
getListAlias
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
);
$this
->
data
[
'total'
]
=
$store
->
getTotalAlias
(
$where
);
}
$agent_where
[
'level'
]
=
20
;
$status_arr
=
[
0
=>
'正常'
,
1
=>
'长假'
,
2
=>
'离职'
,
3
=>
'转勤'
,
4
=>
'黑名单'
,
5
=>
'冻结'
];
...
...
application/model/AStore.php
View file @
769a7aa8
...
...
@@ -542,4 +542,38 @@ class AStore extends BaseModel
$result
=
Db
::
table
(
$this
->
table
)
->
query
(
$sql
);
return
$result
;
}
/**
* 公用方法,列表
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getListAlias
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
/**
* 记录总数
*
* @param $params
* @param string $field
* @return int|string
*/
public
function
getTotalAlias
(
$params
,
$field
=
'id'
)
{
return
$this
->
alias
(
'a'
)
->
where
(
$params
)
->
count
(
$field
);
}
}
\ 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