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
b5ae3b18
Commit
b5ae3b18
authored
Jul 22, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
e1262186
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
16 deletions
+45
-16
StoreFee.php
application/api_broker/controller/StoreFee.php
+11
-7
StoreFeeService.php
application/api_broker/service/StoreFeeService.php
+34
-9
No files found.
application/api_broker/controller/StoreFee.php
View file @
b5ae3b18
...
@@ -41,13 +41,13 @@ class StoreFee extends Basic
...
@@ -41,13 +41,13 @@ class StoreFee extends Basic
public
function
addApplyFor
()
public
function
addApplyFor
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/* $params = array(
/* $params = array(
'type' => 1,//费用类型
'type' => 1,//费用类型
'fee_item' => 100,//费用项目
'fee_item' => 100,//费用项目
'total_fee' => 123.43,//总费用
'total_fee' => 123.43,//总费用
'purpose' => 111, //详细用途
'agent_id' => 11,//经纪人id
'agent_id' => 11,//经纪人id
'store_id' => 12,//门店id
'store_id' => 12,//门店id
'assume_fee' => 111, //费用承担金额
'site_id' => 10001, //站点id
'site_id' => 10001, //站点id
'card_name' => "123123",//收款卡户名 非必填
'card_name' => "123123",//收款卡户名 非必填
'bank' => "123123",//开户行 非必填
'bank' => "123123",//开户行 非必填
...
@@ -64,18 +64,22 @@ class StoreFee extends Basic
...
@@ -64,18 +64,22 @@ class StoreFee extends Basic
$total_fee
=
$params
[
"total_fee"
];
$total_fee
=
$params
[
"total_fee"
];
$agent_id
=
$params
[
"agent_id"
];
$agent_id
=
$params
[
"agent_id"
];
$store_id
=
$params
[
"store_id"
];
$store_id
=
$params
[
"store_id"
];
$
assume_fee
=
$params
[
"assume_fe
e"
];
$
purpose
=
$params
[
"purpos
e"
];
$site_id
=
$params
[
"
assume_fee
"
];
$site_id
=
$params
[
"
site_id
"
];
$card_name
=
$params
[
"card_name"
];
$card_name
=
$params
[
"card_name"
];
$bank
=
$params
[
"bank"
];
$bank
=
$params
[
"bank"
];
$card_no
=
$params
[
"card_no"
];
$card_no
=
$params
[
"card_no"
];
$count_time
=
$params
[
"count_time"
];
$count_time
=
$params
[
"count_time"
];
$img_arr
=
isset
(
$params
[
"img_arr"
])
?
json_decode
(
$params
[
"img_arr"
],
true
)
:
""
;
$img_arr
=
isset
(
$params
[
"img_arr"
])
?
json_decode
(
$params
[
"img_arr"
],
true
)
:
""
;
if
(
!
$img_arr
)
{
if
(
!
$img_arr
)
{
return
$this
->
response
(
"101"
,
"请上传图片"
);
return
$this
->
response
(
"101"
,
"请上传图片"
);
}
}
$is_ok
=
$this
->
service_
->
addApplyFor
(
$type
,
$fee_item
,
$total_fee
,
$agent_id
,
$store_id
,
$assume_fee
,
$site_id
,
$card_name
,
$if_verify
=
$this
->
service_
->
verifyType
(
$type
,
$fee_item
);
$bank
,
$card_no
,
$count_time
,
$img_arr
);
if
(
!
$if_verify
){
return
$this
->
response
(
"101"
,
"类型选择错误"
);
}
$is_ok
=
$this
->
service_
->
addApplyFor
(
$type
,
$fee_item
,
$total_fee
,
$agent_id
,
$store_id
,
$purpose
,
$site_id
,
$card_name
,
$bank
,
$card_no
,
$count_time
,
$img_arr
);
if
(
$is_ok
>
0
)
{
if
(
$is_ok
>
0
)
{
return
$this
->
response
(
"200"
,
"request success"
,
[]);
return
$this
->
response
(
"200"
,
"request success"
,
[]);
}
else
{
}
else
{
...
...
application/api_broker/service/StoreFeeService.php
View file @
b5ae3b18
...
@@ -28,7 +28,7 @@ class StoreFeeService
...
@@ -28,7 +28,7 @@ class StoreFeeService
* @param $total_fee
* @param $total_fee
* @param $agent_id
* @param $agent_id
* @param $store_id
* @param $store_id
* @param $
assume_fe
e
* @param $
purpos
e
* @param $site_id
* @param $site_id
* @param $card_name
* @param $card_name
* @param $bank
* @param $bank
...
@@ -39,18 +39,43 @@ class StoreFeeService
...
@@ -39,18 +39,43 @@ class StoreFeeService
* @throws \think\Exception
* @throws \think\Exception
* @throws \think\exception\PDOException
* @throws \think\exception\PDOException
*/
*/
public
function
addApplyFor
(
$type
,
$fee_item
,
$total_fee
,
$agent_id
,
$store_id
,
$
assume_fe
e
,
$site_id
,
$card_name
,
public
function
addApplyFor
(
$type
,
$fee_item
,
$total_fee
,
$agent_id
,
$store_id
,
$
purpos
e
,
$site_id
,
$card_name
,
$bank
,
$card_no
,
$count_time
,
$img_arr
)
$bank
,
$card_no
,
$count_time
,
$img_arr
)
{
{
$arr
=
$this
->
applyForFeeBin
(
0
,
$type
,
$fee_item
,
$total_fee
,
$agent_id
,
$store_id
,
$
assume_fe
e
,
$site_id
,
$card_name
,
$arr
=
$this
->
applyForFeeBin
(
0
,
$type
,
$fee_item
,
$total_fee
,
$agent_id
,
$store_id
,
$
purpos
e
,
$site_id
,
$card_name
,
$bank
,
$card_no
,
$count_time
);
$bank
,
$card_no
,
$count_time
);
$feeId
=
$this
->
applyForFeeModel
->
saveData
(
$arr
);
$feeId
=
$this
->
applyForFeeModel
->
saveData
(
$arr
);
if
(
$feeId
>
0
)
{
if
(
$feeId
>
0
)
{
$this
->
imgModel
->
addImgAll
(
$feeId
,
1
,
$img_arr
);
$this
->
imgModel
->
addImgAll
(
$feeId
,
1
,
$img_arr
);
}
}
return
$feeId
;
return
$feeId
;
}
public
function
verifyType
(
$type
,
$fee_item
)
{
switch
(
$type
)
{
case
1
:
if
(
$fee_item
>
0
&&
$fee_item
<
200
)
{
return
true
;
}
break
;
case
2
:
if
(
$fee_item
>
200
&&
$fee_item
<
300
)
{
return
true
;
}
break
;
case
3
:
if
(
$fee_item
==
301
)
{
return
true
;
}
break
;
case
4
:
if
(
$fee_item
>
500
&&
$fee_item
<
600
)
{
return
true
;
}
break
;
}
return
false
;
}
}
/**
/**
...
@@ -60,7 +85,7 @@ class StoreFeeService
...
@@ -60,7 +85,7 @@ class StoreFeeService
* @param $total_fee
* @param $total_fee
* @param $agent_id
* @param $agent_id
* @param $store_id
* @param $store_id
* @param $
assume_fe
e
* @param $
purpos
e
* @param $site_id
* @param $site_id
* @param $card_name
* @param $card_name
* @param $bank
* @param $bank
...
@@ -68,7 +93,7 @@ class StoreFeeService
...
@@ -68,7 +93,7 @@ class StoreFeeService
* @param $count_time
* @param $count_time
* @return array
* @return array
*/
*/
private
function
applyForFeeBin
(
$id
,
$type
,
$fee_item
,
$total_fee
,
$agent_id
,
$store_id
,
$
assume_fe
e
,
$site_id
,
$card_name
,
private
function
applyForFeeBin
(
$id
,
$type
,
$fee_item
,
$total_fee
,
$agent_id
,
$store_id
,
$
purpos
e
,
$site_id
,
$card_name
,
$bank
,
$card_no
,
$count_time
)
$bank
,
$card_no
,
$count_time
)
{
{
...
@@ -91,8 +116,8 @@ class StoreFeeService
...
@@ -91,8 +116,8 @@ class StoreFeeService
if
(
$site_id
)
{
if
(
$site_id
)
{
$arr
[
"site_id"
]
=
$site_id
;
$arr
[
"site_id"
]
=
$site_id
;
}
}
if
(
$
assume_fe
e
)
{
if
(
$
purpos
e
)
{
$arr
[
"
assume_fee"
]
=
$assume_fe
e
;
$arr
[
"
purpose"
]
=
$purpos
e
;
}
}
if
(
$card_name
)
{
if
(
$card_name
)
{
$arr
[
"card_name"
]
=
$card_name
;
$arr
[
"card_name"
]
=
$card_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