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
6db6a93a
Commit
6db6a93a
authored
Jul 25, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11
parent
c493ae49
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
31 deletions
+45
-31
StoreFeeService.php
application/api_broker/service/StoreFeeService.php
+5
-4
FApplyForFee.php
application/model/FApplyForFee.php
+40
-27
No files found.
application/api_broker/service/StoreFeeService.php
View file @
6db6a93a
...
@@ -489,12 +489,13 @@ class StoreFeeService
...
@@ -489,12 +489,13 @@ class StoreFeeService
{
{
$applyForFeeModel
=
new
FApplyForFee
();
$applyForFeeModel
=
new
FApplyForFee
();
$field
=
"a.id,a.type,a.fee_item,a.purpose,a.total_fee,a.office_id,a.agent_id,a.store_id,a.assume_fee,
$field
=
"a.id,a.type,a.fee_item,a.purpose,a.total_fee,a.office_id,a.agent_id,a.store_id,a.assume_fee,
a.status,a.count_time,a.
site_id,a.
create_time,b.id as old_store_id,b.office_id as old_office_id,b.site_id"
;
a.status,a.count_time,a.create_time,b.id as old_store_id,b.office_id as old_office_id,b.site_id"
;
$params
[
"b.id"
]
=
$store_id
;
/*
$params["b.id"] = $store_id;
$params["a.count_time"] = $setting_date;
$params["a.count_time"] = $setting_date;
$params["a.is_del"] = 0;
$params["a.is_del"] = 0;
$params
[
"a.status"
]
=
4
;
$params["a.status"] = 4;*/
return
$applyForFeeModel
->
getApplyForFeeList
(
$field
,
$params
);
$condition
=
"b.id ="
.
$store_id
.
" and a.count_time='"
.
$setting_date
.
"' and a.is_del = 0 and a.status = 4"
;
return
$applyForFeeModel
->
getApplyForFeeList
(
$field
,
$condition
);
}
}
/**
/**
...
...
application/model/FApplyForFee.php
View file @
6db6a93a
...
@@ -22,7 +22,8 @@ class FApplyForFee extends BaseModel
...
@@ -22,7 +22,8 @@ class FApplyForFee extends BaseModel
* @throws \think\Exception
* @throws \think\Exception
* @throws \think\exception\PDOException
* @throws \think\exception\PDOException
*/
*/
public
function
saveData
(
$data
)
{
public
function
saveData
(
$data
)
{
$id
=
$this
->
db_
->
insertGetId
(
$data
);
$id
=
$this
->
db_
->
insertGetId
(
$data
);
return
$id
;
return
$id
;
}
}
...
@@ -42,7 +43,8 @@ class FApplyForFee extends BaseModel
...
@@ -42,7 +43,8 @@ class FApplyForFee extends BaseModel
/**
/**
* 查询单条数据
* 查询单条数据
*/
*/
public
function
findByOne
(
$field
,
$params
)
{
public
function
findByOne
(
$field
,
$params
)
{
$result
=
$this
->
db_
$result
=
$this
->
db_
->
field
(
$field
)
->
field
(
$field
)
->
where
(
$params
)
->
where
(
$params
)
...
@@ -59,9 +61,10 @@ class FApplyForFee extends BaseModel
...
@@ -59,9 +61,10 @@ class FApplyForFee extends BaseModel
* @param string $params
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @return false|\PDOStatement|string|\think\Collection
*/
*/
public
function
getJoinAgentList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'a.id desc'
,
$field
=
''
,
$params
=
''
)
{
public
function
getJoinAgentList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'a.id desc'
,
$field
=
''
,
$params
=
''
)
{
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.agent_id=b.id'
,
'left'
)
->
join
(
'a_agents b'
,
'a.agent_id=b.id'
,
'left'
)
->
where
(
$params
)
->
where
(
$params
)
->
order
(
$order_
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
limit
(
$pageSize
)
...
@@ -73,37 +76,47 @@ class FApplyForFee extends BaseModel
...
@@ -73,37 +76,47 @@ class FApplyForFee extends BaseModel
* @param string $params
* @param string $params
* @return int|string
* @return int|string
*/
*/
public
function
getJoinAgentListTotal
(
$params
=
''
)
{
public
function
getJoinAgentListTotal
(
$params
=
''
)
{
return
$this
->
alias
(
'a'
)
return
$this
->
alias
(
'a'
)
->
join
(
'a_agents b'
,
'a.agent_id=b.id'
,
'left'
)
->
join
(
'a_agents b'
,
'a.agent_id=b.id'
,
'left'
)
->
where
(
$params
)
->
where
(
$params
)
->
count
(
'a.id'
);
->
count
(
'a.id'
);
}
}
/**
/**
* @param $field
* @param $field
* @param $params
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
getApplyForFeeList
(
$field
,
$params
){
public
function
getApplyForFeeList
(
$field
,
$params
)
$result1
=
$this
->
db_
{
->
field
(
$field
)
$sql
=
"SELECT * FROM
->
alias
(
"a"
)
(
->
join
(
"f_office c"
,
"a.office_id = c.id"
,
"left"
)
(
->
join
(
"a_store b"
,
"b.office_id = c.id"
,
"left"
)
SELECT
->
where
(
$params
)
$field
->
select
();
FROM
`f_apply_for_fee` `a`
$result2
=
$this
->
db_
LEFT JOIN `f_office` `c` ON `a`.`office_id` = `c`.`id`
->
field
(
$field
)
LEFT JOIN `a_store` `b` ON `b`.`office_id` = `c`.`id`
->
alias
(
"a"
)
WHERE
->
join
(
"f_apply_for_fee b"
,
"a.store_id = b.id"
,
"left"
)
$params
->
select
();
)
array_merge
(
$result1
,
$result2
);
UNION
//echo $this->db_->getLastSql();
(
return
$result1
;
SELECT
$field
FROM
`f_apply_for_fee` `a`
LEFT JOIN `a_store` `b` ON `a`.`store_id` = `b`.`id`
WHERE
$params
)
) AS aaa group by aaa.id "
;
$result
=
$this
->
db_
->
query
(
$sql
);
return
$result
;
}
}
/**
/**
...
@@ -115,7 +128,7 @@ class FApplyForFee extends BaseModel
...
@@ -115,7 +128,7 @@ class FApplyForFee extends BaseModel
{
{
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'f_store_cost_ext b'
,
'a.id = b.apply_for_id'
,
'left'
)
->
join
(
'f_store_cost_ext b'
,
'a.id = b.apply_for_id'
,
'left'
)
->
join
(
'a_store c'
,
'a.store_id=c.id'
,
'left'
)
->
join
(
'a_store c'
,
'a.store_id=c.id'
,
'left'
)
->
where
(
$where
)
->
where
(
$where
)
->
select
();
->
select
();
}
}
...
...
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