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
f101ae94
Commit
f101ae94
authored
Aug 30, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
ff8aee8a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
8 deletions
+49
-8
StoreFee.php
application/api_broker/controller/StoreFee.php
+6
-2
StoreFeeService.php
application/api_broker/service/StoreFeeService.php
+39
-6
StoreFee.php
application/index/controller/StoreFee.php
+4
-0
No files found.
application/api_broker/controller/StoreFee.php
View file @
f101ae94
...
...
@@ -74,10 +74,10 @@ class StoreFee extends Basic
$bank
=
$params
[
"bank"
];
$card_no
=
$params
[
"card_no"
];
$count_time
=
$params
[
"count_time"
];
if
((
$type
==
1
||
$type
==
5
)
&&
!
$office_id
){
if
((
$type
==
1
||
$type
==
5
)
&&
!
$office_id
)
{
return
$this
->
response
(
"101"
,
"办公室必传"
);
}
$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
)
{
return
$this
->
response
(
"101"
,
"请上传图片"
);
}
...
...
@@ -85,6 +85,10 @@ class StoreFee extends Basic
if
(
!
$if_verify
)
{
return
$this
->
response
(
"101"
,
"类型选择错误"
);
}
$is_commit
=
$this
->
service_
->
verifyTypeAndFeeItem
(
$type
,
$fee_item
,
$store_id
,
$office_id
,
$count_time
);
if
(
!
$is_commit
)
{
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
,
0
,
$office_id
);
if
(
$is_ok
>
0
)
{
...
...
application/api_broker/service/StoreFeeService.php
View file @
f101ae94
...
...
@@ -46,7 +46,8 @@ class StoreFeeService
* @param int $id
* @param int $office_id
* @return int|string
* @throws \app\model\Exception
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public
function
addApplyFor
(
$type
,
$fee_item
,
$total_fee
,
$agent_id
,
$store_id
,
$purpose
,
$site_id
,
$card_name
,
$bank
,
$card_no
,
$count_time
,
$img_arr
,
$id
=
0
,
$office_id
=
0
)
...
...
@@ -66,9 +67,7 @@ class StoreFeeService
return
$feeId
;
}
/**
* 后台提交无需总监审核
*
/**后台提交无需总监审核
* @param $type
* @param $fee_item
* @param $total_fee
...
...
@@ -85,7 +84,8 @@ class StoreFeeService
* @param int $office_id
* @param int $status
* @return int|string
* @throws \app\model\Exception
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public
function
addApplyForPC
(
$type
,
$fee_item
,
$total_fee
,
$agent_id
,
$store_id
,
$purpose
,
$site_id
,
$card_name
,
$bank
,
$card_no
,
$count_time
,
$img_arr
,
$id
=
0
,
$office_id
=
0
,
$status
=
0
)
...
...
@@ -105,10 +105,43 @@ class StoreFeeService
return
$feeId
;
}
/**
* @param $type
* @param $fee_item
* @param $store_id
* @param $office_id
* @param $count_time
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
verifyTypeAndFeeItem
(
$type
,
$fee_item
,
$store_id
,
$office_id
,
$count_time
)
{
if
(
$type
==
1
&&
$fee_item
==
101
)
{
if
(
$office_id
<=
0
)
{
$storeModel
=
new
AStore
();
$field
=
"id,office_id"
;
$office_info
=
$storeModel
->
findStore
(
$field
,
[
"id"
=>
$store_id
]);
$office_id
=
$office_info
[
"office_id"
];
}
$applyForArr
=
$this
->
applyForFeeModel
->
findByOne
(
"id"
,
[
"type"
=>
$type
,
"fee_item"
=>
$fee_item
,
"office_id"
=>
$office_id
,
"count_time"
=>
$count_time
]
);
if
(
count
(
$applyForArr
)
>
0
)
{
return
false
;
}
}
return
true
;
}
//费用类型 1办公室成本 2上海总部成本 3分部成本 4同联发展基金 5门店单独成本
public
function
verifyType
(
$type
,
$fee_item
)
{
switch
(
$type
)
{
case
1
:
if
(
$fee_item
>
0
&&
$fee_item
<
200
)
{
...
...
application/index/controller/StoreFee.php
View file @
f101ae94
...
...
@@ -494,6 +494,10 @@ class StoreFee extends Basic
return
$this
->
response
(
"101"
,
"类型选择错误"
);
}
}
$is_commit
=
$service_
->
verifyTypeAndFeeItem
(
$type
,
$fee_item
,
$store_id
,
$office_id
,
$count_time
);
if
(
!
$is_commit
){
return
$this
->
response
(
"101"
,
"办公室水电费每月只能提交一次"
);
}
$is_ok
=
$service_
->
addApplyForPC
(
$type
,
$fee_item
,
$total_fee
,
$agent_id
,
$store_id
,
$purpose
,
$site_id
,
$card_name
,
$bank
,
$card_no
,
$count_time
,
$img_arr
,
$id
,
$office_id
,
$status
);
if
(
$is_ok
>
0
)
{
...
...
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