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
f4be07e6
Commit
f4be07e6
authored
Jul 23, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
费用报销详情
parent
b05eaf7e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
8 deletions
+28
-8
Cost.php
application/index/controller/Cost.php
+14
-8
FStoreCost.php
application/model/FStoreCost.php
+14
-0
No files found.
application/index/controller/Cost.php
View file @
f4be07e6
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
namespace
app\index\controller
;
namespace
app\index\controller
;
use
app\api_broker\service\RedisCacheService
;
use
app\index\extend\Basic
;
use
app\index\extend\Basic
;
use
app\index\service\CostService
;
use
app\index\service\CostService
;
use
app\index\untils\ExportExcelUntil
;
use
app\index\untils\ExportExcelUntil
;
...
@@ -279,23 +280,24 @@ class Cost extends Basic
...
@@ -279,23 +280,24 @@ class Cost extends Basic
foreach
(
$office_store
as
$k
=>
$v
)
{
foreach
(
$office_store
as
$k
=>
$v
)
{
$cost_ext_where
[
'store_id'
]
=
$v
[
'id'
];
$cost_ext_where
[
'store_id'
]
=
$v
[
'id'
];
$store_cost_data
=
$m_store_cost
->
getCostExt
(
$cost_ext_field
,
$cost_ext_where
);
$store_cost_data
=
$m_store_cost
->
getCostExt
(
$cost_ext_field
,
$cost_ext_where
);
if
(
empty
(
$store_cost_data
))
{
if
(
!
empty
(
$store_cost_data
))
{
$list
[
$k
]
=
[
'id'
=>
0
,
'store_name'
=>
$v
[
'store_name'
],
'store_attendance_num'
=>
0
,
'assume_fee'
=>
0
];
}
else
{
$list
[
$k
]
=
[
$list
[
$k
]
=
[
'id'
=>
$store_cost_data
[
'id'
],
'id'
=>
$store_cost_data
[
'id'
],
'store_name'
=>
$v
[
'store_name'
],
'store_name'
=>
$v
[
'store_name'
],
'store_attendance_num'
=>
$store_cost_data
[
'store_attendance_num'
],
'store_attendance_num'
=>
$store_cost_data
[
'store_attendance_num'
],
'assume_fee'
=>
$store_cost_data
[
'assume_fee'
]
'assume_fee'
=>
$store_cost_data
[
'assume_fee'
]
];
];
$store_cost_id
[]
=
$store_cost_data
[
'id'
];
}
}
}
}
if
(
isset
(
$store_cost_id
))
{
$data
[
'office_attendance_num'
]
=
$m_store_cost
->
sumData
(
'office_attendance_num'
,
[
'id'
=>
[
'in'
=>
$store_cost_id
]]);
}
else
{
$data
[
'office_attendance_num'
]
=
0
;
}
$check_field
=
'b.name,a.create_time,a.remark'
;
$check_field
=
'b.name,a.create_time,a.remark'
;
$data
[
'check_log'
]
=
$m_check
->
findByAll
(
$check_field
,
[
'apply_for_id'
=>
$data
[
'id'
]]);
$data
[
'check_log'
]
=
$m_check
->
findByAll
(
$check_field
,
[
'apply_for_id'
=>
$data
[
'id'
]]);
...
@@ -303,6 +305,10 @@ class Cost extends Basic
...
@@ -303,6 +305,10 @@ class Cost extends Basic
$data
[
'store_cost_data'
]
=
$list
;
$data
[
'store_cost_data'
]
=
$list
;
$data
[
'image_base_url'
]
=
'static/chat_image/'
;
$data
[
'image_base_url'
]
=
'static/chat_image/'
;
$redis
=
new
RedisCacheService
();
$agent_data
=
$redis
->
getRedisCache
(
2
,
$data
[
'id'
]);
$data
[
'agent_name'
]
=
$agent_data
[
'name'
];
$source
=
[
$source
=
[
0
=>
'app申请'
,
0
=>
'app申请'
,
1
=>
'excel导入'
1
=>
'excel导入'
...
...
application/model/FStoreCost.php
View file @
f4be07e6
...
@@ -41,6 +41,20 @@ class FStoreCost extends BaseModel
...
@@ -41,6 +41,20 @@ class FStoreCost extends BaseModel
return
$result
;
return
$result
;
}
}
/**
* 查询单条数据
*/
/**
* @param $field
* @param $params
* @return float|int
*/
public
function
sumData
(
$field
,
$params
)
{
return
$this
->
db_
->
where
(
$params
)
->
sum
(
$field
);
}
/**
/**
* @param $field
* @param $field
* @param $where
* @param $where
...
...
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