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
4b48ffb2
Commit
4b48ffb2
authored
Jul 24, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-1 month
parent
77966bfa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
4 deletions
+34
-4
Cost.php
application/index/controller/Cost.php
+11
-4
AStore.php
application/model/AStore.php
+13
-0
FStoreData.php
application/model/FStoreData.php
+10
-0
No files found.
application/index/controller/Cost.php
View file @
4b48ffb2
...
...
@@ -20,6 +20,7 @@ use app\model\FImg;
use
app\model\FSettingLog
;
use
app\model\FStoreCost
;
use
app\model\FStoreCostExt
;
use
app\model\FStoreData
;
class
Cost
extends
Basic
{
...
...
@@ -281,6 +282,8 @@ class Cost extends Basic
$m_check
=
new
FApplyForFeeCheck
();
$m_img
=
new
FImg
();
$redis
=
new
RedisCacheService
();
$m_store
=
new
AStore
();
$m_store_fee
=
new
FStoreData
();
$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,office_id'
;
...
...
@@ -321,10 +324,14 @@ class Cost extends Basic
}
if
(
$data
[
'office_id'
])
{
$ext_where
[
'b.type'
]
=
1
;
$ext_where
[
'c.office_id'
]
=
$data
[
'office_id'
];
$ext_where
[
'a.setting_date'
]
=
$data
[
'count_time'
];
$data
[
'office_attendance_num'
]
=
$m_store_cost
->
getFeeOfficeCostSum
(
'b.office_attendance_num'
,
$ext_where
);
$store_id_arr
=
$m_store
->
getColumn
(
'id'
,
[
'office_id'
=>
$data
[
'office_id'
]]);
$store_fee_where
[
'store_id'
]
=
[
'in'
,
$store_id_arr
];
$store_fee_where
[
'setting_date'
]
=
date
(
'Y-m-d'
,
strtotime
(
$data
[
'count_time'
]));
$data
[
'office_attendance_num'
]
=
$m_store_fee
->
getSumField
(
'attendance_num'
,
$store_fee_where
);
if
(
empty
(
$data
))
{
$store_fee_where
[
'setting_date'
]
=
date
(
'Y-m-d'
,
strtotime
(
'-1 month'
,
strtotime
(
$data
[
'count_time'
])));
$data
[
'office_attendance_num'
]
=
$m_store_fee
->
getSumField
(
'attendance_num'
,
$store_fee_where
);
}
}
break
;
case
2
:
...
...
application/model/AStore.php
View file @
4b48ffb2
...
...
@@ -452,4 +452,16 @@ class AStore extends BaseModel
->
select
();
return
$result
;
}
/**
* @param $field
* @param $where
* @return array
*/
public
function
getColumn
(
$field
,
$where
)
{
$where
[
'status'
]
=
0
;
return
$this
->
where
(
$where
)
->
column
(
$field
);
}
}
\ No newline at end of file
application/model/FStoreData.php
View file @
4b48ffb2
...
...
@@ -116,4 +116,14 @@ class FStoreData extends BaseModel
->
where
(
$where_
)
->
select
();
}
/**
* @param $field
* @param $where
* @return float|int
*/
public
function
getSumField
(
$field
,
$where
)
{
return
$this
->
where
(
$where
)
->
sum
(
$field
);
}
}
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