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
9f0b3b5e
Commit
9f0b3b5e
authored
Dec 14, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
暂存
parent
06f78268
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
183 additions
and
13 deletions
+183
-13
OrderLog.php
application/api_broker/controller/OrderLog.php
+1
-1
Finance.php
application/index/controller/Finance.php
+149
-11
OPayLogAdjustment.php
application/model/OPayLogAdjustment.php
+33
-1
No files found.
application/api_broker/controller/OrderLog.php
View file @
9f0b3b5e
...
@@ -202,7 +202,7 @@ class OrderLog extends Basic
...
@@ -202,7 +202,7 @@ class OrderLog extends Basic
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"
agent_id"
])
||
!
isset
(
$params
[
"
report_id"
])
||
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"report_id"
])
||
!
isset
(
$params
[
"order_id"
])
||
!
isset
(
$params
[
"order_no"
])
|
!
isset
(
$params
[
"collecting_bill"
])
||
!
isset
(
$params
[
"order_id"
])
||
!
isset
(
$params
[
"order_no"
])
|
!
isset
(
$params
[
"collecting_bill"
])
||
!
isset
(
$params
[
"house_number"
])
||
!
isset
(
$params
[
"industry_type"
])
)
{
!
isset
(
$params
[
"house_number"
])
||
!
isset
(
$params
[
"industry_type"
])
)
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
return
$this
->
response
(
"101"
,
"请求参数错误"
);
...
...
application/index/controller/Finance.php
View file @
9f0b3b5e
...
@@ -15,6 +15,7 @@ use app\index\extend\Basic;
...
@@ -15,6 +15,7 @@ use app\index\extend\Basic;
use
app\index\untils\ExportExcelUntil
;
use
app\index\untils\ExportExcelUntil
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\AStore
;
use
app\model\AStore
;
use
app\model\GHouses
;
use
app\model\GHousesToAgents
;
use
app\model\GHousesToAgents
;
use
app\model\OBargainLogModel
;
use
app\model\OBargainLogModel
;
use
app\model\OBargainModel
;
use
app\model\OBargainModel
;
...
@@ -2446,6 +2447,10 @@ class Finance extends Basic
...
@@ -2446,6 +2447,10 @@ class Finance extends Basic
}
}
$list
[
$k
][
'current_agent_name'
]
=
empty
(
$current_agent_name
[
'reception_name'
])
?
""
:
$current_agent_name
[
'reception_name'
];
$list
[
$k
][
'current_agent_name'
]
=
empty
(
$current_agent_name
[
'reception_name'
])
?
""
:
$current_agent_name
[
'reception_name'
];
}
}
if
(
!
empty
(
$v
[
'income_time'
]))
{
$list
[
$k
][
'income_time'
]
=
date
(
'Y-m-d'
,
strtotime
(
$v
[
'income_time'
]));
}
}
}
$data
[
'list'
]
=
$list
;
$data
[
'list'
]
=
$list
;
//加时间条件
//加时间条件
...
@@ -2454,15 +2459,6 @@ class Finance extends Basic
...
@@ -2454,15 +2459,6 @@ class Finance extends Basic
}
else
{
}
else
{
$data
[
'money_total'
]
=
''
;
$data
[
'money_total'
]
=
''
;
}
}
foreach
(
$data
[
'list'
]
as
$k
=>
$v
)
{
if
(
!
empty
(
$v
[
'user_phone'
]))
{
$data
[
'list'
][
$k
][
'user_phone'
]
=
substr_replace
(
$v
[
'user_phone'
],
'****'
,
3
,
4
);
}
if
(
!
empty
(
$v
[
'income_time'
]))
{
$data
[
'list'
][
$k
][
'income_time'
]
=
date
(
'Y-m-d'
,
strtotime
(
$v
[
'income_time'
]));
}
}
$data
[
'list'
]
=
$this
->
numberTransitionString
(
$data
[
'list'
]);
$data
[
'list'
]
=
$this
->
numberTransitionString
(
$data
[
'list'
]);
}
else
{
}
else
{
$pageNo
=
1
;
$pageNo
=
1
;
...
@@ -2827,7 +2823,7 @@ class Finance extends Basic
...
@@ -2827,7 +2823,7 @@ class Finance extends Basic
*/
*/
public
function
collectingBill
()
{
public
function
collectingBill
()
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"
agent_id"
])
||
!
isset
(
$params
[
"
report_id"
])
||
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"report_id"
])
||
!
isset
(
$params
[
"order_id"
])
||
!
isset
(
$params
[
"order_no"
])
|
!
isset
(
$params
[
"collecting_bill"
])
||
!
isset
(
$params
[
"order_id"
])
||
!
isset
(
$params
[
"order_no"
])
|
!
isset
(
$params
[
"collecting_bill"
])
||
!
isset
(
$params
[
"house_number"
])
||
!
isset
(
$params
[
"industry_type"
])
)
{
!
isset
(
$params
[
"house_number"
])
||
!
isset
(
$params
[
"industry_type"
])
)
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
return
$this
->
response
(
"101"
,
"请求参数错误"
);
...
@@ -2890,8 +2886,150 @@ class Finance extends Basic
...
@@ -2890,8 +2886,150 @@ class Finance extends Basic
*/
*/
public
function
adjustment
()
{
public
function
adjustment
()
{
if
(
!
$this
->
request
->
isAjax
())
{
if
(
!
$this
->
request
->
isAjax
())
{
return
view
(
"adjustment"
);
//
return view("adjustment");
}
}
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$data
[
'data'
]
=
[];
$where
[
'a.is_del'
]
=
$is_show
=
0
;
$msg
=
''
;
// try {
$m_paylog
=
new
OPayLogAdjustment
();
/*提交时间 start*/
if
(
!
empty
(
$this
->
params
[
'start_time'
])
&&
empty
(
$this
->
params
[
'end_time'
]))
{
$where
[
'a.create_time'
]
=
[
'> time'
,
$this
->
params
[
'start_time'
]
.
' 00:00:00'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
empty
(
$this
->
params
[
'start_time'
]))
{
$where
[
'a.create_time'
]
=
[
'< time'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'end_time'
])
&&
!
empty
(
$this
->
params
[
'start_time'
]))
{
$where
[
'a.create_time'
]
=
[
'between time'
,
[
$this
->
params
[
'start_time'
]
.
' 00:00:00'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
]];
$is_show
=
1
;
}
/*提交时间 end*/
/*入账日期 start*/
if
(
!
empty
(
$this
->
params
[
'income_start_time'
])
&&
empty
(
$this
->
params
[
'income_end_time'
]))
{
$where
[
'a.income_time'
]
=
[
'> time'
,
$this
->
params
[
'income_start_time'
]
.
' 00:00:00'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'income_end_time'
])
&&
empty
(
$this
->
params
[
'income_start_time'
]))
{
$where
[
'a.income_time'
]
=
[
'< time'
,
$this
->
params
[
'end_time'
]
.
' 23:59:59'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'income_end_time'
])
&&
!
empty
(
$this
->
params
[
'income_start_time'
]))
{
$where
[
'a.income_time'
]
=
[
'between time'
,
[
$this
->
params
[
'income_start_time'
]
.
' 00:00:00'
,
$this
->
params
[
'income_end_time'
]
.
' 23:59:59'
]];
$is_show
=
1
;
}
/*入账日期 end*/
//商铺地址
if
(
!
empty
(
$this
->
params
[
'internal_address'
]))
{
$where
[
'd.internal_address'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'internal_address'
]
.
'%'
];
$is_show
=
1
;
}
//商铺ID
if
(
!
empty
(
$this
->
params
[
'house_id'
]))
{
$where
[
'b.house_id'
]
=
$this
->
params
[
'house_id'
];
$is_show
=
1
;
}
//提交人所在门店
if
(
!
empty
(
$this
->
params
[
'store_id'
]))
{
$where
[
'e.store_id'
]
=
$this
->
params
[
'store_id'
];
$is_show
=
1
;
}
//提交人所在部门
if
(
!
empty
(
$this
->
params
[
'district_id'
]))
{
$where
[
'e.district_id'
]
=
$this
->
params
[
'district_id'
];
$is_show
=
1
;
}
//提交人姓名
if
(
!
empty
(
$this
->
params
[
'agent_name'
]))
{
$where
[
'a.agent_name'
]
=
[
'like'
,
'%'
.
$this
->
params
[
'agent_name'
]
.
'%'
];
$is_show
=
1
;
}
//入账方式
if
(
!
empty
(
$this
->
params
[
'pay_type'
]))
{
$where
[
'a.pay_type'
]
=
$this
->
params
[
'pay_type'
];
$is_show
=
1
;
}
//入账类型
if
(
!
empty
(
$this
->
params
[
'type'
]))
{
$where
[
'a.type'
]
=
$this
->
params
[
'type'
];
$is_show
=
1
;
}
//来源
if
(
!
empty
(
$this
->
params
[
'source'
]))
{
$where
[
'a.source'
]
=
$this
->
params
[
'source'
];
$is_show
=
1
;
}
if
(
!
empty
(
$this
->
params
[
'bargain_id'
]))
{
$order_id
=
$this
->
m_bargain
->
getFieldValue
(
'order_id'
,
$this
->
params
[
'bargain_id'
]);
$where
[]
=
[
'EXP'
,
'a.id='
.
$order_id
];
}
if
(
!
empty
(
$this
->
params
[
'pay_id'
]))
{
$where
[
'a.id'
]
=
$this
->
params
[
'pay_id'
];
}
if
(
!
empty
(
$this
->
params
[
'order_id'
]))
{
$where
[
'a.order_id'
]
=
$this
->
params
[
'order_id'
];
}
$field
=
'a.create_time,a.id,c.id as march_id,a.paylog_id,a.money,b.income_time,a.type,a.new_paylog_id,a.operation_id,b.order_id'
;
$list
=
$m_paylog
->
getAdjustmentListLimit
(
$pageNo
,
$pageSize
,
$order_
=
'a.id desc'
,
$field
,
$where
);
$data
[
'total'
]
=
0
;
$m_agent
=
new
AAgents
();
$m_house
=
new
GHouses
();
$m_order
=
new
OrderModel
();
foreach
(
$list
as
$k
=>
$v
)
{
$list
[
$k
][
'name'
]
=
$m_agent
->
getAgentsById
(
$v
[
'operation_id'
],
'name'
);
$house_id
=
$m_order
->
getFieldValue
(
'house_id'
,
[
'id'
=>
$v
[
'order_id'
]]);
if
(
$house_id
)
{
$house_data
=
$m_house
->
getHouseDetail
(
'id,internal_address'
,
[
'id'
=>
$house_id
]);
$list
[
$k
][
'house_id'
]
=
$house_data
[
'id'
];
$list
[
$k
][
'address'
]
=
$house_data
[
'internal_address'
];
}
else
{
$list
[
$k
][
'house_id'
]
=
''
;
$list
[
$k
][
'address'
]
=
''
;
}
}
var_dump
(
$list
);
die
;
$data
[
'list'
]
=
$list
;
//加时间条件
if
(
$is_show
)
{
$data
[
'money_total'
]
=
$order
->
getMoneyTotal
(
$where
,
'a.money'
);
//总额
}
else
{
$data
[
'money_total'
]
=
''
;
}
$data
[
'list'
]
=
$this
->
numberTransitionString
(
$data
[
'list'
]);
// } catch (\Exception $e) {
//
// }
}
}
public
function
dailyList
()
{
public
function
dailyList
()
{
...
...
application/model/OPayLogAdjustment.php
View file @
9f0b3b5e
...
@@ -11,7 +11,7 @@ use think\Model;
...
@@ -11,7 +11,7 @@ use think\Model;
* Time : 4:29 PM
* Time : 4:29 PM
* Intro:
* Intro:
*/
*/
class
OPayLogAdjustment
extends
Model
{
class
OPayLogAdjustment
extends
Base
Model
{
protected
$table
=
"o_paylog_adjustment"
;
protected
$table
=
"o_paylog_adjustment"
;
private
$db_
;
private
$db_
;
...
@@ -100,4 +100,35 @@ class OPayLogAdjustment extends Model{
...
@@ -100,4 +100,35 @@ class OPayLogAdjustment extends Model{
return
$res
;
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
(
"o_march_in c"
,
"b.order_id = c.id"
,
"left"
)
->
join
(
"a_agents d"
,
"b.agent_id = d.id"
,
"left"
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
order
(
$order_
)
->
where
(
$params
)
->
select
();
}
public
function
getAdjustmentListTotal
(
$params
)
{
return
$this
->
db_
->
join
(
"o_paylog b"
,
"a.paylog_id = b.id"
,
"left"
)
->
join
(
"o_march_in c"
,
"b.order_id = c.id"
,
"left"
)
->
join
(
"a_agents d"
,
"b.agent_id = d.id"
,
"left"
)
->
where
(
$params
)
->
count
(
'a.di'
);
}
}
}
\ 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