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
c67dad8a
Commit
c67dad8a
authored
Apr 15, 2018
by
hujun
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/test' into test
parents
d3813b9b
383b0933
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
146 additions
and
84 deletions
+146
-84
AppointmentTime.php
application/api/controller/AppointmentTime.php
+60
-32
AttentionShop.php
application/api/controller/AttentionShop.php
+2
-2
OrderLog.php
application/api_broker/controller/OrderLog.php
+28
-26
config.php
application/config.php
+1
-1
AAgents.php
application/model/AAgents.php
+2
-0
AppointWatchShop.php
application/model/AppointWatchShop.php
+32
-3
ResultsSummaryTask.php
application/task/controller/ResultsSummaryTask.php
+21
-20
No files found.
application/api/controller/AppointmentTime.php
View file @
c67dad8a
...
...
@@ -34,10 +34,10 @@ class AppointmentTime extends Basic
parent
::
__construct
(
$request
);
$this
->
appointmentTimeModel
=
new
AppointWatchShop
();
//$this->houseInfoModel = new HouseInfos();
$this
->
houseInfoModel
=
new
GHouses
();
$this
->
dbImg
=
new
GHousesImgs
();
$this
->
appliesModel
=
new
Applies
();
$this
->
evaluateMode
=
new
Evaluate
();
$this
->
houseInfoModel
=
new
GHouses
();
$this
->
dbImg
=
new
GHousesImgs
();
$this
->
appliesModel
=
new
Applies
();
$this
->
evaluateMode
=
new
Evaluate
();
}
/**
...
...
@@ -47,15 +47,15 @@ class AppointmentTime extends Basic
public
function
addAppointmentSeeShop
()
{
$params
=
$this
->
params
;
/* $params = array(
"user_id" => 116,
"house_id" => 49,
"house_title" => "楼盘1",
"appellation" => "张三",
"phone" => "13817616312",
"expect_time" => time() + 1000,
"other_require" => "没有其他要求"
);*/
/* $params = array(
"user_id" => 116,
"house_id" => 49,
"house_title" => "楼盘1",
"appellation" => "张三",
"phone" => "13817616312",
"expect_time" => time() + 1000,
"other_require" => "没有其他要求"
);*/
//todo 验证楼盘信息
if
(
isset
(
$params
[
"house_id"
])
&&
isset
(
$params
[
"house_title"
]))
{
...
...
@@ -76,15 +76,15 @@ class AppointmentTime extends Basic
return
$this
->
response
(
"101"
,
"预约时间为空,或者小于当前时间"
);
}
$addPrams
=
array
(
'expect_time'
=>
date
(
"Y-m-d H:i:s"
,
$params
[
"expect_time"
]
/
1000
),
'phone'
=>
$params
[
"phone"
],
'house_title'
=>
$params
[
"house_title"
],
'house_id'
=>
$params
[
"house_id"
],
'appellation'
=>
$params
[
"appellation"
],
'user_id'
=>
$params
[
"user_id"
],
'expect_time'
=>
date
(
"Y-m-d H:i:s"
,
$params
[
"expect_time"
]
/
1000
),
'phone'
=>
$params
[
"phone"
],
'house_title'
=>
$params
[
"house_title"
],
'house_id'
=>
$params
[
"house_id"
],
'appellation'
=>
$params
[
"appellation"
],
'user_id'
=>
$params
[
"user_id"
],
'other_require'
=>
$params
[
"other_require"
],
'create_time'
=>
date
(
"Y-m-d H:i:s"
,
time
()),
'update_time'
=>
date
(
"Y-m-d H:i:s"
,
time
())
'create_time'
=>
date
(
"Y-m-d H:i:s"
,
time
()),
'update_time'
=>
date
(
"Y-m-d H:i:s"
,
time
())
);
$result
=
$this
->
appointmentTimeModel
->
insertAppointWatchShop
(
$addPrams
);
if
(
$result
[
"code"
]
==
200
)
{
...
...
@@ -102,13 +102,13 @@ class AppointmentTime extends Basic
*/
public
function
getAppointmentSeeShopList
()
{
/*
$params = array(
"status" => 2, //看铺状态 0待经纪人确认(确认后存agents_id) 1:待看 2:已看' 如果是待看 0,1 已看是2
"user_id" => "1
",//对应u_users表
"phone" => "18112347151
",//phone
"pageNo" => "1",
"pageSize" => 15
);*/
/*
$params = array(
"status" => 2, //看铺状态 0待经纪人确认(确认后存agents_id) 1:待看 2:已看' 如果是待看 0,1 已看是2
"user_id" => "122
",//对应u_users表
"phone" => "17717536290
",//phone
"pageNo" => "1",
"pageSize" => 15
);*/
$params
=
$this
->
params
;
...
...
@@ -124,11 +124,11 @@ class AppointmentTime extends Basic
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$result
=
[];
$result
=
[];
if
(
$params
[
"status"
]
==
1
)
{
$result
=
$this
->
getWaitList
(
$pageNo
,
$pageSize
,
$params
);
}
elseif
(
$params
[
"status"
]
==
2
)
{
$result
=
$this
->
getYetList
(
$pageNo
,
$pageSize
,
$params
);
$result
=
$this
->
getYetList
V2
(
$pageNo
,
$pageSize
,
$params
);
}
if
(
count
(
$result
)
>
0
)
{
...
...
@@ -159,7 +159,7 @@ class AppointmentTime extends Basic
foreach
(
$result
as
$key
=>
$val
)
{
$result
[
$key
][
"api_path"
]
=
IMG_PATH
;
$param
[
"house_id"
]
=
$val
[
"house_id"
];
$param
[
"img_type"
]
=
1
;
//默认主图
$param
[
"img_type"
]
=
1
;
//默认主图
$result
[
$key
][
"images"
]
=
$this
->
dbImg
->
getHouseImages
(
$param
,
1
);
$houseInfo
=
$this
->
houseInfoModel
->
getHouseDetail
(
"residue_num as room_num_left,external_title as foreign_name"
,
array
(
"id"
=>
$val
[
"house_id"
]
));
...
...
@@ -190,7 +190,35 @@ class AppointmentTime extends Basic
foreach
(
$result
as
$key
=>
$val
)
{
$result
[
$key
][
"api_path"
]
=
IMG_PATH
;
$param
[
"house_id"
]
=
$val
[
"house_id"
];
$param
[
"img_type"
]
=
1
;
//默认主图
$param
[
"img_type"
]
=
1
;
//默认主图
$result
[
$key
][
"images"
]
=
$this
->
dbImg
->
getHouseImages
(
$param
,
1
);
//todo 是否评价
$evaluateResult
=
$this
->
evaluateMode
->
getIsEvaluate
(
10
,
$val
[
"id"
],
$params
[
"user_id"
]);
$result
[
$key
][
"is_evaluate"
]
=
count
(
$evaluateResult
)
>
0
?
1
:
0
;
}
return
$result
;
}
/**
* 已看列表
* @param $pageNo
* @param $pageSize
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getYetListV2
(
$pageNo
,
$pageSize
,
$params
)
{
$field
=
"a.id,a.phone,c.reception_id as agents_id,c.create_time as expect_time,a.house_id,
d.external_title as house_title,d.residue_num as room_num_left"
;
$where_
[
"a.user_id"
]
=
$params
[
"user_id"
];
$result
=
$this
->
appointmentTimeModel
->
getHaveToSeeList
(
$pageNo
,
$pageSize
,
"id desc"
,
$field
,
$where_
);
//获取图片信息
foreach
(
$result
as
$key
=>
$val
)
{
$result
[
$key
][
"api_path"
]
=
IMG_PATH
;
$param
[
"house_id"
]
=
$val
[
"house_id"
];
$param
[
"img_type"
]
=
1
;
//默认主图
$result
[
$key
][
"images"
]
=
$this
->
dbImg
->
getHouseImages
(
$param
,
1
);
//todo 是否评价
$evaluateResult
=
$this
->
evaluateMode
->
getIsEvaluate
(
10
,
$val
[
"id"
],
$params
[
"user_id"
]);
...
...
application/api/controller/AttentionShop.php
View file @
c67dad8a
...
...
@@ -65,11 +65,11 @@ class AttentionShop extends Basic
public
function
attentionList
()
{
$params
=
$this
->
params
;
$params
=
array
(
/*
$params = array(
"user_id" => 816,
"pageNo" => 1,
"pageSize" => 15,
);
);
*/
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
...
...
application/api_broker/controller/OrderLog.php
View file @
c67dad8a
...
...
@@ -200,10 +200,10 @@ class OrderLog extends Basic
public
function
searchBargainAgents
()
{
$params
=
$this
->
params
;
/* $params = array(
"type" => 1,//1盘方,2客方,3反签,4独家,5合作方
"order_id" => 36,
);*/
/* $params = array(
"type" => 1,//1盘方,2客方,3反签,4独家,5合作方
"order_id" => 36,
);*/
if
(
!
isset
(
$params
[
"type"
])
||
!
isset
(
$params
[
"order_id"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
...
...
@@ -480,21 +480,22 @@ class OrderLog extends Basic
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
'Don\'t have info.'
;
}
else
{
$insert_data
[
'report_id'
]
=
$bargain_data
[
'report_id'
];
$insert_data
[
'agent_id'
]
=
$this
->
params
[
'agent_id'
];
$insert_data
[
'order_id'
]
=
$bargain_data
[
'order_id'
];
$insert_data
[
'order_no'
]
=
$bargain_data
[
'order_no'
];
$insert_data
[
'trade_type'
]
=
$bargain_data
[
'trade_type'
];
$insert_data
[
'submit_agent_id'
]
=
$bargain_data
[
'submit_agent_id'
];
$insert_data
[
'price'
]
=
$bargain_data
[
'price'
];
$insert_data
[
'commission'
]
=
$bargain_data
[
'commission'
];
$insert_data
[
'status'
]
=
$bargain_data
[
'status'
];
$insert_data
[
'source'
]
=
1
;
$insert_data
[
'role'
]
=
empty
(
$this
->
params
[
'role'
])
?
0
:
$this
->
params
[
'role'
];
$insert_data
[
'scale_fee'
]
=
empty
(
$this
->
params
[
'scale_fee'
])
?
0
:
$this
->
params
[
'scale_fee'
];
$insert_data
[
'practical_fee'
]
=
empty
(
$this
->
params
[
'practical_fee'
])
?
0
:
$this
->
params
[
'practical_fee'
];
$insert_data
[
'father_id'
]
=
empty
(
$this
->
params
[
'id'
])
?
0
:
$this
->
params
[
'id'
];
$insert_data
[
'scale'
]
=
empty
(
$this
->
params
[
'scale'
])
?
0
:
$this
->
params
[
'scale'
];
$insert_data
[
'report_id'
]
=
$bargain_data
[
'report_id'
];
$insert_data
[
'agent_id'
]
=
$this
->
params
[
'agent_id'
];
$insert_data
[
'order_id'
]
=
$bargain_data
[
'order_id'
];
$insert_data
[
'order_no'
]
=
$bargain_data
[
'order_no'
];
$insert_data
[
'trade_type'
]
=
$bargain_data
[
'trade_type'
];
$insert_data
[
'submit_agent_id'
]
=
$bargain_data
[
'submit_agent_id'
];
$insert_data
[
'submit_agent_name'
]
=
$bargain_data
[
'submit_agent_name'
];
$insert_data
[
'price'
]
=
$bargain_data
[
'price'
];
$insert_data
[
'commission'
]
=
$bargain_data
[
'commission'
];
$insert_data
[
'status'
]
=
$bargain_data
[
'status'
];
$insert_data
[
'source'
]
=
1
;
$insert_data
[
'role'
]
=
empty
(
$this
->
params
[
'role'
])
?
0
:
$this
->
params
[
'role'
];
$insert_data
[
'scale_fee'
]
=
empty
(
$this
->
params
[
'scale_fee'
])
?
0
:
$this
->
params
[
'scale_fee'
];
$insert_data
[
'practical_fee'
]
=
empty
(
$this
->
params
[
'practical_fee'
])
?
0
:
$this
->
params
[
'practical_fee'
];
$insert_data
[
'father_id'
]
=
empty
(
$this
->
params
[
'id'
])
?
0
:
$this
->
params
[
'id'
];
$insert_data
[
'scale'
]
=
empty
(
$this
->
params
[
'scale'
])
?
0
:
$this
->
params
[
'scale'
];
$data
[
'data'
][
'id'
]
=
$bargain
->
insertBargain
(
$insert_data
);
if
(
$data
[
'data'
]
==
0
)
{
...
...
@@ -513,10 +514,10 @@ class OrderLog extends Basic
public
function
isBargainEnd
()
{
$params
=
$this
->
params
;
/* $params = array(
"order_id" => 1,//订单id
"submit_agent_id" => 1//提交人id
);*/
/* $params = array(
"order_id" => 1,//订单id
"submit_agent_id" => 1//提交人id
);*/
if
(
!
isset
(
$params
[
"order_id"
])
||
!
isset
(
$params
[
"submit_agent_id"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
...
...
@@ -529,9 +530,9 @@ class OrderLog extends Basic
$bargain
=
$bargainModel
->
getBargainDetail
(
$field
,
$where_
);
if
(
count
(
$bargain
)
>
0
)
{
return
$this
->
response
(
"200"
,
"request success"
,[
"id"
=>
$bargain
[
0
][
"id"
]
]);
}
else
{
return
$this
->
response
(
"200"
,
"request null"
);
return
$this
->
response
(
"200"
,
"request success"
,
[
"id"
=>
$bargain
[
0
][
"id"
]
]);
}
else
{
return
$this
->
response
(
"200"
,
"request null"
);
}
}
}
\ No newline at end of file
application/config.php
View file @
c67dad8a
...
...
@@ -14,7 +14,7 @@ define('LOCAL_IMG_HOST','/resource/lib/Attachments/');
define
(
'PAGESIZE'
,
15
);
//分页每页条数
define
(
'ADMIN_URL_TL'
,
'https://admin.tonglianjituan.com/'
);
//B端网址
//define('TEST_ADMIN_URL_TL','https://dev.tonglianjituan.com/'); //B端网址
define
(
'CURRENT_URL'
,
'http://'
.
$_SERVER
[
'HTTP_HOST'
]
.
'/'
);
//取当前域名地址
define
(
'CURRENT_URL'
,
'http
s
://'
.
$_SERVER
[
'HTTP_HOST'
]
.
'/'
);
//取当前域名地址
define
(
'HEADERIMGURL'
,
CURRENT_URL
.
'static'
.
DS
.
'head_portrait/'
);
//头像地址
define
(
'AGENTHEADERIMGURL'
,
CURRENT_URL
.
'static'
.
DS
.
'agent_head_portrait/'
);
//头像地址
define
(
'CHAT_IMG_URL'
,
CURRENT_URL
.
'static'
.
DS
.
'chat_image/'
);
//聊天图片地址
...
...
application/model/AAgents.php
View file @
c67dad8a
...
...
@@ -367,6 +367,8 @@ class AAgents extends BaseModel
{
return
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
...
...
application/model/AppointWatchShop.php
View file @
c67dad8a
...
...
@@ -53,7 +53,7 @@ class AppointWatchShop extends BaseModel
*/
public
function
getAppointWatchShopList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
)
{
return
$this
return
$this
->
field
(
$field
)
->
where
(
$params
)
->
order
(
$order_
)
...
...
@@ -62,6 +62,34 @@ class AppointWatchShop extends BaseModel
->
select
();
}
/**
* 预约看铺列表 已看列表
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getHaveToSeeList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
)
{
return
$this
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"o_report b"
,
"a.applies_id = b.id"
,
"left"
)
->
join
(
"o_march_in c"
,
"c.report_id = b.id"
,
"right"
)
->
join
(
"g_houses d"
,
"d.id = a.house_id"
,
"left"
)
->
where
(
$params
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
/**
* 预约看铺总数
*
...
...
@@ -70,7 +98,7 @@ class AppointWatchShop extends BaseModel
*/
public
function
getAppointWatchShopListTotal
(
$params
)
{
return
$this
->
where
(
$params
)
->
count
();
return
$this
->
where
(
$params
)
->
count
();
}
/**
...
...
@@ -81,7 +109,8 @@ class AppointWatchShop extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAppointInfo
(
$field
,
$params
)
{
public
function
getAppointInfo
(
$field
,
$params
)
{
return
$this
->
field
(
$field
)
->
where
(
$params
)
->
find
();
...
...
application/task/controller/ResultsSummaryTask.php
View file @
c67dad8a
...
...
@@ -44,26 +44,27 @@ class ResultsSummaryTask
public
function
totalAgentResults
()
{
set_time_limit
(
0
);
//todo 1.分页查询经纪人, 2遍历执行,判断一个经纪人在统计表最后一条统计数据的日期
//TODO 3.日期加一天并判断是否大于等于当前时间大于return 4.执行此日期的统计,5.当次日期小于当前日期,递归日期加一。继续统计
$total
=
$this
->
agentsModel
->
getAgentsCountByTask
();
$pageSize
=
50
;
$pageTotal
=
ceil
(
$total
/
$pageSize
);
for
(
$pageNo
=
1
;
$pageNo
<=
$pageTotal
;
$pageNo
++
)
{
$resultArr
=
$this
->
agentsModel
->
getAgentsListByTask
(
$pageNo
,
$pageSize
,
"id,store_id,district_id"
);
$this
->
executeTotal
(
$resultArr
);
unset
(
$resultArr
);
}
unset
(
$this
->
agentsModel
);
unset
(
$this
->
tAgentTotalModel
);
unset
(
$this
->
houseModel
);
unset
(
$this
->
userModel
);
unset
(
$this
->
bargainModel
);
unset
(
$this
->
reportModel
);
unset
(
$this
->
marchInModel
);
unset
(
$this
->
payLogModel
);
set_time_limit
(
0
);
// 取消脚本运行时间的超时上限
//todo 1.分页查询经纪人, 2遍历执行,判断一个经纪人在统计表最后一条统计数据的日期
//TODO 3.日期加一天并判断是否大于等于当前时间大于return 4.执行此日期的统计,5.当次日期小于当前日期,递归日期加一。继续统计
$total
=
$this
->
agentsModel
->
getAgentsCountByTask
();
$pageSize
=
200
;
$pageTotal
=
ceil
(
$total
/
$pageSize
);
for
(
$pageNo
=
1
;
$pageNo
<=
$pageTotal
;
$pageNo
++
)
{
$resultArr
=
$this
->
agentsModel
->
getAgentsListByTask
(
$pageNo
,
$pageSize
,
"id,store_id,district_id"
);
$this
->
executeTotal
(
$resultArr
);
unset
(
$resultArr
);
}
unset
(
$this
->
agentsModel
);
unset
(
$this
->
tAgentTotalModel
);
unset
(
$this
->
houseModel
);
unset
(
$this
->
userModel
);
unset
(
$this
->
bargainModel
);
unset
(
$this
->
reportModel
);
unset
(
$this
->
marchInModel
);
unset
(
$this
->
payLogModel
);
}
...
...
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