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
67b23c4c
Commit
67b23c4c
authored
Apr 13, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
9fe43533
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
12 deletions
+111
-12
Shop.php
application/api_broker/controller/Shop.php
+14
-12
HouseNumUpdateService.php
application/api_broker/service/HouseNumUpdateService.php
+96
-0
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/Shop.php
View file @
67b23c4c
...
...
@@ -164,7 +164,7 @@ class Shop extends Basic
$result
=
$this
->
gHousesModel
->
getHousesList
(
$pageNo
,
$pageSize
,
$order_
,
$field
,
$conditions
,
$spTagArr
);
//获取图片信息
foreach
(
$result
as
$key
=>
$val
)
{
$result
[
$key
][
"api_path"
]
=
CK_IMG_URL
.
'images/'
;
$result
[
$key
][
"api_path"
]
=
CK_IMG_URL
.
'images/'
;
$result
[
$key
][
"rent_price"
]
=
$result
[
$key
][
"rent_price"
]
*
0.01
;
$param
[
"house_id"
]
=
$val
[
"id"
];
...
...
@@ -191,11 +191,11 @@ class Shop extends Basic
public
function
getShopDetail
()
{
/* $params = array(
"id" => 14,
"site_area" => 3, //1.c端 3.b端
"user_id" => 2 //if c端 用户登录后传入user_id
);*/
/* $params = array(
"id" => 14,
"site_area" => 3, //1.c端 3.b端
"user_id" => 2 //if c端 用户登录后传入user_id
);*/
$params
=
$this
->
params
;
$conditions
=
[];
...
...
@@ -226,12 +226,14 @@ class Shop extends Basic
$conditions
[
'a.id'
]
=
array
(
"eq"
,
$params
[
"id"
]
);
$result
=
$this
->
gHousesModel
->
getHouseDetailById
(
$field
,
$conditions
);
$result
[
"rent_price"
]
=
$result
[
"rent_price"
]
*
0.01
;
$result
[
"management_fee"
]
=
$result
[
"management_fee"
]
*
0.01
;
$result
[
"slotting_fee"
]
=
$result
[
"slotting_fee"
]
*
0.01
;
$result
[
"api_path"
]
=
CK_IMG_URL
.
'images/'
;
$param
[
"house_id"
]
=
$params
[
'id'
];
$result
=
$this
->
gHousesModel
->
getHouseDetailById
(
$field
,
$conditions
);
$result
[
"rent_price"
]
=
$result
[
"rent_price"
]
*
0.01
;
$result
[
"management_fee"
]
=
$result
[
"management_fee"
]
*
0.01
;
$result
[
"slotting_fee"
]
=
$result
[
"slotting_fee"
]
*
0.01
;
$result
[
"do_business_date"
]
=
date
(
"Y-m-d"
,
strtotime
(
$result
[
"do_business_date"
]));
$result
[
"opening_date"
]
=
date
(
"Y-m-d"
,
strtotime
(
$result
[
"opening_date"
]));
$result
[
"api_path"
]
=
CK_IMG_URL
.
'images/'
;
$param
[
"house_id"
]
=
$params
[
'id'
];
//todo 这里的是否要更改成b端后台上传的类型
$param
[
"img_type"
]
=
2
;
$result
[
"images"
]
=
$this
->
gHousesImgModel
->
getHouseImages
(
$param
,
15
);
...
...
application/api_broker/service/HouseNumUpdateService.php
0 → 100644
View file @
67b23c4c
<?php
namespace
app\api_broker\service
;
use
app\model\GHouses
;
use
app\model\OBargainModel
;
use
app\model\OrderModel
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/4/13
* Time : 10:04
* Intro:
*/
class
HouseNumUpdateService
{
public
function
__construct
()
{
}
/**
* 新增成交报告修改楼盘数量,
* @param $order_id
*/
public
static
function
updateHouseNumByBargain
(
$order_id
)
{
//todo 1.查询同一个订单的成交报告提交了几次 2.if 仅仅一次 则查询订单中楼盘id 3.根据楼盘id查询楼盘表获取商铺数量,数量减一,
//todo 4.如果数量小于等于0 修改楼盘为下架
$bargainModel
=
new
OBargainModel
();
$params
[
"father_id"
]
=
0
;
$params
[
"order_id"
]
=
$order_id
;
$params
[
"status"
]
=
10
;
$bargainNum
=
$bargainModel
->
ifBargainNumByOrderId
(
$params
);
if
(
$bargainNum
==
1
){
$orderModel
=
new
OrderModel
();
$field
=
"b.id as house_id,b.status,b.residue_num"
;
$orderParams
[
"a.id"
]
=
$order_id
;
$houseInfo
=
$orderModel
->
getHouseInfoByOrderId
(
$field
,
$orderParams
);
if
(
count
(
$houseInfo
)
>
0
&&
$houseInfo
[
0
][
"residue_num"
]
>
0
&&
$houseInfo
[
0
][
"status"
]
==
1
){
//减数量
$houseModel
=
new
GHouses
();
$id
=
$houseInfo
[
"id"
];
$updateParams
[
"residue_num"
]
=
$houseInfo
[
0
][
"residue_num"
]
-
1
;
if
(
$houseInfo
[
0
][
"residue_num"
]
==
1
){
$updateParams
[
"status"
]
=
2
;
}
$houseModel
->
updateHouseNum
(
$id
,
$updateParams
);
//type 1表示减少 2表示增加
}
}
}
/**
* 撤销成交报告修改楼盘数量
* @param $bargain_id
* @return null
*/
public
static
function
updateHouseNumByRevocationBargain
(
$bargain_id
)
{
//todo 1.查询同一个订单的成交报告正常状态的订单是否存在 2.if没有则查询订单中楼盘id 3.根据楼盘id查询楼盘表获取商铺数量,数量加一,
//todo 4.修改楼盘为上架
$bargainModel
=
new
OBargainModel
();
$bargainArr
=
$bargainModel
->
getBargainDetail
(
"order_id"
,[
"id"
=>
$bargain_id
]);
if
(
count
(
$bargainArr
)
<=
0
){
return
null
;
}
$order_id
=
$bargainArr
[
0
][
"order_id"
];
$params
[
"father_id"
]
=
0
;
$params
[
"order_id"
]
=
$order_id
;
$params
[
"status"
]
=
10
;
$bargainNum
=
$bargainModel
->
ifBargainNumByOrderId
(
$params
);
if
(
$bargainNum
<=
0
){
$orderModel
=
new
OrderModel
();
$field
=
"b.id as house_id,b.status,b.residue_num"
;
$orderParams
[
"a.id"
]
=
$order_id
;
$houseInfo
=
$orderModel
->
getHouseInfoByOrderId
(
$field
,
$orderParams
);
if
(
count
(
$houseInfo
)
>
0
&&
$houseInfo
[
0
][
"residue_num"
]
>
0
&&
$houseInfo
[
0
][
"status"
]
==
1
){
//减数量
$houseModel
=
new
GHouses
();
$id
=
$houseInfo
[
"id"
];
$updateParams
[
"residue_num"
]
=
$houseInfo
[
0
][
"residue_num"
]
+
1
;
if
(
$houseInfo
[
0
][
"residue_num"
]
==
2
){
$updateParams
[
"status"
]
=
1
;
}
$houseModel
->
updateHouseNum
(
$id
,
$updateParams
);
//type 1表示减少 2表示增加
}
}
}
}
\ No newline at end of file
application/route.php
View file @
67b23c4c
...
...
@@ -279,6 +279,7 @@ Route::group('api', [
'convertOrderByTime'
=>
[
'api/ConvertOrder/convertOrderByTime'
,
[
'method'
=>
'post|get'
]
],
'convertMarchIn'
=>
[
'api/ConvertOrder/convertMarchIn'
,
[
'method'
=>
'post|get'
]
],
'convertCollectingBill'
=>
[
'api/ConvertOrder/convertCollectingBill'
,
[
'method'
=>
'post|get'
]
],
'houseTable'
=>
[
'api/TransferHouseInfo/table'
,
[
'method'
=>
'post|get'
]
],
//转商铺表
'houseImgTable'
=>
[
'api/TransferHouseInfo/houseImg'
,
[
'method'
=>
'post|get'
]
],
//转楼盘表
...
...
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