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
adb514d3
Commit
adb514d3
authored
Sep 02, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
方法优化
parent
83edc8ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
17 deletions
+24
-17
Finance.php
application/index/controller/Finance.php
+23
-15
AStore.php
application/model/AStore.php
+1
-2
No files found.
application/index/controller/Finance.php
View file @
adb514d3
...
...
@@ -1059,20 +1059,32 @@ class Finance extends Basic
$fields
.=
'd.income_time,a.type,c.store_id'
;
$list
=
$refund
->
getCheckRefundList
(
$pageNo
,
$pageSize
,
'a.id DESC'
,
$fields
,
$where
);
foreach
(
$list
as
$k
=>
$v
)
{
if
(
empty
(
$v
[
'house_id'
]))
{
$list
[
$k
][
'address'
]
=
''
;
}
else
{
$list
[
$k
][
'address'
]
=
$m_house
->
getHouseValue
(
'internal_address'
,
[
'id'
=>
$v
[
'house_id'
]]);
}
$store_id
[]
=
$v
[
'store_id'
];
$house_id
[]
=
$v
[
'house_id'
];
}
if
(
empty
(
$v
[
'store_id'
]))
{
$list
[
$k
][
'store_name'
]
=
''
;
}
else
{
$list
[
$k
][
'store_name'
]
=
$m_store
->
getStoreKeyById
(
'store_name'
,
[
'id'
=>
$v
[
'store_id'
]]);
}
if
(
isset
(
$store_id
))
{
$store_id
=
array_unique
(
$store_id
);
$store_id
=
array_filter
(
$store_id
);
$store_data
=
$m_store
->
getColumn
(
'id,store_name'
,
[
'id'
=>
[
'in'
,
$store_id
]]);
}
else
{
$store_data
=
[];
}
if
(
isset
(
$house_id
))
{
$house_id
=
array_unique
(
$house_id
);
$house_id
=
array_filter
(
$house_id
);
$house_data
=
$m_house
->
getHouseColumn
(
'id,internal_address'
,
[
'id'
=>
[
'in'
,
$house_id
]]);
}
else
{
$house_data
=
[];
}
foreach
(
$list
as
$k2
=>
$v2
)
{
$list
[
$k2
][
'store_name'
]
=
array_key_exists
(
$v2
[
'store_id'
],
$store_data
)
?
$store_data
[
$v2
[
'store_id'
]]
:
''
;
$list
[
$k2
][
'address'
]
=
array_key_exists
(
$v2
[
'house_id'
],
$house_data
)
?
$house_data
[
$v2
[
'house_id'
]]
:
''
;
}
$data
[
'data'
][
'list'
]
=
$list
;
$data
[
'data'
][
'total_money'
]
=
$refund
->
getSumMoney
(
$where
);
$data
[
'data'
][
'total'
]
=
$refund
->
getCheckRefundListTotal
(
$where
);
...
...
@@ -1091,10 +1103,6 @@ class Finance extends Basic
$data
[
'code'
]
=
200
;
$data
[
'msg'
]
=
""
;
$data
[
'data'
]
=
[];
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
15
:
$this
->
params
[
'pageSize'
];
$refund
=
new
ORefundModel
();
$m_house
=
new
GHouses
();
$m_store
=
new
AStore
();
...
...
application/model/AStore.php
View file @
adb514d3
...
...
@@ -500,8 +500,7 @@ class AStore extends BaseModel
*/
public
function
getColumn
(
$field
,
$where
)
{
$where
[
'status'
]
=
0
;
return
$this
->
where
(
$where
)
return
Db
::
table
(
$this
->
table
)
->
where
(
$where
)
->
column
(
$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