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
90728150
Commit
90728150
authored
Jan 29, 2018
by
zw
Committed by
hujun
Mar 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报备
parent
9c80956e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
4 deletions
+78
-4
FollowUp.php
application/api_broker/controller/FollowUp.php
+0
-1
FollowUpService.php
application/api_broker/service/FollowUpService.php
+75
-1
OFollowUp.php
application/model/OFollowUp.php
+3
-2
No files found.
application/api_broker/controller/FollowUp.php
View file @
90728150
...
...
@@ -3,7 +3,6 @@ namespace app\api_broker\controller;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\FollowUpService
;
use
app\model\OFollowUp
;
/**
* Created by PhpStorm.
...
...
application/api_broker/service/FollowUpService.php
View file @
90728150
<?php
namespace
app\api_broker\service
;
use
app\model\OFollowUp
;
use
app\model\OrderModel
;
/**
* Created by PhpStorm.
* User : zw
...
...
@@ -10,12 +13,82 @@ namespace app\api_broker\service;
class
FollowUpService
{
private
$followUpModel
;
private
$orderModel
;
function
__construct
()
{
$this
->
followUpModel
=
new
OFollowUp
();
$this
->
orderModel
=
new
OrderModel
();
}
/**
* 生成报备和保存订单
* @param $agent_id
* @param $store_id
* @param $user_id
* @param $house_ids
* @param $vehicle
* @param $intro
* @param $predict_see_time
* @return int
*/
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
);
if
(
$id
>
0
){
$house_arr
=
explode
(
","
,
$house_ids
);
$order_arr
=
[];
foreach
(
$house_arr
as
$k
=>
$v
){
//todo 批量插入到数据库
$order_no
=
$this
->
createOrderNumber
();
array_push
(
$order_arr
,
$this
->
orderBin
(
$order_no
,
$id
,
$v
));
}
//todo 保存order表
return
$this
->
orderModel
->
insertOrderByAll
(
$order_arr
);
}
}
public
function
verifyReport
(){
/**
* 订单号
* @return string
*/
private
function
createOrderNumber
(){
return
time
()
.
mt_rand
(
100000
,
999999
);
}
/**
* 报备主表
* @param $report_agent_id
* @param $report_store_id
* @param $user_id
* @param $vehicle
* @param $intro
* @param $predict_see_time
* @return array
*/
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_store_id"
]
=
$report_store_id
;
$param
[
"user_id"
]
=
$user_id
;
$param
[
"vehicle"
]
=
$vehicle
;
$param
[
"status"
]
=
0
;
$param
[
"intro"
]
=
$intro
;
$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
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
return
$this
->
followUpModel
->
addFollowUp
(
$param
);
}
private
function
orderBin
(
$order_no
,
$f_id
,
$house_id
){
$param
[
"order_no"
]
=
$order_no
;
$param
[
"f_id"
]
=
$f_id
;
$param
[
"house_id"
]
=
$house_id
;
return
$param
;
}
}
\ No newline at end of file
application/model/OFollowUp.php
View file @
90728150
...
...
@@ -37,10 +37,10 @@ class OFollowUp extends Model
$this
->
db
->
insert
(
$params
);
$id
=
$this
->
id
;
Db
::
commit
();
return
[
"code"
=>
"200"
,
"msg"
=>
$id
]
;
return
$id
;
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
return
[
"code"
=>
"101"
,
"msg"
=>
"失败,数据异常"
]
;
return
0
;
}
}
}
\ 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