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
c1a3273d
Commit
c1a3273d
authored
Jul 08, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
财务日报列表
parent
6d2bd075
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
9 deletions
+80
-9
Finance.php
application/index/controller/Finance.php
+11
-6
ODaily.php
application/model/ODaily.php
+69
-3
No files found.
application/index/controller/Finance.php
View file @
c1a3273d
...
...
@@ -4270,25 +4270,30 @@ class Finance extends Basic
$where
[
'a.site_id'
]
=
$this
->
params
[
'site_id'
];
}
$m_daily
=
new
ODaily
();
$m_store
=
new
AStore
();
$field
=
'a.id,a.agent_id,a.create_time,a.daily_date,a.store_id,a.status,a.agent_name,a.back_img'
;
if
(
isset
(
$this
->
params
[
'is_self'
])
&&
$this
->
params
[
'is_self'
]
!=
-
1
)
{
if
(
$this
->
params
[
'is_self'
])
{
$where
[
'b.operation_id'
]
=
$this
->
userId
;
$list
=
$m_daily
->
getDailyLogListRight
(
$pageNo
,
$pageSize
,
'a.id desc'
,
$field
,
$where
);
$data
[
'total'
]
=
$m_daily
->
getDailyLogTotalRight
(
$where
);
}
else
{
$where
[]
=
[
'EXP'
,
'a.id NOT IN (SELECT daily_id FROM o_daily_log WHERE operation_id ='
.
$this
->
userId
.
')'
];
$where
[
'b.operation_id'
]
=
[
'NULL'
];
$list
=
$m_daily
->
getDailyLogListLeft
(
$pageNo
,
$pageSize
,
'id desc'
,
$field
,
$where
);
$data
[
'total'
]
=
$m_daily
->
getDailyLogTotalLeft
(
$where
);
}
}
else
{
$list
=
$m_daily
->
getDailyPageList
(
$pageNo
,
$pageSize
,
'id desc'
,
$field
,
$where
);
$data
[
'total'
]
=
$m_daily
->
getDailyTotal
(
$where
);
}
$m_daily
=
new
ODaily
();
$m_store
=
new
AStore
();
$field
=
'a.id,a.agent_id,a.create_time,a.daily_date,a.store_id,a.status,a.agent_name,a.back_img'
;
$list
=
$m_daily
->
getDailyLogList
(
$pageNo
,
$pageSize
,
'id desc'
,
$field
,
$where
);
foreach
(
$list
as
$k
=>
$v
)
{
$store_name
=
$m_store
->
getStoreKeyById
(
'store_name'
,
[
'id'
=>
$v
[
'store_id'
]]);
$list
[
$k
][
'store_name'
]
=
empty
(
$store_name
)
?
''
:
$store_name
;
}
$data
[
'list'
]
=
$list
;
$data
[
'total'
]
=
$m_daily
->
getDailyLogTotal
(
$where
);
return
$this
->
response
(
200
,
''
,
$data
);
}
...
...
application/model/ODaily.php
View file @
c1a3273d
...
...
@@ -104,7 +104,30 @@ class ODaily extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getDailyLogList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
public
function
getDailyLogListRight
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
return
$this
->
alias
(
'a'
)
->
field
(
$field
)
->
join
(
'o_daily_log b'
,
'a.id=b.daily_id'
,
'right'
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
group
(
'a.id'
)
->
page
(
$pageNo
)
->
select
();
}
/**
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getDailyLogListLeft
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
return
$this
->
alias
(
'a'
)
->
field
(
$field
)
->
join
(
'o_daily_log b'
,
'a.id=b.daily_id'
,
'left'
)
...
...
@@ -116,18 +139,61 @@ class ODaily extends BaseModel
->
select
();
}
/**
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getDailyPageList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
=
''
,
$params
=
''
)
{
return
$this
->
alias
(
'a'
)
->
field
(
$field
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
/**
* @param $params
* @return int|string
*/
public
function
getDailyLogTotal
(
$params
)
{
public
function
getDailyLogTotal
Right
(
$params
)
{
return
$this
->
alias
(
'a'
)
->
join
(
'o_daily_log b'
,
'a.id=b.daily_id'
,
'left'
)
->
join
(
'o_daily_log b'
,
'a.id=b.daily_id'
,
'right'
)
->
where
(
$params
)
->
group
(
'a.id'
)
->
count
();
}
/**
* @param $params
* @return int|string
*/
public
function
getDailyLogTotalLeft
(
$params
)
{
return
$this
->
alias
(
'a'
)
->
join
(
'o_daily_log b'
,
'a.id=b.daily_id'
,
'right'
)
->
where
(
$params
)
->
group
(
'a.id'
)
->
count
();
}
/**
* @param $params
* @return int|string
*/
public
function
getDailyTotal
(
$params
)
{
return
$this
->
alias
(
'a'
)
->
where
(
$params
)
->
count
();
}
public
function
getFieldValue
(
$filed
,
$where
)
{
return
$this
->
where
(
$where
)
->
value
(
$filed
);
}
...
...
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