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
8c15ad8a
Commit
8c15ad8a
authored
Jul 22, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
费用报销列表
parent
a03bf303
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
208 additions
and
68 deletions
+208
-68
ApplyForCost.php
application/api_broker/controller/ApplyForCost.php
+112
-0
Cost.php
application/index/controller/Cost.php
+3
-64
CostService.php
application/index/service/CostService.php
+62
-0
FApplyForFeeCheck.php
application/model/FApplyForFeeCheck.php
+11
-0
FImg.php
application/model/FImg.php
+15
-0
route.php
application/route.php
+5
-4
No files found.
application/api_broker/controller/ApplyForCost.php
0 → 100644
View file @
8c15ad8a
<?php
/**
* Created by PhpStorm.
* User: 43897
* Date: 2019/7/19
* Time: 15:39
*/
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\RedisCacheService
;
use
app\api_broker\service\VipService
;
use
app\index\service\CostService
;
use
app\model\FApplyForFee
;
use
app\model\FApplyForFeeCheck
;
use
app\model\FImg
;
class
ApplyForCost
extends
Basic
{
/**
* 费用申请列表
*
* @return \think\Response
*/
public
function
costList
()
{
$pageNo
=
empty
(
$this
->
params
[
'page_no'
])
?
1
:
$this
->
params
[
'page_no'
];
$pageSize
=
empty
(
$this
->
params
[
'page_size'
])
?
15
:
$this
->
params
[
'page_size'
];
if
(
!
empty
(
$this
->
params
[
'site_id'
]))
{
$where
[
'a.site_id'
]
=
$this
->
params
[
'site_id'
];
}
$redis
=
new
RedisCacheService
();
$agent_data
=
$redis
->
getRedisCache
(
2
,
$this
->
agentId
);
$check_rule
=
new
VipService
();
$check_url
=
ltrim
(
$this
->
request
->
baseUrl
(),
'/'
);
$is_check
=
0
;
switch
(
$check_url
)
{
case
'broker/costListStore'
:
$is_ok
=
$check_rule
->
checkRule
(
$this
->
agentId
,
$check_url
);
if
(
$is_ok
)
{
$is_check
=
1
;
}
// $where['a.status'] = 0;
$where
[
'a.agent_id'
]
=
$this
->
agentId
;
break
;
//店长查看提交
case
'broker/costListDistrict'
:
$is_ok
=
$check_rule
->
checkRule
(
$this
->
agentId
,
$check_url
);
if
(
$is_ok
)
{
$is_check
=
1
;
}
//总监权限查看
$where
[
'a.status'
]
=
1
;
$where
[]
=
[
'EXP'
,
'b.store_id = '
.
$agent_data
[
'store_id'
]
.
' or b.district_id ='
.
$agent_data
[
'district_id'
]];
break
;
case
'broker/costListOne'
:
$where
[
'a.status'
]
=
2
;
break
;
case
'broker/costListTwo'
:
$where
[
'a.status'
]
=
3
;
break
;
case
'broker/costListThree'
:
$where
[
'a.status'
]
=
4
;
break
;
default
:
return
$this
->
response
(
101
,
'请求错误'
);
}
$field
=
'a.id,a.count_time,a.source,a.type,a.create_time,a.agent_id,a.total_fee,a.fee_item,a.purpose,'
;
$field
.=
'b.name as agent_name,a.card_name,a.bank,a.card_no,a.source'
;
$fee_model
=
new
FApplyForFee
();
$cost_service
=
new
CostService
();
$m_img
=
new
FImg
();
$m_check
=
new
FApplyForFeeCheck
();
$list
=
$fee_model
->
getJoinAgentList
(
$pageNo
,
$pageSize
,
'a.ID DESC'
,
$field
,
$where
);
$source
=
[
0
=>
'app申请'
,
1
=>
'excel导入'
];
foreach
(
$list
as
$k
=>
$v
)
{
$list
[
$k
][
'type_name'
]
=
$cost_service
->
getFeeType
(
$v
[
'type'
]);
$list
[
$k
][
'fee_item_name'
]
=
$cost_service
->
getFeeItem
(
$v
[
'fee_item'
]);
$list
[
$k
][
'is_check'
]
=
$is_check
;
$list
[
$k
][
'source_name'
]
=
$source
[
$v
[
'source'
]];
$images_array
=
$image_data
=
$m_img
->
findByAll
(
'id,img_name,img_type'
,
[
'img_id'
=>
$v
[
'id'
],
'img_type'
=>
[
'in'
,
'1,2'
]]);
$image_array
=
$check_image_array
=
[];
foreach
(
$images_array
as
$key
=>
$val
)
{
if
(
$val
[
'img_type'
]
==
1
)
{
$image_array
[]
=
[
'id'
=>
$val
[
'id'
],
'img_name'
=>
$val
[
'img_name'
]
];
}
else
{
$check_image_array
[]
=
[
'id'
=>
$val
[
'id'
],
'img_name'
=>
$val
[
'img_name'
]
];
}
}
$list
[
$k
][
'image_array'
]
=
$image_array
;
$list
[
$k
][
'check_image_array'
]
=
$check_image_array
;
$list
[
$k
][
'check_list'
]
=
$m_check
->
findByAll
(
'a.remark,a.create_time,b.name as agent_name'
,[
'apply_for_id'
=>
$v
[
'id'
]]);
$list
[
$k
][
'image_base_url'
]
=
''
;
}
return
$this
->
response
(
200
,
''
,
$list
);
}
}
\ No newline at end of file
application/index/controller/Cost.php
View file @
8c15ad8a
...
...
@@ -41,7 +41,7 @@ class Cost extends Basic
return
$this
->
response
(
200
,
''
,
$data
);
}
else
{
$list
=
$fee_model
->
getJoinAgentList
(
1
,
100000
,
'a.ID DESC'
,
$field
,
$where
);
$cost_service
=
new
CostService
();
$source
=
[
0
=>
'app申请'
,
1
=>
'excel导入'
...
...
@@ -60,8 +60,8 @@ class Cost extends Basic
'create_time'
=>
$v
[
'create_time'
],
'agent_name'
=>
$v
[
'agent_name'
],
'total_fee'
=>
$v
[
'total_fee'
],
'type_name'
=>
$
this
->
getFeeType
(
$v
[
'type'
]),
'fee_item_name'
=>
$
this
->
getFeeItem
(
$v
[
'fee_item'
]),
'type_name'
=>
$
cost_service
->
getFeeType
(
$v
[
'type'
]),
'fee_item_name'
=>
$
cost_service
->
getFeeItem
(
$v
[
'fee_item'
]),
'purpose'
=>
$v
[
'purpose'
],
'source_name'
=>
$source
[
$v
[
'source'
]],
'status'
=>
$status
[
$v
[
'status'
]]
...
...
@@ -242,65 +242,5 @@ class Cost extends Basic
return
$this
->
response
(
$code
,
$result
[
'msg'
]);
}
/**
* 获取费用项目
*
* @param $key
* @return string
*/
private
function
getFeeItem
(
$key
)
{
$item_array
=
[
100
=>
'房租租金'
,
101
=>
'水电费'
,
102
=>
'其他费用'
,
201
=>
'总部固定成本'
,
301
=>
'分部固定成本'
,
401
=>
'同联发展基金'
,
501
=>
'家庭基金报销'
,
502
=>
'社保报销'
,
503
=>
'总经理基薪'
,
504
=>
'区域秘书基薪'
,
505
=>
'招聘成本'
,
506
=>
'区域经理基本工资平摊'
,
507
=>
'宿舍成本'
,
508
=>
'宿舍亏损'
,
509
=>
'手续费'
,
510
=>
'员工工资成本'
,
511
=>
'网络报销'
,
512
=>
'离职员工网络'
,
513
=>
'门店独有成本其他费用'
];
if
(
array_key_exists
(
$key
,
$item_array
))
{
$result
=
$item_array
[
$key
];
}
else
{
$result
=
'未知'
;
}
return
$result
;
}
/**
* 获取费用报销类型
*
* @param $key
* @return string
*/
private
function
getFeeType
(
$key
)
{
$type_array
=
[
0
=>
'办公室成本'
,
1
=>
'总部成本'
,
2
=>
'分部成本'
,
3
=>
'门店独有成本'
,
];
if
(
array_key_exists
(
$key
,
$type_array
))
{
$result
=
$type_array
[
$key
];
}
else
{
$result
=
'未知'
;
}
return
$result
;
}
}
\ No newline at end of file
application/index/service/CostService.php
View file @
8c15ad8a
...
...
@@ -77,4 +77,65 @@ class CostService
return
$result
;
}
/**
* 获取费用项目
*
* @param $key
* @return string
*/
public
function
getFeeItem
(
$key
)
{
$item_array
=
[
100
=>
'房租租金'
,
101
=>
'水电费'
,
102
=>
'其他费用'
,
201
=>
'总部固定成本'
,
301
=>
'分部固定成本'
,
401
=>
'同联发展基金'
,
501
=>
'家庭基金报销'
,
502
=>
'社保报销'
,
503
=>
'总经理基薪'
,
504
=>
'区域秘书基薪'
,
505
=>
'招聘成本'
,
506
=>
'区域经理基本工资平摊'
,
507
=>
'宿舍成本'
,
508
=>
'宿舍亏损'
,
509
=>
'手续费'
,
510
=>
'员工工资成本'
,
511
=>
'网络报销'
,
512
=>
'离职员工网络'
,
513
=>
'门店独有成本其他费用'
];
if
(
array_key_exists
(
$key
,
$item_array
))
{
$result
=
$item_array
[
$key
];
}
else
{
$result
=
'未知'
;
}
return
$result
;
}
/**
* 获取费用报销类型
*
* @param $key
* @return string
*/
public
function
getFeeType
(
$key
)
{
$type_array
=
[
1
=>
'办公室成本'
,
2
=>
'总部成本'
,
3
=>
'分部成本'
,
4
=>
'门店独有成本'
,
];
if
(
array_key_exists
(
$key
,
$type_array
))
{
$result
=
$type_array
[
$key
];
}
else
{
$result
=
'未知'
;
}
return
$result
;
}
}
\ No newline at end of file
application/model/FApplyForFeeCheck.php
View file @
8c15ad8a
...
...
@@ -86,4 +86,15 @@ class FApplyForFeeCheck extends BaseModel
->
select
();
return
$result
;
}
public
function
findByAll
(
$field
,
$params
)
{
$params
[
'is_del'
]
=
0
;
$result
=
$this
->
db_
->
alias
(
'a'
)
->
field
(
$field
)
->
join
(
'a_agents b'
,
'a.agent_id = b.id'
,
'left'
)
->
where
(
$params
)
->
select
();
return
$result
;
}
}
application/model/FImg.php
View file @
8c15ad8a
...
...
@@ -89,4 +89,19 @@ class FImg extends BaseModel
->
find
();
return
$result
;
}
/**
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
findByAll
(
$field
,
$params
)
{
$params
[
'img_status'
]
=
0
;
$result
=
$this
->
db_
->
field
(
$field
)
->
where
(
$params
)
->
select
();
return
$result
;
}
}
application/route.php
View file @
8c15ad8a
...
...
@@ -985,13 +985,14 @@ Route::group('broker', [
'getDistrictLable'
=>
[
'api_broker/Square/getDistrictLable'
,
[
'method'
=>
'GET|POST'
]],
'delSquare'
=>
[
'api_broker/Square/delSquare'
,
[
'method'
=>
'GET|POST'
]],
'getSquareSortList'
=>
[
'api_broker/Square/getSquareSortList'
,
[
'method'
=>
'GET|POST'
]],
'getAgentDistrictId'
=>
[
'api_broker/Broker/getAgentDistrictId'
,
[
'method'
=>
'GET|POST'
]],
'getOpenList'
=>
[
'api_broker/PayLogOpen/getOpenList'
,
[
'method'
=>
'GET|POST'
]],
'openCheck'
=>
[
'api_broker/PayLogOpen/openCheck'
,
[
'method'
=>
'GET|POST'
]],
'costListStore'
=>
[
'api_broker/ApplyForCost/costList'
,
[
'method'
=>
'GET'
]],
//费用申请列表-门店列表-未审核
'costListDistrict'
=>
[
'api_broker/ApplyForCost/costList'
,
[
'method'
=>
'GET'
]],
//费用申请列表-部门列表
'costListOne'
=>
[
'api_broker/ApplyForCost/costList'
,
[
'method'
=>
'GET'
]],
//费用申请列表-财务一审
'costListTwo'
=>
[
'api_broker/ApplyForCost/costList'
,
[
'method'
=>
'GET'
]],
//费用申请列表-财务二审
'costListThree'
=>
[
'api_broker/ApplyForCost/costList'
,
[
'method'
=>
'GET'
]],
//费用申请列表-财务三审
'moveHouseAgent'
=>
[
'api_broker/User/moveHouseAgent'
,
[
'method'
=>
'GET|POST'
]],
//客方同步到新表
'moveHouseSiteId'
=>
[
'api_broker/User/moveHouseSiteId'
,
[
'method'
=>
'GET|POST'
]],
//站点同步到新表
'getFindShopListIsMy'
=>
[
'api_broker/FindShop/getFindShopList'
,
[
'method'
=>
'GET'
]],
//委托找铺
...
...
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