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
8397e40c
Commit
8397e40c
authored
Apr 16, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收款记录
parent
2d86a76d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
166 additions
and
0 deletions
+166
-0
Collection.php
application/index/controller/Collection.php
+87
-0
getCollection.html
application/index/view/collection/getCollection.html
+3
-0
OPayLogModel.php
application/model/OPayLogModel.php
+75
-0
route.php
application/route.php
+1
-0
No files found.
application/index/controller/Collection.php
0 → 100644
View file @
8397e40c
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/4/16
* Time: 10:02
*/
namespace
app\index\controller
;
use
app\index\extend\Basic
;
use
app\model\OPayLogModel
;
class
Collection
extends
Basic
{
/**
* 收款记录
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getCollection
()
{
if
(
$this
->
request
->
isGet
())
{
$order
=
new
OPayLogModel
();
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$where
=
[];
if
(
!
empty
(
$this
->
params
[
'start_time'
])
&&
empty
(
$this
->
params
[
'end_time'
]))
{
$where
[
'a.create_time'
]
=
[
'> time'
,
$this
->
params
[
'start_time'
]];
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
empty
(
$this
->
params
[
'start_time'
]))
{
$where
[
'a.create_time'
]
=
[
'< time'
,
$this
->
params
[
'start_time'
]];
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
!
empty
(
$this
->
params
[
'start_time'
]))
{
$where
[
'a.create_time'
]
=
[
'between time'
,
[
$this
->
params
[
'end_time'
],
$this
->
params
[
'start_time'
]
]];
}
if
(
!
empty
(
$this
->
params
[
'internal_title'
]))
{
$where
[
'd.internal_title'
]
=
[
'like'
,
'%'
.
$where
[
'internal_title'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'user_name'
]))
{
$where
[
'c.user_name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'user_name'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'user_phone'
]))
{
$where
[
'c.user_phone'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'user_phone'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'id'
]))
{
$where
[
'd.id'
]
=
$this
->
params
[
'id'
];
}
if
(
!
empty
(
$this
->
params
[
'store_name'
]))
{
$where
[
'f.store_name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'store_name'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'report_phone'
]))
{
$where
[
'e.phone'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'report_phone'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'report_name'
]))
{
$where
[
'e.name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'report_name'
]
.
'%'
];
}
$field
=
'a.id,a.create_time,c.user_name,c.user_phone,a.money,a.pay_type,a.type,d.internal_title,d.internal_address'
;
$data
[
'data'
][
'list'
]
=
$order
->
getAddPayLogOrderListLmit
(
$pageNo
,
$pageSize
,
$order_
=
'a.id desc'
,
$field
,
$where
);
$data
[
'data'
][
'total'
]
=
$order
->
getAddPayLogOrderListLmitTotal
(
$where
);
return
$this
->
response
(
$data
[
'status'
],
$data
[
'msg'
],
$data
[
'data'
]);
}
elseif
(
$this
->
request
->
isAjax
())
{
return
view
(
'getCollection'
);
}
}
}
\ No newline at end of file
application/index/view/collection/getCollection.html
0 → 100644
View file @
8397e40c
{layout name="global/frame_tpl" /}
收款记录
\ No newline at end of file
application/model/OPayLogModel.php
View file @
8397e40c
...
...
@@ -173,4 +173,78 @@ class OPayLogModel extends Model
->
where
(
$where_
)
->
select
();
}
/**
* 收款记录
*
* @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
getAddPayLogOrderListLmit
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
){
if
(
isset
(
$params
[
'e.name'
])
||
isset
(
$params
[
'f.store_name'
])
||
isset
(
$params
[
'e.phone'
]))
{
$data
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
join
(
"o_report c"
,
"b.f_id = c.id"
,
"left"
)
->
join
(
'g_houses d'
,
'b.house_id = d.id'
,
'left'
)
->
join
(
'a_agents e'
,
'a.agent_id=e.id'
,
'left'
)
->
join
(
'a_store f'
,
'e.store_id=f.id'
,
'left'
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
order
(
$order_
)
->
where
(
$params
)
->
select
();
}
else
{
$data
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
join
(
"o_report c"
,
"b.f_id = c.id"
,
"left"
)
->
join
(
'g_houses d'
,
'b.house_id = d.id'
,
'left'
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
order
(
$order_
)
->
where
(
$params
)
->
select
();
}
return
$data
;
}
/**
* 收款记录总数
*
* @param string $params
* @return int|string
*/
public
function
getAddPayLogOrderListLmitTotal
(
$params
=
''
){
if
(
isset
(
$params
[
'e.name'
])
||
isset
(
$params
[
'f.store_name'
])
||
isset
(
$params
[
'e.phone'
]))
{
$data
=
Db
::
table
(
$this
->
table
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
join
(
"o_report c"
,
"b.f_id = c.id"
,
"left"
)
->
join
(
'g_houses d'
,
'b.house_id = d.id'
,
'left'
)
->
join
(
'a_agents e'
,
'a.agent_id=e.id'
,
'left'
)
->
join
(
'a_store f'
,
'e.store_id=f.id'
,
'left'
)
->
where
(
$params
)
->
count
();
}
else
{
$data
=
Db
::
table
(
$this
->
table
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
join
(
"o_report c"
,
"b.f_id = c.id"
,
"left"
)
->
join
(
'g_houses d'
,
'b.house_id = d.id'
,
'left'
)
->
where
(
$params
)
->
count
();
}
return
$data
;
}
}
\ No newline at end of file
application/route.php
View file @
8397e40c
...
...
@@ -208,6 +208,7 @@ Route::group('index', [
'test123'
=>
[
'index/WatchShop/test123'
,
[
'method'
=>
'get|post'
]
],
//时间轴
'agent_zhuan_aagent'
=>
[
'index/agent/agent_zhuan_aagent'
,
[
'method'
=>
'post|get'
]
],
//经纪人
'shop_a_store'
=>
[
'index/agent/shop_a_store'
,
[
'method'
=>
'post|get'
]
],
//经纪人
'getCollection'
=>
[
'index/Collection/getCollection'
,
[
'method'
=>
'post|get'
]
],
//收款记录
]);
...
...
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