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
734dfb9b
Commit
734dfb9b
authored
Dec 19, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
32f0cd79
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
5 deletions
+68
-5
DailyPaperService.php
application/api_broker/service/DailyPaperService.php
+52
-5
GHousesToAgents.php
application/model/GHousesToAgents.php
+16
-0
No files found.
application/api_broker/service/DailyPaperService.php
View file @
734dfb9b
...
...
@@ -6,6 +6,7 @@ use app\api_broker\controller\Agent;
use
app\api_broker\service\VerifyService
;
use
app\model\AAgents
;
use
app\model\GHouses
;
use
app\model\GHousesToAgents
;
use
app\model\ODaily
;
use
app\model\ODailyLog
;
use
app\model\OImg
;
...
...
@@ -245,9 +246,12 @@ class DailyPaperService
);
//案场费入账 盘方
$params
[
"a.type"
]
=
92
;
$info
[
"case_fee"
]
=
$this
->
getHouseAndAgentInfo
(
$payLogModel
->
selectPayLogListByBargain
(
$field
,
$params
)
);
$case_fee_arr
=
$payLogModel
->
selectPayLogListByBargain
(
$field
,
$params
);
$case_fee_arr
=
$this
->
getHousePan
(
$case_fee_arr
);
$info
[
"case_fee"
]
=
$this
->
getHouseAndAgentInfo
(
$case_fee_arr
);
$field_money
=
"a.id,a.money,b.house_id,b.id as order_id,a.pay_type,a.transfer_name, d.report_agent_id as agent_id,
a.is_dividend,a.receipt_number,a.create_time"
;
...
...
@@ -273,7 +277,36 @@ class DailyPaperService
return
$info
;
}
/**
* 获取盘方
* @param $data
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
private
function
getHousePan
(
$data
)
{
$house_id_str
=
""
;
if
(
count
(
$data
)
>
0
)
{
foreach
(
$data
as
$k
=>
$v
)
{
$house_id_str
.=
$v
[
"house_id"
]
.
","
;
}
$house_id_str
=
rtrim
(
$house_id_str
,
","
);
$agent_arr
=
$this
->
housePanInfo
(
$house_id_str
);
foreach
(
$data
as
$k
=>
$v
)
{
foreach
(
$agent_arr
as
$item
)
{
if
(
$v
[
"house_id"
]
==
$item
[
"houses_id"
])
{
$data
[
$k
][
"agent_id"
]
=
$item
[
"agents_id"
];
}
}
}
}
return
$data
;
}
/**
* @param $data
* @return mixed
...
...
@@ -289,7 +322,6 @@ class DailyPaperService
foreach
(
$data
as
$k
=>
$v
)
{
$agent_id_str
.=
$v
[
"agent_id"
]
.
","
;
$house_id_str
.=
$v
[
"house_id"
]
.
","
;
}
$agent_id_str
=
rtrim
(
$agent_id_str
,
","
);
$house_id_str
=
rtrim
(
$house_id_str
,
","
);
...
...
@@ -312,7 +344,6 @@ class DailyPaperService
$data
[
$k
][
"house_address"
]
=
$item
[
"internal_address"
];
}
}
}
}
return
$data
;
...
...
@@ -346,6 +377,22 @@ class DailyPaperService
return
$houseModel
->
getHouseInfo
(
"id,internal_address"
,
$params
);
}
/**
* 获取盘方
* @param $house_id_str
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
private
function
housePanInfo
(
$house_id_str
)
{
$gModel
=
new
GHousesToAgents
();
$params
[
"houses_id"
]
=
array
(
"in"
,
(
$house_id_str
));
$params
[
"type"
]
=
2
;
return
$gModel
->
getAgentsList
(
"houses_id,agents_id"
,
$params
);
}
/**
* 根据门店id获取此门店的经纪人id string
* @param $store_id
...
...
application/model/GHousesToAgents.php
View file @
734dfb9b
...
...
@@ -432,6 +432,22 @@ class GHousesToAgents extends BaseModel
->
column
(
$field
);
}
/**
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentsList
(
$field
,
$where
)
{
return
$this
->
field
(
$field
)
->
where
(
$where
)
->
select
(
$field
);
}
/**
* @param $field
* @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