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
9404246e
Commit
9404246e
authored
May 21, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
3d593665
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
174 additions
and
158 deletions
+174
-158
PayLogOpen.php
application/api_broker/controller/PayLogOpen.php
+1
-1
DailyPaperService.php
application/api_broker/service/DailyPaperService.php
+173
-157
No files found.
application/api_broker/controller/PayLogOpen.php
View file @
9404246e
...
...
@@ -71,7 +71,7 @@ class PayLogOpen extends Basic
}
}
/**
* 审核开业
* @return \think\Response
...
...
application/api_broker/service/DailyPaperService.php
View file @
9404246e
...
...
@@ -32,8 +32,8 @@ class DailyPaperService
public
function
__construct
()
{
$this
->
oDailyModel
=
new
ODaily
();
$this
->
aAgentsModel
=
new
AAgents
();
$this
->
oDailyModel
=
new
ODaily
();
$this
->
aAgentsModel
=
new
AAgents
();
$this
->
oDailyLogModel
=
new
ODailyLog
();
}
...
...
@@ -57,7 +57,7 @@ class DailyPaperService
$result
=
[];
$agent_info_arr
[
"agent_id"
]
=
$agent_id
;
$agent_info_field
=
"id,name,store_id,district_id,level"
;
$agent_info_field
=
"id,name,store_id,district_id,level"
;
$agent_info
=
$this
->
aAgentsModel
->
getAgentById
(
$agent_info_field
,
$agent_info_arr
);
if
(
count
(
$agent_info
)
<=
0
)
{
...
...
@@ -69,8 +69,8 @@ class DailyPaperService
//todo 获取各个list
$result
[
"list"
]
=
$this
->
getPayLogList
(
$store_id
,
$daily_data
);
//todo 统计入账出账等
$sum_info
=
$this
->
getSum
(
$store_id
,
$daily_data
);
$result
[
"recorded_money"
]
=
$sum_info
[
"sum_arr"
];
$sum_info
=
$this
->
getSum
(
$store_id
,
$daily_data
);
$result
[
"recorded_money"
]
=
$sum_info
[
"sum_arr"
];
$result
[
"adjustment_money"
]
=
$sum_info
[
"adjustment_arr"
];
$result
[
"remittance_money"
]
=
$result
[
"recorded_money"
]
-
$result
[
"adjustment_money"
];
...
...
@@ -80,10 +80,10 @@ class DailyPaperService
// if ($agent_info["level"] != 20 && $agent_info["level"] != 40) {
// return ["code" => 101, "msg" => "非店长不能查看日报"];
// }
$check_data
=
$this
->
checkAgent
(
$agent_info
[
'id'
]);
if
(
$check_data
[
'code'
]
!=
200
)
{
return
[
"code"
=>
101
,
"msg"
=>
$check_data
[
'msg'
]];
}
$check_data
=
$this
->
checkAgent
(
$agent_info
[
'id'
]);
if
(
$check_data
[
'code'
]
!=
200
)
{
return
[
"code"
=>
101
,
"msg"
=>
$check_data
[
'msg'
]];
}
//证明店长提交过
if
(
count
(
$daily_info
)
>
0
)
{
...
...
@@ -107,7 +107,7 @@ class DailyPaperService
default
:
}
$result
[
"check_list"
]
=
[];
$checkList
=
$this
->
getCheckList
(
$daily_info
[
0
][
"id"
]);
$checkList
=
$this
->
getCheckList
(
$daily_info
[
0
][
"id"
]);
if
(
count
(
$checkList
)
>
0
)
{
$result
[
"check_list"
]
=
$checkList
;
}
...
...
@@ -115,7 +115,7 @@ class DailyPaperService
//todo 统计各金额
$result
[
"total_info"
]
=
$this
->
getTotal
(
$store_id
,
$daily_data
);
$result
[
"site_id"
]
=
$daily_info
[
0
][
'site_id'
];
$result
[
"site_id"
]
=
$daily_info
[
0
][
'site_id'
];
unset
(
$daily_info
[
"site_id"
]);
return
[
"code"
=>
200
,
"data"
=>
$result
];
...
...
@@ -137,18 +137,18 @@ class DailyPaperService
return
null
;
}
//中介费入账
$field
=
"money"
;
$params
[
"agent_id"
]
=
array
(
"in"
,
(
$ids
));
$params
[
"is_del"
]
=
0
;
$field
=
"money"
;
$params
[
"agent_id"
]
=
array
(
"in"
,
(
$ids
));
$params
[
"is_del"
]
=
0
;
$params
[
"create_time"
]
=
array
(
"between"
,
array
(
$daily_data
,
$daily_data
.
" 23:59:59"
));
$payLogModel
=
new
OPayLogModel
();
$info
[
"sum_arr"
]
=
$payLogModel
->
getSum
(
$field
,
$params
);
$payLogModel
=
new
OPayLogModel
();
$info
[
"sum_arr"
]
=
$payLogModel
->
getSum
(
$field
,
$params
);
$field_adjustment
=
"b.money"
;
$params_adjustment
[
"a.agent_id"
]
=
array
(
"in"
,
(
$ids
));
$params_adjustment
[
"b.is_del"
]
=
0
;
$field_adjustment
=
"b.money"
;
$params_adjustment
[
"a.agent_id"
]
=
array
(
"in"
,
(
$ids
));
$params_adjustment
[
"b.is_del"
]
=
0
;
$params_adjustment
[
"b.create_time"
]
=
array
(
"between"
,
array
(
$daily_data
,
$daily_data
.
" 23:59:59"
));
$info
[
"adjustment_arr"
]
=
$payLogModel
->
getAdjustmentSum
(
$field_adjustment
,
$params_adjustment
);
$info
[
"adjustment_arr"
]
=
$payLogModel
->
getAdjustmentSum
(
$field_adjustment
,
$params_adjustment
);
return
$info
;
}
...
...
@@ -167,28 +167,31 @@ class DailyPaperService
return
null
;
}
//中介费入账
$field
=
"sum(money) as money,pay_type"
;
$params
[
"agent_id"
]
=
array
(
"in"
,
(
$ids
));
$params
[
"is_del"
]
=
0
;
$params
[
"source"
]
=
array
(
"in"
,
(
"0,1"
));
$field
=
"sum(money) as money,pay_type"
;
$params
[
"agent_id"
]
=
array
(
"in"
,
(
$ids
));
$params
[
"is_del"
]
=
0
;
$params
[
"source"
]
=
array
(
"in"
,
(
"0,1"
));
$params
[
"create_time"
]
=
array
(
"between"
,
array
(
$daily_data
,
$daily_data
.
" 23:59:59"
));
$payLogModel
=
new
OPayLogModel
();
$total_arr
=
$payLogModel
->
getTotal
(
$field
,
$params
,
"pay_type"
);
$total
[
"alipay"
]
=
0
;
$total
[
"alipay_2"
]
=
0
;
$total
[
"tenpay"
]
=
0
;
$total
[
"tenpay_2"
]
=
0
;
$total
[
"pos"
]
=
0
;
$total
[
"realty_pay"
]
=
0
;
$total
[
"family_pay"
]
=
0
;
$payLogModel
=
new
OPayLogModel
();
$total_arr
=
$payLogModel
->
getTotal
(
$field
,
$params
,
"pay_type"
);
$total
[
"alipay"
]
=
0
;
$total
[
"alipay_2"
]
=
0
;
$total
[
"alipay_3"
]
=
0
;
//陈志杰支付宝
$total
[
"tenpay"
]
=
0
;
$total
[
"tenpay_2"
]
=
0
;
$total
[
"tenpay_3"
]
=
0
;
//陈志杰微信
$total
[
"pos"
]
=
0
;
$total
[
"realty_pay"
]
=
0
;
$total
[
"family_pay"
]
=
0
;
$total
[
"private_bank"
]
=
0
;
$total
[
"cash"
]
=
0
;
$total
[
"other_bank"
]
=
0
;
$total
[
"bank_card"
]
=
0
;
//71 筠姐上海银行卡 72林老师建行卡 73新同联福居银行卡
$total
[
"cash"
]
=
0
;
$total
[
"other_bank"
]
=
0
;
$total
[
"bank_card"
]
=
0
;
//71 筠姐上海银行卡 72林老师建行卡 73新同联福居银行卡
74陈志杰招商
$total
[
"bank_card_yun"
]
=
0
;
$total
[
"bank_card_lin"
]
=
0
;
$total
[
"bank_card_new"
]
=
0
;
$total
[
"bank_card_chen"
]
=
0
;
if
(
count
(
$total_arr
)
<=
0
)
{
return
$total
;
}
...
...
@@ -203,6 +206,9 @@ class DailyPaperService
case
12
:
$total
[
"alipay"
]
=
$item
[
"money"
];
break
;
case
13
:
$total
[
"alipay_3"
]
=
$item
[
"money"
];
break
;
case
20
:
$total
[
"tenpay"
]
=
$item
[
"money"
];
break
;
...
...
@@ -212,6 +218,9 @@ class DailyPaperService
case
22
:
$total
[
"tenpay"
]
=
$item
[
"money"
];
break
;
case
23
:
$total
[
"tenpay_3"
]
=
$item
[
"money"
];
break
;
case
30
:
$total
[
"pos"
]
=
$item
[
"money"
];
break
;
...
...
@@ -242,6 +251,9 @@ class DailyPaperService
case
73
:
$total
[
"bank_card_new"
]
=
$item
[
"money"
];
break
;
case
74
:
$total
[
"bank_card_chen"
]
=
$item
[
"money"
];
break
;
}
}
return
$total
;
...
...
@@ -262,22 +274,22 @@ class DailyPaperService
if
(
!
$ids
)
{
return
null
;
}
$payLogModel
=
new
OPayLogModel
();
$payLogModel
=
new
OPayLogModel
();
$payLogOpenModel
=
new
OPayLogOpen
();
//中介费入账
$field
=
"a.id,c.id as bargain_id,b.house_id,c.price,a.money,a.pay_type,a.transfer_name,a.type,a.type_ext,a.income_time,
$field
=
"a.id,c.id as bargain_id,b.house_id,c.price,a.money,a.pay_type,a.transfer_name,a.type,a.type_ext,a.income_time,
d.report_agent_id as agent_id,a.is_open,a.is_dividend,a.receipt_number,a.create_time,a.remark,a.received_money,a.transaction_fee,
a.order_no,a.order_id,a.report_id,a.bargain_id,a.real_money"
;
$params
[
"a.agent_id"
]
=
array
(
"in"
,
(
$ids
));
$params
[
"a.agent_id"
]
=
array
(
"in"
,
(
$ids
));
$params
[
"a.create_time"
]
=
array
(
"between"
,
array
(
$daily_data
,
$daily_data
.
" 23:59:59"
));
$params
[
"a.is_del"
]
=
0
;
$params
[
"a.type"
]
=
91
;
$params
[
"c.father_id"
]
=
0
;
$info
[
"agency_fee"
]
=
$this
->
getHouseAndAgentInfo
(
$params
[
"a.is_del"
]
=
0
;
$params
[
"a.type"
]
=
91
;
$params
[
"c.father_id"
]
=
0
;
$info
[
"agency_fee"
]
=
$this
->
getHouseAndAgentInfo
(
$payLogModel
->
selectPayLogListByBargain
(
$field
,
$params
)
);
foreach
(
$info
[
"agency_fee"
]
as
$k
=>
$v
)
{
foreach
(
$info
[
"agency_fee"
]
as
$k
=>
$v
)
{
$info
[
"agency_fee"
][
$k
][
'current_agent_name'
]
=
''
;
if
(
$v
[
'bargain_id'
]
>
0
)
{
$current_agent_name
=
$this
->
getBargainAgent
(
$v
[
'bargain_id'
]);
...
...
@@ -286,7 +298,7 @@ class DailyPaperService
}
}
$open_data
=
$payLogOpenModel
->
getFind
(
'id'
,
0
,
[
'pay_log_id'
=>
$v
[
'id'
]]);
$open_data
=
$payLogOpenModel
->
getFind
(
'id'
,
0
,
[
'pay_log_id'
=>
$v
[
'id'
]]);
if
(
$open_data
[
'id'
])
{
$info
[
"agency_fee"
][
$k
][
'is_check'
]
=
1
;
}
else
{
...
...
@@ -298,11 +310,11 @@ class DailyPaperService
//案场费入账 盘方
$params
[
"a.type"
]
=
92
;
$case_fee_arr
=
$payLogModel
->
selectPayLogListByBargain
(
$field
,
$params
);
$case_fee_arr
=
$payLogModel
->
selectPayLogListByBargain
(
$field
,
$params
);
$new_case_fee_arr
=
$this
->
getHousePan
(
$case_fee_arr
);
$info
[
"case_fee"
]
=
$this
->
getHouseAndAgentInfo
(
$new_case_fee_arr
);
foreach
(
$info
[
"case_fee"
]
as
$k
=>
$v
)
{
foreach
(
$info
[
"case_fee"
]
as
$k
=>
$v
)
{
$info
[
"case_fee"
][
$k
][
'current_agent_name'
]
=
''
;
if
(
$v
[
'bargain_id'
]
>
0
)
{
$current_agent_name
=
$this
->
getBargainAgent
(
$v
[
'bargain_id'
]);
...
...
@@ -323,9 +335,9 @@ class DailyPaperService
);
$m_report
=
new
OReportModel
();
foreach
(
$info
[
"earnest_money"
]
as
$k
=>
$v
)
{
foreach
(
$info
[
"earnest_money"
]
as
$k
=>
$v
)
{
if
(
$v
[
'report_id'
]
>
0
)
{
$current_agent_name
=
$m_report
->
selectReportById
(
'report_agent_name,report_store_id'
,
[
'id'
=>
$v
[
'report_id'
]]);
$current_agent_name
=
$m_report
->
selectReportById
(
'report_agent_name,report_store_id'
,
[
'id'
=>
$v
[
'report_id'
]]);
$info
[
"earnest_money"
][
$k
][
'current_agent_name'
]
=
empty
(
$current_agent_name
[
0
][
'report_agent_name'
])
?
""
:
$current_agent_name
[
0
][
'report_agent_name'
];
}
else
{
$info
[
'earnest_money'
][
$k
][
'current_agent_name'
]
=
''
;
...
...
@@ -333,13 +345,13 @@ class DailyPaperService
}
//保管金
$params
[
"a.type"
]
=
30
;
$params
[
"a.type"
]
=
30
;
$info
[
"custody_money"
]
=
$this
->
getHouseAndAgentInfo
(
$payLogModel
->
selectPayLogListByBargainReport
(
$field_money
,
$params
)
);
foreach
(
$info
[
"custody_money"
]
as
$k
=>
$v
)
{
foreach
(
$info
[
"custody_money"
]
as
$k
=>
$v
)
{
if
(
$v
[
'report_id'
]
>
0
)
{
$current_agent_name
=
$m_report
->
selectReportById
(
'report_agent_name,report_store_id'
,
[
'id'
=>
$v
[
'report_id'
]]);
$current_agent_name
=
$m_report
->
selectReportById
(
'report_agent_name,report_store_id'
,
[
'id'
=>
$v
[
'report_id'
]]);
$info
[
'custody_money'
][
$k
][
'current_agent_name'
]
=
empty
(
$current_agent_name
[
0
][
'report_agent_name'
])
?
""
:
$current_agent_name
[
0
][
'report_agent_name'
];
}
else
{
$info
[
'custody_money'
][
$k
][
'current_agent_name'
]
=
''
;
...
...
@@ -347,13 +359,13 @@ class DailyPaperService
}
//调整出账
$field_adjustment
=
"b.id,c.house_id,b.new_paylog_id as pay_log_id,a.agent_id,b.money,a.income_time,b.type,
$field_adjustment
=
"b.id,c.house_id,b.new_paylog_id as pay_log_id,a.agent_id,b.money,a.income_time,b.type,
a.receipt_number,a.create_time,a.transaction_fee,b.paylog_id as old_paylog_id,a.report_id,a.real_money"
;
$params_adjustment
[
"b.operation_id"
]
=
array
(
"in"
,
(
$ids
));
$params_adjustment
[
"a.is_del"
]
=
0
;
$params_adjustment
[
"b.is_del"
]
=
0
;
$params_adjustment
[
"b.create_time"
]
=
array
(
"between"
,
array
(
$daily_data
,
$daily_data
.
" 23:59:59"
));
$info
[
"adjustment"
]
=
$this
->
getHouseAndAgentInfo
(
$params_adjustment
[
"a.is_del"
]
=
0
;
$params_adjustment
[
"b.is_del"
]
=
0
;
$params_adjustment
[
"b.create_time"
]
=
array
(
"between"
,
array
(
$daily_data
,
$daily_data
.
" 23:59:59"
));
$info
[
"adjustment"
]
=
$this
->
getHouseAndAgentInfo
(
$payLogModel
->
selectAdjustmentList
(
$field_adjustment
,
$params_adjustment
)
);
return
$info
;
...
...
@@ -389,6 +401,7 @@ class DailyPaperService
return
$data
;
}
/**
* @param $data
* @return mixed
...
...
@@ -412,8 +425,8 @@ class DailyPaperService
$house_arr
=
$this
->
houseInfo
(
$house_id_str
);
foreach
(
$data
as
$k
=>
$v
)
{
$data
[
$k
][
"agent_name"
]
=
""
;
$data
[
$k
][
"store_name"
]
=
""
;
$data
[
$k
][
"agent_name"
]
=
""
;
$data
[
$k
][
"store_name"
]
=
""
;
$data
[
$k
][
"house_address"
]
=
""
;
foreach
(
$agent_arr
as
$value
)
{
if
(
$v
[
"agent_id"
]
==
$value
[
"id"
])
{
...
...
@@ -454,7 +467,7 @@ class DailyPaperService
*/
private
function
houseInfo
(
$house_id_str
)
{
$houseModel
=
new
GHouses
();
$houseModel
=
new
GHouses
();
$params
[
"id"
]
=
array
(
"in"
,
(
$house_id_str
));
return
$houseModel
->
getHouseInfo
(
"id,internal_address"
,
$params
);
}
...
...
@@ -469,10 +482,10 @@ class DailyPaperService
*/
private
function
housePanInfo
(
$house_id_str
)
{
$gModel
=
new
GHousesToAgents
();
$gModel
=
new
GHousesToAgents
();
$params
[
"houses_id"
]
=
array
(
"in"
,
(
$house_id_str
));
$params
[
"type"
]
=
2
;
$params
[
"is_del"
]
=
0
;
$params
[
"type"
]
=
2
;
$params
[
"is_del"
]
=
0
;
return
$gModel
->
getAgentsList
(
"houses_id,agents_id"
,
$params
);
}
...
...
@@ -487,8 +500,8 @@ class DailyPaperService
private
function
getAgentsByStoreId
(
$store_id
)
{
$params
[
"store_id"
]
=
$store_id
;
$arr_list
=
$this
->
aAgentsModel
->
getAgentById
(
"id"
,
$params
);
$ids
=
""
;
$arr_list
=
$this
->
aAgentsModel
->
getAgentById
(
"id"
,
$params
);
$ids
=
""
;
if
(
count
(
$arr_list
)
>
0
)
{
foreach
(
$arr_list
as
$item
)
{
$ids
.=
$item
[
"id"
]
.
","
;
...
...
@@ -507,13 +520,14 @@ class DailyPaperService
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
private
function
getCheckList
(
$daily_id
,
$agent_id
=
0
)
private
function
getCheckList
(
$daily_id
,
$agent_id
=
0
)
{
$field
=
"id,daily_id,operation_id,operation_name,remark,alipay,tenpay,realty_pay,family_pay,private_bank,
cash,pos,other_bank,create_time,update_time,tenpay_2,alipay_2,bank_card,bank_card_yun,bank_card_lin,bank_card_new"
;
$field
=
"id,daily_id,operation_id,operation_name,remark,alipay,tenpay,realty_pay,family_pay,private_bank,
cash,pos,other_bank,create_time,update_time,tenpay_2,alipay_2,tenpay_3,alipay_3,bank_card,bank_card_yun,bank_card_lin
,bank_card_new,bank_card_chen"
;
$params
[
"daily_id"
]
=
$daily_id
;
$params
[
"is_del"
]
=
0
;
if
(
$agent_id
>
0
)
{
$params
[
"is_del"
]
=
0
;
if
(
$agent_id
>
0
)
{
$params
[
"operation_id"
]
=
$agent_id
;
}
...
...
@@ -543,28 +557,28 @@ class DailyPaperService
*/
public
function
addDaily
(
$agent_id
,
$agent_name
,
$daily_date
,
$alipay
,
$tenpay
,
$realty_pay
,
$family_pay
,
$private_bank
,
$cash
,
$pos
,
$other_bank
,
$tenpay_2
,
$alipay_2
,
$site_id
,
$bank_card
,
$bank_card_yun
,
$bank_card_lin
,
$bank_card_new
)
$bank_card_yun
,
$bank_card_lin
,
$bank_card_new
)
{
$agent_info_arr
[
"agent_id"
]
=
$agent_id
;
$agent_info_field
=
"id,name,store_id,district_id,level"
;
$agent_info_field
=
"id,name,store_id,district_id,level"
;
$agent_info
=
$this
->
aAgentsModel
->
getAgentById
(
$agent_info_field
,
$agent_info_arr
);
if
(
count
(
$agent_info
)
<=
0
||
(
$agent_info
[
0
][
"level"
]
!=
20
&&
$agent_info
[
0
][
"level"
]
!=
40
))
{
$check_rule
=
new
VipService
();
$is
=
$check_rule
->
checkRule
(
$agent_id
,
"commitDaily"
);
$is
=
$check_rule
->
checkRule
(
$agent_id
,
"commitDaily"
);
if
(
$is
)
{
return
[
"code"
=>
101
,
"msg"
=>
"没有提交财务日报权限"
];
}
}
//todo 判断是否提交过,
$dailyInfo
=
$this
->
getDailyInfo
(
$agent_id
,
$daily_date
,
1
);
if
(
count
(
$dailyInfo
)
>
0
)
{
$dailyInfo
=
$this
->
getDailyInfo
(
$agent_id
,
$daily_date
,
1
);
if
(
count
(
$dailyInfo
)
>
0
)
{
return
[
"code"
=>
101
,
"msg"
=>
"请勿重复提交日报"
];
}
$params
=
$this
->
dailyBin
(
$agent_id
,
$agent_name
,
$daily_date
,
$alipay
,
$tenpay
,
$realty_pay
,
$family_pay
,
$private_bank
,
$cash
,
$pos
,
$other_bank
,
$agent_info
[
0
][
"store_id"
],
$agent_info
[
0
][
"district_id"
],
$tenpay_2
,
$alipay_2
,
$site_id
,
$bank_card
,
$bank_card_yun
,
$bank_card_lin
,
$bank_card_new
);
$is_ok
=
$this
->
oDailyModel
->
addDaily
(
$params
);
$tenpay_2
,
$alipay_2
,
$site_id
,
$bank_card
,
$bank_card_yun
,
$bank_card_lin
,
$bank_card_new
);
$is_ok
=
$this
->
oDailyModel
->
addDaily
(
$params
);
if
(
$is_ok
>
0
)
{
return
[
"code"
=>
200
,
"data"
=>
null
];
}
else
{
...
...
@@ -572,32 +586,32 @@ class DailyPaperService
}
}
public
function
dailyBin
(
$agent_id
,
$agent_name
,
$daily_date
,
$alipay
,
$tenpay
,
$realty_pay
,
$family_pay
,
$private_bank
,
public
function
dailyBin
(
$agent_id
,
$agent_name
,
$daily_date
,
$alipay
,
$tenpay
,
$realty_pay
,
$family_pay
,
$private_bank
,
$cash
,
$pos
,
$other_bank
,
$store_id
,
$district_id
,
$tenpay_2
,
$alipay_2
,
$site_id
,
$bank_card
,
$bank_card_yun
,
$bank_card_lin
,
$bank_card_new
)
$bank_card_yun
,
$bank_card_lin
,
$bank_card_new
)
{
$arr
[
"agent_id"
]
=
$agent_id
;
$arr
[
"agent_name"
]
=
$agent_name
;
$arr
[
"store_id"
]
=
$store_id
;
$arr
[
"district_id"
]
=
$district_id
;
$arr
[
"daily_date"
]
=
$daily_date
;
$arr
[
"alipay"
]
=
$alipay
;
$arr
[
"tenpay"
]
=
$tenpay
;
$arr
[
"realty_pay"
]
=
$realty_pay
;
$arr
[
"family_pay"
]
=
$family_pay
;
$arr
[
"private_bank"
]
=
$private_bank
;
$arr
[
"cash"
]
=
$cash
;
$arr
[
"pos"
]
=
$pos
;
$arr
[
"other_bank"
]
=
$other_bank
;
$arr
[
"bank_card"
]
=
$bank_card
;
$arr
[
"tenpay_2"
]
=
$tenpay_2
;
$arr
[
"alipay_2"
]
=
$alipay_2
;
$arr
[
"site_id"
]
=
$site_id
;
$arr
[
"agent_id"
]
=
$agent_id
;
$arr
[
"agent_name"
]
=
$agent_name
;
$arr
[
"store_id"
]
=
$store_id
;
$arr
[
"district_id"
]
=
$district_id
;
$arr
[
"daily_date"
]
=
$daily_date
;
$arr
[
"alipay"
]
=
$alipay
;
$arr
[
"tenpay"
]
=
$tenpay
;
$arr
[
"realty_pay"
]
=
$realty_pay
;
$arr
[
"family_pay"
]
=
$family_pay
;
$arr
[
"private_bank"
]
=
$private_bank
;
$arr
[
"cash"
]
=
$cash
;
$arr
[
"pos"
]
=
$pos
;
$arr
[
"other_bank"
]
=
$other_bank
;
$arr
[
"bank_card"
]
=
$bank_card
;
$arr
[
"tenpay_2"
]
=
$tenpay_2
;
$arr
[
"alipay_2"
]
=
$alipay_2
;
$arr
[
"site_id"
]
=
$site_id
;
$arr
[
"bank_card_yun"
]
=
$bank_card_yun
;
$arr
[
"bank_card_lin"
]
=
$bank_card_lin
;
$arr
[
"bank_card_new"
]
=
$bank_card_new
;
$arr
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$arr
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$arr
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$arr
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
return
$arr
;
}
...
...
@@ -628,37 +642,37 @@ class DailyPaperService
* @throws \think\exception\DbException
*/
public
function
addDailyCheck
(
$daily_id
,
$agent_id
,
$agent_name
,
$alipay
,
$tenpay
,
$realty_pay
,
$family_pay
,
$private_bank
,
$cash
,
$pos
,
$other_bank
,
$remark
,
$operation_status
,
$tenpay_2
,
$alipay_2
,
$bank_card
,
$bank_card_yun
,
$bank_card_lin
,
$bank_card_new
)
$cash
,
$pos
,
$other_bank
,
$remark
,
$operation_status
,
$tenpay_2
,
$alipay_2
,
$bank_card
,
$bank_card_yun
,
$bank_card_lin
,
$bank_card_new
)
{
$agent_info_arr
[
"agent_id"
]
=
$agent_id
;
$agent_info_field
=
"id,name,store_id,district_id,level"
;
$agent_info_field
=
"id,name,store_id,district_id,level"
;
$agent_info
=
$this
->
aAgentsModel
->
getAgentById
(
$agent_info_field
,
$agent_info_arr
);
if
(
count
(
$agent_info
)
<=
0
)
{
if
(
count
(
$agent_info
)
<=
0
)
{
return
[
"code"
=>
101
,
"msg"
=>
"经纪人信息错误"
];
}
//todo 判断是否提交过,
$dailyInfo
=
$this
->
getCheckList
(
$daily_id
,
$agent_id
);
if
(
count
(
$dailyInfo
)
>
0
)
{
$dailyInfo
=
$this
->
getCheckList
(
$daily_id
,
$agent_id
);
if
(
count
(
$dailyInfo
)
>
0
)
{
return
[
"code"
=>
101
,
"msg"
=>
"您已经审核过了"
];
}
$params
=
$this
->
dailyLogBin
(
$daily_id
,
$agent_id
,
$agent_name
,
$alipay
,
$tenpay
,
$realty_pay
,
$family_pay
,
$private_bank
,
$cash
,
$pos
,
$other_bank
,
$remark
,
$operation_status
,
$tenpay_2
,
$alipay_2
,
$bank_card
,
$bank_card_yun
,
$bank_card_lin
,
$bank_card_new
);
$family_pay
,
$private_bank
,
$cash
,
$pos
,
$other_bank
,
$remark
,
$operation_status
,
$tenpay_2
,
$alipay_2
,
$bank_card
,
$bank_card_yun
,
$bank_card_lin
,
$bank_card_new
);
$is_ok
=
$this
->
oDailyLogModel
->
addDailyCheck
(
$params
);
$is_ok
=
$this
->
oDailyLogModel
->
addDailyCheck
(
$params
);
if
(
$is_ok
>
0
)
{
if
(
$operation_status
==
1
)
{
//修改主表审核状态
if
(
$is_ok
>
0
)
{
if
(
$operation_status
==
1
)
{
//修改主表审核状态
$update_where
[
"id"
]
=
$daily_id
;
$update_params
[
"status"
]
=
1
;
$update_params
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$this
->
oDailyModel
->
updateDaily
(
$update_where
,
$update_params
);
$update_params
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$this
->
oDailyModel
->
updateDaily
(
$update_where
,
$update_params
);
}
return
[
"code"
=>
200
,
"data"
=>
null
];
}
else
{
return
[
"code"
=>
200
,
"data"
=>
null
];
}
else
{
return
[
"code"
=>
101
,
"msg"
=>
"审核异常"
];
}
...
...
@@ -688,31 +702,31 @@ class DailyPaperService
* @param $bank_card_new
* @return mixed
*/
public
function
dailyLogBin
(
$daily_id
,
$agent_id
,
$agent_name
,
$alipay
,
$tenpay
,
$realty_pay
,
$family_pay
,
$private_bank
,
$cash
,
$pos
,
$other_bank
,
$remark
,
$operation_status
,
$tenpay_2
,
$alipay_2
,
$bank_card
,
$bank_card_yun
,
$bank_card_lin
,
$bank_card_new
)
public
function
dailyLogBin
(
$daily_id
,
$agent_id
,
$agent_name
,
$alipay
,
$tenpay
,
$realty_pay
,
$family_pay
,
$private_bank
,
$cash
,
$pos
,
$other_bank
,
$remark
,
$operation_status
,
$tenpay_2
,
$alipay_2
,
$bank_card
,
$bank_card_yun
,
$bank_card_lin
,
$bank_card_new
)
{
$arr
[
"daily_id"
]
=
$daily_id
;
$arr
[
"operation_id"
]
=
$agent_id
;
$arr
[
"operation_name"
]
=
$agent_name
;
$arr
[
"remark"
]
=
$remark
;
$arr
[
"alipay"
]
=
$alipay
;
$arr
[
"tenpay"
]
=
$tenpay
;
$arr
[
"realty_pay"
]
=
$realty_pay
;
$arr
[
"family_pay"
]
=
$family_pay
;
$arr
[
"private_bank"
]
=
$private_bank
;
$arr
[
"cash"
]
=
$cash
;
$arr
[
"pos"
]
=
$pos
;
$arr
[
"other_bank"
]
=
$other_bank
;
$arr
[
"daily_id"
]
=
$daily_id
;
$arr
[
"operation_id"
]
=
$agent_id
;
$arr
[
"operation_name"
]
=
$agent_name
;
$arr
[
"remark"
]
=
$remark
;
$arr
[
"alipay"
]
=
$alipay
;
$arr
[
"tenpay"
]
=
$tenpay
;
$arr
[
"realty_pay"
]
=
$realty_pay
;
$arr
[
"family_pay"
]
=
$family_pay
;
$arr
[
"private_bank"
]
=
$private_bank
;
$arr
[
"cash"
]
=
$cash
;
$arr
[
"pos"
]
=
$pos
;
$arr
[
"other_bank"
]
=
$other_bank
;
$arr
[
"operation_status"
]
=
$operation_status
;
$arr
[
"tenpay_2"
]
=
$tenpay_2
;
$arr
[
"alipay_2"
]
=
$alipay_2
;
$arr
[
"bank_card"
]
=
$bank_card
;
$arr
[
"bank_card_yun"
]
=
$bank_card_yun
;
$arr
[
"bank_card_lin"
]
=
$bank_card_lin
;
$arr
[
"bank_card_new"
]
=
$bank_card_new
;
$arr
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$arr
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$arr
[
"tenpay_2"
]
=
$tenpay_2
;
$arr
[
"alipay_2"
]
=
$alipay_2
;
$arr
[
"bank_card"
]
=
$bank_card
;
$arr
[
"bank_card_yun"
]
=
$bank_card_yun
;
$arr
[
"bank_card_lin"
]
=
$bank_card_lin
;
$arr
[
"bank_card_new"
]
=
$bank_card_new
;
$arr
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$arr
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
return
$arr
;
}
...
...
@@ -727,13 +741,13 @@ class DailyPaperService
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
private
function
getDailyInfo
(
$store_id
,
$daily_data
,
$type
=
0
)
private
function
getDailyInfo
(
$store_id
,
$daily_data
,
$type
=
0
)
{
$field_info_field
=
"id,agent_id,agent_name,daily_date,alipay,tenpay,realty_pay,family_pay,private_bank,
cash,pos,other_bank,status,create_time,update_time,alipay_2,tenpay_2,site_id,bank_card,bank_card_yun,bank_card_lin,bank_card_new"
;
if
(
$type
==
1
)
{
if
(
$type
==
1
)
{
$daily_info_params
[
"agent_id"
]
=
$store_id
;
}
else
{
}
else
{
$daily_info_params
[
"store_id"
]
=
$store_id
;
}
...
...
@@ -749,8 +763,8 @@ class DailyPaperService
*/
public
function
getImgs
(
$pay_log_id
)
{
$oImgModel
=
new
OImg
();
$params
[
"img_id"
]
=
$pay_log_id
;
$oImgModel
=
new
OImg
();
$params
[
"img_id"
]
=
$pay_log_id
;
$params
[
"img_type"
]
=
2
;
return
$oImgModel
->
getImgList
(
$params
);
}
...
...
@@ -761,10 +775,11 @@ class DailyPaperService
* @param $daily_id
* @return int
*/
public
function
isCheck
(
$daily_id
)
{
public
function
isCheck
(
$daily_id
)
{
$where
[
'daily_id'
]
=
$daily_id
;
$where
[
'is_del'
]
=
0
;
$num
=
$this
->
oDailyLogModel
->
getTotal
(
$where
);
$where
[
'is_del'
]
=
0
;
$num
=
$this
->
oDailyLogModel
->
getTotal
(
$where
);
$result
=
$num
>
0
?
1
:
0
;
return
$result
;
...
...
@@ -778,13 +793,14 @@ class DailyPaperService
* @param $district_id
* @return array
*/
public
function
checkAgent
(
$agent_id
)
{
public
function
checkAgent
(
$agent_id
)
{
$check_rule
=
new
VipService
();
$is_
=
$check_rule
->
checkRule
(
$agent_id
,
'index/dailyDetail'
);
$is_
=
$check_rule
->
checkRule
(
$agent_id
,
'index/dailyDetail'
);
if
(
$is_
)
{
$result
=
[
"code"
=>
101
,
"msg"
=>
"没有查看财务日报权限"
];
$result
=
[
"code"
=>
101
,
"msg"
=>
"没有查看财务日报权限"
];
}
else
{
$result
=
[
"code"
=>
200
];
$result
=
[
"code"
=>
200
];
}
return
$result
;
}
...
...
@@ -800,17 +816,17 @@ class DailyPaperService
*/
public
function
getBargainAgent
(
$bargain_id
)
{
$bargain_where
[]
=
[
'EXP'
,
'a.id ='
.
$bargain_id
.
' or father_id='
.
$bargain_id
];
$bargain_where
[
'a.status'
]
=
[
'in'
,
'10,11,13'
];
$bargain_where
[
'a.role'
]
=
[
'in'
,
'3,4,5'
];
$bargain_where
[]
=
[
'EXP'
,
'a.id ='
.
$bargain_id
.
' or father_id='
.
$bargain_id
];
$bargain_where
[
'a.status'
]
=
[
'in'
,
'10,11,13'
];
$bargain_where
[
'a.role'
]
=
[
'in'
,
'3,4,5'
];
$m_bargain
=
new
OBargainModel
();
$m_bargain
=
new
OBargainModel
();
$bargain_data
=
$m_bargain
->
agentBargainAll
(
'a.role,a.scale,b.name'
,
$bargain_where
);
$role_arr
=
[
1
=>
'盘方'
,
2
=>
'客方'
,
3
=>
'反签'
,
4
=>
'独家'
,
5
=>
'合作方'
,
6
=>
'APP盘下载方'
,
7
=>
'APP客下载方'
];
$name
=
''
;
$role_arr
=
[
1
=>
'盘方'
,
2
=>
'客方'
,
3
=>
'反签'
,
4
=>
'独家'
,
5
=>
'合作方'
,
6
=>
'APP盘下载方'
,
7
=>
'APP客下载方'
];
$name
=
''
;
foreach
(
$bargain_data
as
$k2
=>
$v2
)
{
$name
.=
$v2
[
'name'
]
.
'('
.
$role_arr
[
$v2
[
'role'
]]
.
$v2
[
'scale'
]
.
'%),'
;
foreach
(
$bargain_data
as
$k2
=>
$v2
)
{
$name
.=
$v2
[
'name'
]
.
'('
.
$role_arr
[
$v2
[
'role'
]]
.
$v2
[
'scale'
]
.
'%),'
;
}
return
rtrim
(
$name
,
','
);
...
...
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