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
3cbf2b8d
Commit
3cbf2b8d
authored
Jul 23, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
办公室名
parent
c76c05c7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
145 additions
and
4 deletions
+145
-4
ApplyForCost.php
application/api_broker/controller/ApplyForCost.php
+2
-1
Cost.php
application/index/controller/Cost.php
+63
-0
HouseService.php
application/index/service/HouseService.php
+3
-3
AStore.php
application/model/AStore.php
+18
-0
FStoreCost.php
application/model/FStoreCost.php
+58
-0
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/ApplyForCost.php
View file @
3cbf2b8d
...
...
@@ -104,7 +104,8 @@ class ApplyForCost extends Basic
$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'
]
=
ROOT_PATH
.
'public/static/chat_image/'
;
$list
[
$k
][
'image_base_url'
]
=
'static/chat_image/'
;
$list
[
$k
][
'return_type'
]
=
$this
->
params
[
'type'
];
}
return
$this
->
response
(
200
,
''
,
$list
);
}
...
...
application/index/controller/Cost.php
View file @
3cbf2b8d
...
...
@@ -12,8 +12,11 @@ namespace app\index\controller;
use
app\index\extend\Basic
;
use
app\index\service\CostService
;
use
app\index\untils\ExportExcelUntil
;
use
app\model\AStore
;
use
app\model\FApplyForFee
;
use
app\model\FApplyForFeeCheck
;
use
app\model\FImg
;
use
app\model\FStoreCost
;
class
Cost
extends
Basic
{
...
...
@@ -242,5 +245,64 @@ class Cost extends Basic
return
$this
->
response
(
$code
,
$result
[
'msg'
]);
}
/**
* 费用报销详情
*
* @return \think\Response
*/
public
function
getDetailCost
()
{
$code
=
101
;
if
(
empty
(
$this
->
params
[
'id'
]))
{
return
$this
->
response
(
$code
,
'参数错误!'
);
}
$fee_model
=
new
FApplyForFee
();
$m_store
=
new
AStore
();
$m_store_cost
=
new
FStoreCost
();
$m_check
=
new
FApplyForFeeCheck
();
$m_img
=
new
FImg
();
$field
=
'id,count_time,source,type,create_time,agent_id,total_fee,fee_item,purpose,status,site_id,status,bank,'
;
$field
.=
'card_no,card_name,store_id'
;
$where
[
'id'
]
=
$this
->
params
[
'id'
];
$data
=
$fee_model
->
findByOne
(
$field
,
$where
);
$office_id
=
$m_store
->
getFieldOneValue
(
'office_id'
,
[
'id'
=>
$data
[
'store_id'
]]);
if
(
$office_id
)
{
$store_field
=
'a.id,a.store_name'
;
$office_store
=
$m_store
->
getStoreCostAll
(
$store_field
,
[
'a.office_id'
=>
$office_id
,
'a.status'
=>
0
]);
$list
=
[];
$cost_ext_field
=
'a.id,b.store_attendance_num,b.assume_fee'
;
$cost_ext_where
[
'setting_date'
]
=
$data
[
'count_time'
];
foreach
(
$office_store
as
$k
=>
$v
)
{
$cost_ext_where
[
'store_id'
]
=
$v
[
'id'
];
$store_cost_data
=
$m_store_cost
->
getCostExt
(
$cost_ext_field
,
$cost_ext_where
);
if
(
empty
(
$store_cost_data
))
{
$list
[
$k
]
=
[
'id'
=>
0
,
'store_name'
=>
$v
[
'store_name'
],
'store_attendance_num'
=>
0
,
'assume_fee'
=>
0
];
}
else
{
$list
[
$k
]
=
[
'id'
=>
$store_cost_data
[
'id'
],
'store_name'
=>
$v
[
'store_name'
],
'store_attendance_num'
=>
$store_cost_data
[
'store_attendance_num'
],
'assume_fee'
=>
$store_cost_data
[
'assume_fee'
]
];
}
}
$check_field
=
'b.name,a.create_time,a.remark'
;
$data
[
'check_log'
]
=
$m_check
->
findByAll
(
$check_field
,
[
'apply_for_id'
=>
$data
[
'id'
]]);
$data
[
'images_data'
]
=
$m_img
->
findByAll
(
'id,img_name,img_type'
,
[
'img_id'
=>
$data
[
'id'
]]);
$data
[
'store_cost_data'
]
=
$list
;
$data
[
'image_base_url'
]
=
'static/chat_image/'
;
}
return
$this
->
response
(
200
,
''
,
$data
);
}
}
\ No newline at end of file
application/index/service/HouseService.php
View file @
3cbf2b8d
...
...
@@ -1078,13 +1078,13 @@ class HouseService
/**
* @param $house_id
* @param $video_name
* @param $video_im
g
age
* @param $video_image
* @param $upload_id
* @param $upload_name
* @param $upload_phone
* @return mixed
*/
public
function
addVideo
(
$house_id
,
$video_name
,
$video_im
g
age
,
$upload_id
,
$upload_name
,
$upload_phone
)
public
function
addVideo
(
$house_id
,
$video_name
,
$video_image
,
$upload_id
,
$upload_name
,
$upload_phone
)
{
$result
[
'status'
]
=
'fail'
;
...
...
@@ -1108,7 +1108,7 @@ class HouseService
}
$data
[
'video_name'
]
=
$video_name
;
$data
[
'video_image'
]
=
$video_im
g
age
;
$data
[
'video_image'
]
=
$video_image
;
$data
[
'upload_id'
]
=
$upload_id
;
$data
[
'upload_name'
]
=
$upload_name
;
$data
[
'upload_phone'
]
=
$upload_phone
;
...
...
application/model/AStore.php
View file @
3cbf2b8d
...
...
@@ -421,4 +421,21 @@ class AStore extends BaseModel
->
find
();
return
$result
;
}
/**
* @param $field
* @param $params
* @return array|false|\PDOStatement|string|\think\Model
*/
public
function
getStoreCostAll
(
$field
,
$params
)
{
$params
[
"a.status"
]
=
0
;
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'f_office b'
,
'a.office_id = b.id'
,
'left'
)
->
where
(
$params
)
->
select
();
return
$result
;
}
}
\ No newline at end of file
application/model/FStoreCost.php
0 → 100644
View file @
3cbf2b8d
<?php
namespace
app\model
;
use
think\Db
;
use
think\Model
;
class
FStoreCost
extends
BaseModel
{
protected
$table
=
'f_store_cost'
;
private
$db_
;
public
function
__construct
(
$data
=
[])
{
parent
::
__construct
(
$data
);
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
/**
* 新增数据
* @param $data
* @return mixed
*/
public
function
saveOffice
(
$data
)
{
$time
=
date
(
"Y-m-d H:i:s"
,
time
());
$data
[
"is_del"
]
=
0
;
$data
[
'create_time'
]
=
$time
;
$data
[
'update_time'
]
=
$time
;
return
$this
->
db_
->
insert
(
$data
);
}
/**
* 查询单条数据
*/
public
function
findByOne
(
$field
,
$params
)
{
$result
=
$this
->
db_
->
field
(
$field
)
->
where
(
$params
)
->
find
();
return
$result
;
}
/**
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getCostExt
(
$field
,
$where
)
{
$where
[
'status'
]
=
0
;
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'f_store_cost_ext b'
,
'a.id=b.cost_id'
,
'left'
)
->
where
(
$where
)
->
select
();
}
}
application/route.php
View file @
3cbf2b8d
...
...
@@ -537,6 +537,7 @@ Route::group('index', [
'checkCostThree/:check_status'
=>
[
'index/Cost/checkCost'
,
[
'method'
=>
'POST'
],
[
'check_status'
=>
2
]],
//费用报销审核一审
'checkCostFour/:check_status'
=>
[
'index/Cost/checkCost'
,
[
'method'
=>
'POST'
],
[
'check_status'
=>
3
]],
//费用报销审核二审
'checkCostFive/:check_status'
=>
[
'index/Cost/checkCost'
,
[
'method'
=>
'POST'
],
[
'check_status'
=>
4
]],
//费用报销审核三审
'getDetailCost'
=>
[
'index/Cost/getDetailCost'
,
[
'method'
=>
'GET'
]],
//费用报销详情
'delStoreFeeImage'
=>
[
'index/StoreFee/delStoreFeeImage'
,
[
'method'
=>
'POST'
]],
//删除图片
'getCostDetailList'
=>
[
'index/CostDetail/getCostDetailList'
,
[
'method'
=>
'POST|GET'
]],
'getCostDetailListExcel'
=>
[
'index/CostDetail/getCostDetailListExcel'
,
[
'method'
=>
'POST|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