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
88e6de41
Commit
88e6de41
authored
Apr 13, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增修改楼盘
parent
34022770
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
9 deletions
+68
-9
OrderLog.php
application/api_broker/controller/OrderLog.php
+4
-1
OrderLogService.php
application/api_broker/service/OrderLogService.php
+12
-8
GHouses.php
application/model/GHouses.php
+19
-0
OBargainModel.php
application/model/OBargainModel.php
+17
-0
OrderModel.php
application/model/OrderModel.php
+16
-0
No files found.
application/api_broker/controller/OrderLog.php
View file @
88e6de41
...
...
@@ -4,6 +4,7 @@ namespace app\api_broker\controller;
use
app\api\untils\GeTuiUntils
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\HouseNumUpdateService
;
use
app\api_broker\service\OrderLogService
;
use
app\model\AAgents
;
use
app\model\Agents
;
...
...
@@ -291,7 +292,7 @@ class OrderLog extends Basic
$params
=
$this
->
params
;
/* $params = array(
"id" => 1,
"type" => 2
1
0 //20撤销 21已撤销 30已审核
"type" => 20 //20撤销 21已撤销 30已审核
);*/
if
(
!
isset
(
$params
[
"id"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
...
...
@@ -307,6 +308,8 @@ class OrderLog extends Basic
$is_ok
=
$obm
->
updateBargainById
(
$params
[
"id"
],
$save_param
);
if
(
$is_ok
>
0
)
{
$houseNumUpdateService
=
new
HouseNumUpdateService
();
$houseNumUpdateService
->
updateHouseNumByRevocationBargain
(
$params
[
"id"
]);
return
$this
->
response
(
"200"
,
"request success"
,
[
"msg"
=>
"状态修改成功"
]);
}
else
{
return
$this
->
response
(
"101"
,
"request error"
);
...
...
application/api_broker/service/OrderLogService.php
View file @
88e6de41
...
...
@@ -149,10 +149,15 @@ class OrderLogService
}
}
if
(
$father_id
>
0
)
{
//修改楼盘
$houseNumUpdateService
=
new
HouseNumUpdateService
();
$houseNumUpdateService
->
updateHouseNumByBargain
(
$order_id
);
}
//todo if bill_arr not null, save database table
if
(
!
empty
(
$bargain_arr
))
{
return
$this
->
bargainModel
->
addBargain
(
$bargain_arr
);
}
return
$father_id
;
}
...
...
@@ -704,13 +709,13 @@ class OrderLogService
$where_
[
"order_id"
]
=
$order_id
;
$result
=
$orderModel
->
selectOrderDetail
(
$field
,
$where_
);
//dump($result);
if
(
count
(
$result
)
<=
0
||
$result
[
"house_id"
]
<=
0
||
$result
[
"user_id"
]
<=
0
)
{
if
(
count
(
$result
)
<=
0
||
$result
[
"house_id"
]
<=
0
||
$result
[
"user_id"
]
<=
0
)
{
return
null
;
}
$houseAgents
=
new
GHousesToAgents
();
$field
=
"b.id,b.phone,b.name"
;
switch
(
$type
)
{
//
0盘方,1客方,2反签,3独家,4
合作方
switch
(
$type
)
{
//
1盘方,2客方,3反签,4独家,5
合作方
case
1
:
$params
[
"a.house_id"
]
=
$result
[
"house_id"
];
$params
[
"a.type"
]
=
2
;
...
...
@@ -718,17 +723,16 @@ class OrderLogService
$list
=
$houseAgents
->
getAgentsByHouseId
(
$field
,
$params
);
break
;
case
2
:
$userModel
=
new
Users
();
$userModel
=
new
Users
();
$params
[
"a.id"
]
=
$result
[
"user_id"
];
$params
[
"b.status"
]
=
0
;
$list
=
$userModel
->
getAgentByUserId
(
$field
,
$params
);
break
;
case
3
:
//反签 == 报备人
$reportModel
=
new
OReportModel
();
$params
[
"a.order_id"
]
=
$result
[
"id"
];
$params
[
"b.status"
]
=
0
;
$list
=
$reportModel
->
getAgentByOrderId
(
$field
,
$params
);
$reportModel
=
new
OReportModel
();
$params
[
"a.order_id"
]
=
$result
[
"id"
];
$params
[
"b.status"
]
=
0
;
$list
=
$reportModel
->
getAgentByOrderId
(
$field
,
$params
);
break
;
case
4
:
$params
[
"a.house_id"
]
=
$result
[
"house_id"
];
...
...
application/model/GHouses.php
View file @
88e6de41
...
...
@@ -619,6 +619,25 @@ class GHouses extends BaseModel
return
$averagePrice
;
}
/**
* 修改楼盘数量
* @param $id
* @param $params
* @return int
*/
public
function
updateHouseNum
(
$id
,
$params
){
$params
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
Db
::
startTrans
();
try
{
Db
::
table
(
$this
->
table
)
->
where
(
'id'
,
$id
)
->
update
(
$params
);
Db
::
commit
();
return
1
;
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
return
0
;
}
}
/******zw end ************/
...
...
application/model/OBargainModel.php
View file @
88e6de41
...
...
@@ -431,4 +431,20 @@ class OBargainModel extends Model
->
where
(
$where_
)
->
select
();
}
/**
* 判断同一个订单是否有多个成交报告
*/
public
function
ifBargainNumByOrderId
(
$params
){
return
Db
::
table
(
$this
->
table
)
->
select
(
$params
)
->
count
();
}
public
function
getBargainDetail
(
$field
,
$params
){
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$params
)
->
select
();
}
}
\ No newline at end of file
application/model/OrderModel.php
View file @
88e6de41
...
...
@@ -173,4 +173,19 @@ class OrderModel extends Model
->
where
(
$where_
)
->
count
();
}
/**
* 根据订单id获取楼盘info
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getHouseInfoByOrderId
(
$field
,
$params
){
return
$this
->
db_
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"g_houses b"
,
"a.house_id = b.id"
,
"left"
)
->
where
(
$params
)
->
select
();
}
}
\ No newline at end of file
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