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
3019bbe8
Commit
3019bbe8
authored
Jun 05, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收款列表和导出
parent
a26051ff
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
203 additions
and
6 deletions
+203
-6
OfficePayLog.php
application/index/controller/OfficePayLog.php
+0
-0
OfficeOPayLogAdjustment.php
application/model/OfficeOPayLogAdjustment.php
+192
-0
OfficeOPayLogModel.php
application/model/OfficeOPayLogModel.php
+8
-6
route.php
application/route.php
+3
-0
No files found.
application/index/controller/OfficePayLog.php
0 → 100644
View file @
3019bbe8
This diff is collapsed.
Click to expand it.
application/model/OfficeOPayLogAdjustment.php
0 → 100644
View file @
3019bbe8
<?php
namespace
app\model
;
use
think\Db
;
use
think\Model
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/12/13
* Time : 4:29 PM
* Intro:
*/
class
OfficeOPayLogAdjustment
extends
BaseModel
{
protected
$table
=
"office_o_paylog_adjustment"
;
private
$db_
;
public
function
__construct
()
{
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
/**
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAdjustmentList
(
$field
,
$params
){
return
$this
->
db_
->
field
(
$field
)
->
where
(
$params
)
->
select
();
}
/**
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAdjustmentListByOrderId
(
$field
,
$params
){
$where_
=
[];
if
(
isset
(
$params
[
"order_id"
])){
$where_
[
"b.order_id"
]
=
$params
[
"order_id"
];
}
if
(
isset
(
$params
[
"is_del"
])){
$where_
[
"a.is_del"
]
=
$params
[
"is_del"
];
}
return
$this
->
db_
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_paylog b"
,
"a.paylog_id=b.id"
)
->
join
(
"o_paylog d"
,
"a.new_paylog_id=d.id"
)
->
join
(
"a_agents c"
,
"a.operation_id=c.id"
)
->
where
(
$where_
)
->
select
();
}
public
function
getAdjustmentSum
(
$field
,
$params
)
{
$data
=
$this
->
db_
->
where
(
$params
)
->
sum
(
$field
);
//echo $this->getLastSql();
return
$data
;
}
/**
* @param $field
* @param $params
* @return int|mixed
*/
public
function
getFieldValue
(
$field
,
$params
)
{
return
$this
->
db_
->
where
(
$params
)
->
value
(
$field
);
}
/**
* @param $field
* @param $params
* @return int|mixed
*/
public
function
getFieldColumn
(
$field
,
$params
)
{
return
$this
->
db_
->
where
(
$params
)
->
column
(
$field
);
}
public
function
addAdjustment
(
$params
){
Db
::
startTrans
();
try
{
$res
=
$this
->
insertGetId
(
$params
);
Db
::
commit
();
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
$res
=
0
;
}
return
$res
;
}
/**
* @param $pageNo
* @param $pageSize
* @param string $order_
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAdjustmentListLimit
(
$pageNo
,
$pageSize
,
$order_
=
'a.id desc'
,
$field
,
$params
){
return
$this
->
db_
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_paylog b"
,
"a.paylog_id = b.id"
,
"left"
)
->
join
(
"a_agents d"
,
"a.operation_id = d.id"
,
"left"
)
->
join
(
"o_order e"
,
"b.order_id = e.id"
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
order
(
$order_
)
->
where
(
$params
)
->
select
();
}
/**
* @param $params
* @return int|string
*/
public
function
getAdjustmentListTotal
(
$params
)
{
return
$this
->
db_
->
alias
(
'a'
)
->
join
(
"o_paylog b"
,
"a.paylog_id = b.id"
,
"left"
)
->
join
(
"a_agents d"
,
"a.operation_id = d.id"
,
"left"
)
->
join
(
"o_order e"
,
"b.order_id = e.id"
)
->
where
(
$params
)
->
count
(
'a.id'
);
}
/**
* 调整计算
*
* @param $params
* @return float|int
*/
public
function
getMoneyTotal
(
$params
)
{
return
$this
->
db_
->
alias
(
'a'
)
->
join
(
"o_paylog b"
,
"a.paylog_id = b.id"
,
"left"
)
->
join
(
"a_agents d"
,
"a.operation_id = d.id"
,
"left"
)
->
join
(
"o_order e"
,
"b.order_id = e.id"
)
->
where
(
$params
)
->
sum
(
'a.money'
);
}
/**
* @param $params
* @return int|string
*/
public
function
updatePayLogAdjustment
(
$params
)
{
$id
=
$params
[
"id"
];
unset
(
$params
[
"id"
]);
Db
::
startTrans
();
try
{
$id
=
$this
->
db_
->
where
([
"id"
=>
[
'in'
,
$id
]
])
->
update
(
$params
);
Db
::
commit
();
return
$id
;
}
catch
(
\Exception
$e
)
{
echo
$this
->
getLastSql
();
dump
(
"error:"
.
$e
);
Db
::
rollback
();
return
0
;
}
}
/**
* @param $field
* @param $where
* @return float|int
*/
public
function
sumMoney
(
$field
,
$where
)
{
return
$this
->
db_
->
alias
(
'a'
)
->
join
(
'o_paylog b'
,
'a.new_paylog_id=b.id'
,
'left'
)
->
where
(
$where
)
->
sum
(
$field
);
}
}
\ No newline at end of file
application/model/OfficeOPayLogModel.php
View file @
3019bbe8
...
...
@@ -341,10 +341,11 @@ class OfficeOPayLogModel extends Model
$params
[
"a.is_del"
]
=
0
;
return
$this
->
db_
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
join
(
'
g_houses
d'
,
'b.house_id = d.id'
,
'left'
)
->
join
(
"o
ffice_o
_order b"
,
"a.order_id = b.id"
,
"left"
)
->
join
(
'
office_g_room
d'
,
'b.house_id = d.id'
,
'left'
)
->
join
(
'a_agents e'
,
'a.agent_id=e.id'
,
'left'
)
->
join
(
'o_bargain f'
,
'a.bargain_id=f.id'
,
'left'
)
->
join
(
'office_o_bargain f'
,
'a.bargain_id=f.id'
,
'left'
)
->
join
(
'office_g_building g'
,
'd.building_id=g.id'
,
'left'
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
order
(
$order_
)
...
...
@@ -364,10 +365,11 @@ class OfficeOPayLogModel extends Model
{
$params
[
"a.is_del"
]
=
0
;
return
$this
->
db_
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
join
(
'
g_houses
d'
,
'b.house_id = d.id'
,
'left'
)
->
join
(
"o
ffice_o
_order b"
,
"a.order_id = b.id"
,
"left"
)
->
join
(
'
office_g_room
d'
,
'b.house_id = d.id'
,
'left'
)
->
join
(
'a_agents e'
,
'a.agent_id=e.id'
,
'left'
)
->
join
(
'o_bargain f'
,
'a.bargain_id=f.id'
,
'left'
)
->
join
(
'office_o_bargain f'
,
'a.bargain_id=f.id'
,
'left'
)
->
join
(
'office_g_building g'
,
'd.building_id=g.id'
,
'left'
)
->
where
(
$params
)
->
count
();
}
...
...
application/route.php
View file @
3019bbe8
...
...
@@ -1002,6 +1002,9 @@ Route::group('office_index', [
'houseAdd'
=>
[
'index/OfficeRoom/edit'
,
[
'method'
=>
'POST|GET'
]],
//楼盘字典新增和编辑
'getRecords'
=>
[
'index/OfficeRoom/getRecords'
,
[
'method'
=>
'GET'
]],
//盘方操作记录
'batchChangDish'
=>
[
'index/OfficeRoom/batchChangDish'
,
[
'method'
=>
'post'
]],
//批量修改盘方
'getCollection'
=>
[
'index/OfficePayLog/getCollection'
,
[
'method'
=>
'GET'
]],
//收款记录
'getCollectionExcel'
=>
[
'index/OfficePayLog/getCollectionExcel'
,
[
'method'
=>
'get'
]],
//导出收款记录
]);
Route
::
group
(
'office_api'
,
[
...
...
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