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
26ce3426
Commit
26ce3426
authored
Jan 29, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
格式
parent
ac6ec087
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
17 deletions
+26
-17
FollowUp.php
application/api_broker/controller/FollowUp.php
+5
-2
FollowUpService.php
application/api_broker/service/FollowUpService.php
+21
-15
No files found.
application/api_broker/controller/FollowUp.php
View file @
26ce3426
<?php
<?php
namespace
app\api_broker\controller
;
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\extend\Basic
;
...
@@ -55,7 +56,7 @@ class FollowUp extends Basic
...
@@ -55,7 +56,7 @@ class FollowUp extends Basic
$intro
=
$params
[
"intro"
];
$intro
=
$params
[
"intro"
];
$predict_see_time
=
$params
[
"predict_see_time"
];
$predict_see_time
=
$params
[
"predict_see_time"
];
return
$this
->
service_
->
verifyReport
(
$agent_id
,
$store_id
,
$user_id
,
$house_ids
,
$vehicle
,
$intro
,
$predict_see_time
);
return
$this
->
service_
->
verifyReport
(
$agent_id
,
$store_id
,
$user_id
,
$house_ids
,
$vehicle
,
$intro
,
$predict_see_time
);
}
}
...
@@ -64,7 +65,8 @@ class FollowUp extends Basic
...
@@ -64,7 +65,8 @@ class FollowUp extends Basic
* 根据报备的编号进场
* 根据报备的编号进场
* @return \think\Response
* @return \think\Response
*/
*/
public
function
marchInByOrderId
(){
public
function
marchInByOrderId
()
{
return
$this
->
response
();
return
$this
->
response
();
}
}
}
}
\ No newline at end of file
application/api_broker/service/FollowUpService.php
View file @
26ce3426
<?php
<?php
namespace
app\api_broker\service
;
namespace
app\api_broker\service
;
use
app\model\OFollowUp
;
use
app\model\OFollowUp
;
use
app\model\OrderModel
;
use
app\model\OrderModel
;
...
@@ -10,8 +12,8 @@ use app\model\OrderModel;
...
@@ -10,8 +12,8 @@ use app\model\OrderModel;
* Time : 16:41
* Time : 16:41
* Intro:
* Intro:
*/
*/
class
FollowUpService
class
FollowUpService
{
{
private
$followUpModel
;
private
$followUpModel
;
private
$orderModel
;
private
$orderModel
;
...
@@ -33,17 +35,18 @@ class FollowUpService {
...
@@ -33,17 +35,18 @@ class FollowUpService {
* @param $predict_see_time
* @param $predict_see_time
* @return int
* @return int
*/
*/
public
function
verifyReport
(
$agent_id
,
$store_id
,
$user_id
,
$house_ids
,
$vehicle
,
$intro
,
$predict_see_time
){
public
function
verifyReport
(
$agent_id
,
$store_id
,
$user_id
,
$house_ids
,
$vehicle
,
$intro
,
$predict_see_time
)
{
$id
=
$this
->
oFollowUpBin
(
$agent_id
,
$store_id
,
$user_id
,
$vehicle
,
$intro
,
$predict_see_time
);
$id
=
$this
->
oFollowUpBin
(
$agent_id
,
$store_id
,
$user_id
,
$vehicle
,
$intro
,
$predict_see_time
);
if
(
$id
>
0
)
{
if
(
$id
>
0
)
{
$house_arr
=
explode
(
","
,
$house_ids
);
$house_arr
=
explode
(
","
,
$house_ids
);
$order_arr
=
[];
$order_arr
=
[];
foreach
(
$house_arr
as
$k
=>
$v
)
{
foreach
(
$house_arr
as
$k
=>
$v
)
{
//todo 批量插入到数据库
//todo 批量插入到数据库
$order_no
=
$this
->
createOrderNumber
();
$order_no
=
$this
->
createOrderNumber
();
array_push
(
$order_arr
,
$this
->
orderBin
(
$order_no
,
$id
,
$v
));
array_push
(
$order_arr
,
$this
->
orderBin
(
$order_no
,
$id
,
$v
));
}
}
//todo 保存order表
//todo 保存order表
return
$this
->
orderModel
->
insertOrderByAll
(
$order_arr
);
return
$this
->
orderModel
->
insertOrderByAll
(
$order_arr
);
...
@@ -57,8 +60,9 @@ class FollowUpService {
...
@@ -57,8 +60,9 @@ class FollowUpService {
* 订单号
* 订单号
* @return string
* @return string
*/
*/
private
function
createOrderNumber
(){
private
function
createOrderNumber
()
return
time
()
.
mt_rand
(
100000
,
999999
);
{
return
time
()
.
mt_rand
(
100000
,
999999
);
}
}
/**
/**
...
@@ -71,20 +75,22 @@ class FollowUpService {
...
@@ -71,20 +75,22 @@ class FollowUpService {
* @param $predict_see_time
* @param $predict_see_time
* @return array
* @return array
*/
*/
private
function
oFollowUpBin
(
$report_agent_id
,
$report_store_id
,
$user_id
,
$vehicle
,
$intro
,
$predict_see_time
){
private
function
oFollowUpBin
(
$report_agent_id
,
$report_store_id
,
$user_id
,
$vehicle
,
$intro
,
$predict_see_time
)
{
$param
[
"report_agent_id"
]
=
$report_agent_id
;
$param
[
"report_agent_id"
]
=
$report_agent_id
;
$param
[
"report_store_id"
]
=
$report_store_id
;
$param
[
"report_store_id"
]
=
$report_store_id
;
$param
[
"user_id"
]
=
$user_id
;
$param
[
"user_id"
]
=
$user_id
;
$param
[
"vehicle"
]
=
$vehicle
;
$param
[
"vehicle"
]
=
$vehicle
;
$param
[
"status"
]
=
0
;
$param
[
"status"
]
=
0
;
$param
[
"intro"
]
=
$intro
;
$param
[
"intro"
]
=
$intro
;
$param
[
"predict_see_time"
]
=
date
(
"Y-m-d H:i:s"
,
$predict_see_time
);
$param
[
"predict_see_time"
]
=
date
(
"Y-m-d H:i:s"
,
$predict_see_time
);
$param
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$param
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$param
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$param
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
return
$this
->
followUpModel
->
addFollowUp
(
$param
);
return
$this
->
followUpModel
->
addFollowUp
(
$param
);
}
}
private
function
orderBin
(
$order_no
,
$f_id
,
$house_id
){
private
function
orderBin
(
$order_no
,
$f_id
,
$house_id
)
{
$param
[
"order_no"
]
=
$order_no
;
$param
[
"order_no"
]
=
$order_no
;
$param
[
"f_id"
]
=
$f_id
;
$param
[
"f_id"
]
=
$f_id
;
$param
[
"house_id"
]
=
$house_id
;
$param
[
"house_id"
]
=
$house_id
;
...
...
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