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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
30 deletions
+59
-30
StoreFee.php
application/api_broker/controller/StoreFee.php
+25
-21
StoreFeeService.php
application/api_broker/service/StoreFeeService.php
+34
-9
No files found.
application/api_broker/controller/StoreFee.php
View file @
b5ae3b18
...
...
@@ -40,21 +40,21 @@ class StoreFee extends Basic
*/
public
function
addApplyFor
()
{
$params
=
$this
->
params
;
/* $params = array(
'type' => 1,//费用类型
'fee_item' => 100,//费用项目
'total_fee' => 123.43,//总费用
'agent_id' => 11,//经纪人id
'store_id' => 12,//门店
id
'assume_fee' => 111, //费用承担金额
'site_id' => 10001, //站点id
'card_name' => "123123",//收款卡户名 非必填
'bank' => "123123",//开户行 非必填
'card_no' => "123123",//银行卡号 非必填
'count_time' => "2019-07-01",//计入日期, pc后台的字段 非必填
'img_arr' => [],//数组模式 同收款一样
);*/
$params
=
$this
->
params
;
/* $params = array(
'type' => 1,//费用类型
'fee_item' => 100,//费用项目
'total_fee' => 123.43,//总费用
'purpose' => 111, //详细用途
'agent_id' => 11,//经纪人
id
'store_id' => 12,//门店id
'site_id' => 10001, //站点id
'card_name' => "123123",//收款卡户名 非必填
'bank' => "123123",//开户行 非必填
'card_no' => "123123",//银行卡号 非必填
'count_time' => "2019-07-01",//计入日期, pc后台的字段 非必填
'img_arr' => [],//数组模式 同收款一样
);*/
$checkResult
=
$this
->
validate
(
$params
,
"StoreFeeValidate.addApplyFor"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"101"
,
$checkResult
);
...
...
@@ -64,18 +64,22 @@ class StoreFee extends Basic
$total_fee
=
$params
[
"total_fee"
];
$agent_id
=
$params
[
"agent_id"
];
$store_id
=
$params
[
"store_id"
];
$
assume_fee
=
$params
[
"assume_fe
e"
];
$site_id
=
$params
[
"
assume_fee
"
];
$
purpose
=
$params
[
"purpos
e"
];
$site_id
=
$params
[
"
site_id
"
];
$card_name
=
$params
[
"card_name"
];
$bank
=
$params
[
"bank"
];
$card_no
=
$params
[
"card_no"
];
$count_time
=
$params
[
"count_time"
];
$img_arr
=
isset
(
$params
[
"img_arr"
])
?
json_decode
(
$params
[
"img_arr"
],
true
)
:
""
;
if
(
!
$img_arr
)
{
$img_arr
=
isset
(
$params
[
"img_arr"
])
?
json_decode
(
$params
[
"img_arr"
],
true
)
:
""
;
if
(
!
$img_arr
)
{
return
$this
->
response
(
"101"
,
"请上传图片"
);
}
$is_ok
=
$this
->
service_
->
addApplyFor
(
$type
,
$fee_item
,
$total_fee
,
$agent_id
,
$store_id
,
$assume_fee
,
$site_id
,
$card_name
,
$bank
,
$card_no
,
$count_time
,
$img_arr
);
$if_verify
=
$this
->
service_
->
verifyType
(
$type
,
$fee_item
);
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
)
{
return
$this
->
response
(
"200"
,
"request success"
,
[]);
}
else
{
...
...
application/api_broker/service/StoreFeeService.php
View file @
b5ae3b18
...
...
@@ -28,7 +28,7 @@ class StoreFeeService
* @param $total_fee
* @param $agent_id
* @param $store_id
* @param $
assume_fe
e
* @param $
purpos
e
* @param $site_id
* @param $card_name
* @param $bank
...
...
@@ -39,18 +39,43 @@ class StoreFeeService
* @throws \think\Exception
* @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
)
{
$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
);
$feeId
=
$this
->
applyForFeeModel
->
saveData
(
$arr
);
if
(
$feeId
>
0
)
{
$this
->
imgModel
->
addImgAll
(
$feeId
,
1
,
$img_arr
);
$this
->
imgModel
->
addImgAll
(
$feeId
,
1
,
$img_arr
);
}
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
* @param $total_fee
* @param $agent_id
* @param $store_id
* @param $
assume_fe
e
* @param $
purpos
e
* @param $site_id
* @param $card_name
* @param $bank
...
...
@@ -68,7 +93,7 @@ class StoreFeeService
* @param $count_time
* @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
)
{
...
...
@@ -91,8 +116,8 @@ class StoreFeeService
if
(
$site_id
)
{
$arr
[
"site_id"
]
=
$site_id
;
}
if
(
$
assume_fe
e
)
{
$arr
[
"
assume_fee"
]
=
$assume_fe
e
;
if
(
$
purpos
e
)
{
$arr
[
"
purpose"
]
=
$purpos
e
;
}
if
(
$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