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
882bca9c
Commit
882bca9c
authored
Apr 08, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
1ff7cf56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
118 additions
and
24 deletions
+118
-24
OrderLog.php
application/api_broker/controller/OrderLog.php
+5
-5
OrderLogService.php
application/api_broker/service/OrderLogService.php
+113
-19
No files found.
application/api_broker/controller/OrderLog.php
View file @
882bca9c
...
@@ -236,12 +236,12 @@ class OrderLog extends Basic
...
@@ -236,12 +236,12 @@ class OrderLog extends Basic
public
function
selectReportAll
()
public
function
selectReportAll
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
"order_id"
]))
{
/*
if (!isset($params["order_id"])) {
return $this->response("101", "请求参数错误");
return $this->response("101", "请求参数错误");
}
}
*/
/*
$params = array(
$params
=
array
(
"order_id" =>
1
,
"order_id"
=>
53630
,
);
*/
);
$data
=
$this
->
service_
->
selectListByOrderNo
(
$params
[
"order_id"
]);
$data
=
$this
->
service_
->
selectListByOrderNo
(
$params
[
"order_id"
]);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
}
}
...
...
application/api_broker/service/OrderLogService.php
View file @
882bca9c
...
@@ -10,6 +10,7 @@ use app\model\OPayLogModel;
...
@@ -10,6 +10,7 @@ use app\model\OPayLogModel;
use
app\model\OrderModel
;
use
app\model\OrderModel
;
use
app\model\ORefundModel
;
use
app\model\ORefundModel
;
use
app\model\OReportModel
;
use
app\model\OReportModel
;
use
app\model\Regions
;
/**
/**
...
@@ -64,22 +65,22 @@ class OrderLogService
...
@@ -64,22 +65,22 @@ class OrderLogService
if
(
!
empty
(
$bill_arr
))
{
if
(
!
empty
(
$bill_arr
))
{
/*推送 客方,盘方,独家方,店长 start*/
/*推送 客方,盘方,独家方,店长 start*/
$ge_tui
=
new
GeTuiUntils
();
$ge_tui
=
new
GeTuiUntils
();
$agent_
=
new
AAgents
();
$agent_
=
new
AAgents
();
$report
=
new
OReportModel
();
$report
=
new
OReportModel
();
$order
=
new
OrderModel
();
$order
=
new
OrderModel
();
$order_agent_device
=
$agent_
->
getAgentEelationByOrderId
(
$order_id
);
//独家和盘方
$order_agent_device
=
$agent_
->
getAgentEelationByOrderId
(
$order_id
);
//独家和盘方
$report_agent_device
=
$report
->
getAgentByReportId
(
$report_id
);
//客方
$report_agent_device
=
$report
->
getAgentByReportId
(
$report_id
);
//客方
$name
=
$agent_
->
getAgentsById
(
$agent_id
,
'name'
);
$name
=
$agent_
->
getAgentsById
(
$agent_id
,
'name'
);
$store_data
=
$agent_
->
getStoreAgentId
(
$agent_id
);
//店长
$store_data
=
$agent_
->
getStoreAgentId
(
$agent_id
);
//店长
$order_data
=
$order
->
getOrderById
(
'house_title'
,
$order_id
);
$order_data
=
$order
->
getOrderById
(
'house_title'
,
$order_id
);
$content
=
"恭喜【
{
$store_data
[
'store_name'
]
}
】店【
{
$name
}
】成交【
{
$order_data
[
'house_title'
]
}
】商铺一套"
;
$content
=
"恭喜【
{
$store_data
[
'store_name'
]
}
】店【
{
$name
}
】成交【
{
$order_data
[
'house_title'
]
}
】商铺一套"
;
$ge_tui
->
public_push_message_for_one
(
$store_data
[
'id'
],
$store_data
[
'device_id'
],
'成交商铺'
,
$content
);
$ge_tui
->
public_push_message_for_one
(
$store_data
[
'id'
],
$store_data
[
'device_id'
],
'成交商铺'
,
$content
);
$ge_tui
->
public_push_message_for_one
(
$report_agent_device
[
'id'
],
$report_agent_device
[
'device_id'
],
'成交商铺'
,
$content
);
$ge_tui
->
public_push_message_for_one
(
$report_agent_device
[
'id'
],
$report_agent_device
[
'device_id'
],
'成交商铺'
,
$content
);
foreach
(
$order_agent_device
as
$v
)
{
foreach
(
$order_agent_device
as
$v
)
{
$ge_tui
->
public_push_message_for_one
(
$v
[
'id'
],
$v
[
'device_id'
],
'成交商铺'
,
$content
);
$ge_tui
->
public_push_message_for_one
(
$v
[
'id'
],
$v
[
'device_id'
],
'成交商铺'
,
$content
);
}
}
/*推送 客方,盘方,独家方,店长 end*/
/*推送 客方,盘方,独家方,店长 end*/
...
@@ -229,6 +230,7 @@ class OrderLogService
...
@@ -229,6 +230,7 @@ class OrderLogService
if
(
count
(
$marchInData
)
>
0
)
{
if
(
count
(
$marchInData
)
>
0
)
{
foreach
(
$marchInData
as
$k
=>
$v
)
{
foreach
(
$marchInData
as
$k
=>
$v
)
{
$v
[
"step_name"
]
=
"march_in"
;
$v
[
"step_name"
]
=
"march_in"
;
$v
[
"img_path"
]
=
CHAT_IMG_URL
;
$result
[
$sort
++
]
=
$v
;
$result
[
$sort
++
]
=
$v
;
}
}
}
}
...
@@ -236,9 +238,12 @@ class OrderLogService
...
@@ -236,9 +238,12 @@ class OrderLogService
$field_follow_up
=
"id,user_type,decision_maker,industry_type,area_requirement,price_requirement,province,city,
$field_follow_up
=
"id,user_type,decision_maker,industry_type,area_requirement,price_requirement,province,city,
district,business_area,explain,explain_img,create_time"
;
district,business_area,explain,explain_img,create_time"
;
$followUpLogData
=
$followUpLogModel
->
selectFollowUpListByReportId
(
$field_follow_up
,
[
"report_id"
=>
$report_id
]);
$followUpLogData
=
$followUpLogModel
->
selectFollowUpListByReportId
(
$field_follow_up
,
[
"report_id"
=>
$report_id
]);
if
(
count
(
$followUpLogData
)
>
0
)
{
if
(
count
(
$followUpLogData
)
>
0
)
{
foreach
(
$followUpLogData
as
$k
=>
$v
)
{
foreach
(
$followUpLogData
as
$k
=>
$v
)
{
$v
[
"step_name"
]
=
"follow_up_log"
;
$v
[
"step_name"
]
=
"follow_up_log"
;
$v
=
$this
->
convertFollowUp
(
$v
);
$v
[
"img_path"
]
=
CHAT_IMG_URL
;
$result
[
$sort
++
]
=
$v
;
$result
[
$sort
++
]
=
$v
;
}
}
}
}
...
@@ -250,6 +255,7 @@ class OrderLogService
...
@@ -250,6 +255,7 @@ class OrderLogService
if
(
count
(
$payLogData
)
>
0
)
{
if
(
count
(
$payLogData
)
>
0
)
{
foreach
(
$payLogData
as
$k
=>
$v
)
{
foreach
(
$payLogData
as
$k
=>
$v
)
{
$v
[
"step_name"
]
=
"pay_log"
;
$v
[
"step_name"
]
=
"pay_log"
;
$v
[
"img_path"
]
=
CHAT_IMG_URL
;
$result
[
$sort
++
]
=
$v
;
$result
[
$sort
++
]
=
$v
;
}
}
}
}
...
@@ -261,6 +267,7 @@ class OrderLogService
...
@@ -261,6 +267,7 @@ class OrderLogService
if
(
count
(
$refundData
)
>
0
)
{
if
(
count
(
$refundData
)
>
0
)
{
foreach
(
$refundData
as
$k
=>
$v
)
{
foreach
(
$refundData
as
$k
=>
$v
)
{
$v
[
"step_name"
]
=
"refund"
;
$v
[
"step_name"
]
=
"refund"
;
$v
[
"img_path"
]
=
CHAT_IMG_URL
;
$result
[
$sort
++
]
=
$v
;
$result
[
$sort
++
]
=
$v
;
}
}
}
}
...
@@ -275,9 +282,96 @@ class OrderLogService
...
@@ -275,9 +282,96 @@ class OrderLogService
$result
[
$sort
++
]
=
$v
;
$result
[
$sort
++
]
=
$v
;
}
}
}
}
return
$this
->
sortByTime
(
$result
);
return
$this
->
sortByTime
(
$result
);
}
}
private
function
convertFollowUp
(
$item
)
{
// $field_follow_up = "id,user_type,decision_maker,industry_type,area_requirement,price_requirement,province,city,
// district,business_area,explain,explain_img,create_time";
/* `user_type` tinyint(2) DEFAULT NULL COMMENT '用户类型 1 A类成交意愿较强 2 B类 中等 3 C类较弱 ',
`decision_maker` varchar(80) DEFAULT '' COMMENT '第一决策人',
`industry_type` tinyint(2) DEFAULT NULL COMMENT '租商铺做什么, 1轻餐饮 2重餐饮 3百货零售 4服装 5亲子教育 6休闲娱乐',
`area_requirement` tinyint(2) DEFAULT NULL COMMENT '面积要求 1 30平米内 2 30-60平米 3 60-100平米 4 100平米上',
`price_requirement` tinyint(2) DEFAULT NULL COMMENT '对价格的要求 1.月租金10000元以内 2.月租金10000-30000元 3.月租金30000元以上',
`province` varchar(125) DEFAULT '' COMMENT '省',
`city` varchar(125) DEFAULT '' COMMENT '市',
`district` varchar(125) DEFAULT '' COMMENT '区',
`business_area` varchar(125) DEFAULT '' COMMENT '商圈',
`other_area` varchar(255) DEFAULT '' COMMENT '其他地址',
`explain` varchar(255) DEFAULT '' COMMENT '其他说明',*/
switch
(
$item
[
"user_type"
])
{
case
1
:
$item
[
"user_type"
]
=
"A类(成交意愿较强)"
;
break
;
case
2
:
$item
[
"user_type"
]
=
"B类(成交意愿中等)"
;
break
;
case
3
:
$item
[
"user_type"
]
=
"C类(成交意愿较弱)"
;
break
;
}
switch
(
$item
[
"industry_type"
])
{
case
1
:
$item
[
"industry_type"
]
=
"轻餐饮"
;
break
;
case
2
:
$item
[
"industry_type"
]
=
"重餐饮"
;
break
;
case
3
:
$item
[
"industry_type"
]
=
"百货零售"
;
break
;
case
4
:
$item
[
"industry_type"
]
=
"服装"
;
break
;
case
5
:
$item
[
"industry_type"
]
=
"亲子教育"
;
break
;
case
6
:
$item
[
"industry_type"
]
=
"休闲娱乐"
;
break
;
default
:
$item
[
"industry_type"
]
=
"其他"
;
}
switch
(
$item
[
"area_requirement"
])
{
case
1
:
$item
[
"area_requirement"
]
=
"30平米内"
;
break
;
case
2
:
$item
[
"area_requirement"
]
=
"30-60平米"
;
break
;
case
3
:
$item
[
"area_requirement"
]
=
"60-100平米"
;
break
;
case
4
:
$item
[
"area_requirement"
]
=
"100平米上"
;
break
;
default
:
$item
[
"area_requirement"
]
=
"其他"
;
}
switch
(
$item
[
"price_requirement"
])
{
case
1
:
$item
[
"price_requirement"
]
=
"月租金10000元以内"
;
break
;
case
2
:
$item
[
"price_requirement"
]
=
" 月租金10000-30000元"
;
break
;
case
3
:
$item
[
"price_requirement"
]
=
"月租金30000元以上"
;
break
;
default
:
$item
[
"price_requirement"
]
=
"其他"
;
}
/* $regions = new Regions();
$cityInfo = $regions->getRegions($item["district"],$item["city"],3);
dump($cityInfo);exit;*/
return
$item
;
}
/**
/**
* 排序时间
* 排序时间
...
@@ -309,11 +403,11 @@ class OrderLogService
...
@@ -309,11 +403,11 @@ class OrderLogService
b.user_id,b.user_phone,b.user_name,b.predict_see_time"
;
b.user_id,b.user_phone,b.user_name,b.predict_see_time"
;
switch
((
int
)
$params
[
"type"
])
{
switch
((
int
)
$params
[
"type"
])
{
case
0
:
case
0
:
// $condition["b.user_phone"] = array( 'like', "%" . trim($params['search_keyword']) . "%" );
// $condition["b.user_phone"] = array( 'like', "%" . trim($params['search_keyword']) . "%" );
$condition
.=
"and b.user_phone like '%"
.
trim
(
$params
[
'search_keyword'
])
.
"%' "
;
$condition
.=
"and b.user_phone like '%"
.
trim
(
$params
[
'search_keyword'
])
.
"%' "
;
break
;
break
;
case
1
:
case
1
:
// $condition["b.user_name"] = array( 'like', "%" . trim($params['search_keyword']) . "%" );
// $condition["b.user_name"] = array( 'like', "%" . trim($params['search_keyword']) . "%" );
$condition
.=
"and b.user_name like '%"
.
trim
(
$params
[
'search_keyword'
])
.
"%' "
;
$condition
.=
"and b.user_name like '%"
.
trim
(
$params
[
'search_keyword'
])
.
"%' "
;
break
;
break
;
case
2
:
case
2
:
...
@@ -335,17 +429,17 @@ class OrderLogService
...
@@ -335,17 +429,17 @@ class OrderLogService
default
:
default
:
return
[
"code"
=>
"101"
,
"msg"
=>
"搜索类型错误"
];
return
[
"code"
=>
"101"
,
"msg"
=>
"搜索类型错误"
];
}
}
/* if (isset($params["agent_id"])) {
/* if (isset($params["agent_id"])) {
$condition["b.report_agent_id"] = array( "eq", $params["agent_id"] );
$condition["b.report_agent_id"] = array( "eq", $params["agent_id"] );
}*/
}*/
$vModel
=
new
VerifyService
();
$vModel
=
new
VerifyService
();
$agentArr
=
$vModel
->
getAgentsByAgentId
(
$params
[
"report_agent_id"
]);
$agentArr
=
$vModel
->
getAgentsByAgentId
(
$params
[
"report_agent_id"
]);
if
(
$agentArr
)
{
if
(
$agentArr
)
{
//$params["report_agent_id"] = $agentArr;
//$params["report_agent_id"] = $agentArr;
$condition
.=
"and b.report_agent_id in ("
.
trim
(
$agentArr
)
.
") "
;
$condition
.=
"and b.report_agent_id in ("
.
trim
(
$agentArr
)
.
") "
;
}
}
$caseHouseId
=
$vModel
->
getCaseHouseIdByAgentId
(
$params
[
"report_agent_id"
]);
$caseHouseId
=
$vModel
->
getCaseHouseIdByAgentId
(
$params
[
"report_agent_id"
]);
...
@@ -353,7 +447,7 @@ class OrderLogService
...
@@ -353,7 +447,7 @@ class OrderLogService
foreach
(
$caseHouseId
as
$item
)
{
foreach
(
$caseHouseId
as
$item
)
{
$ids
.=
$item
[
"houses_id"
]
.
","
;
$ids
.=
$item
[
"houses_id"
]
.
","
;
}
}
$ids
=
rtrim
(
$ids
,
","
);
$ids
=
rtrim
(
$ids
,
","
);
$ids
=
$ids
?
$ids
:
0
;
$ids
=
$ids
?
$ids
:
0
;
//$params["house_ids"] = $ids;
//$params["house_ids"] = $ids;
$where_
.=
"and a.house_id in (
$ids
)"
;
$where_
.=
"and a.house_id in (
$ids
)"
;
...
@@ -361,7 +455,7 @@ class OrderLogService
...
@@ -361,7 +455,7 @@ class OrderLogService
$orderModel
=
new
OrderModel
();
$orderModel
=
new
OrderModel
();
$result
=
$orderModel
->
searchOrder
(
$field
,
$condition
,
$where_
);
$result
=
$orderModel
->
searchOrder
(
$field
,
$condition
,
$where_
);
$ids_str
=
""
;
$ids_str
=
""
;
if
(
count
(
$result
)
<=
0
)
{
if
(
count
(
$result
)
<=
0
)
{
...
...
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