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
b70ff387
Commit
b70ff387
authored
Jan 29, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
构建
parent
28c14823
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
105 additions
and
9 deletions
+105
-9
FollowUp.php
application/api_broker/controller/FollowUp.php
+31
-9
FollowUpService.php
application/api_broker/service/FollowUpService.php
+22
-0
OFollowUp.php
application/model/OFollowUp.php
+47
-0
route.php
application/route.php
+5
-0
No files found.
application/api_broker/controller/FollowUp.php
View file @
b70ff387
<?php
<?php
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\FollowUpService
;
use
app\model\OFollowUp
;
/**
/**
* Created by PhpStorm.
* Created by PhpStorm.
...
@@ -9,24 +12,44 @@ use app\api_broker\extend\Basic;
...
@@ -9,24 +12,44 @@ use app\api_broker\extend\Basic;
* Time : 14:24
* Time : 14:24
* Intro:
* Intro:
*/
*/
class
FollowUp
extends
Basic
class
FollowUp
extends
Basic
{
{
private
$service_
;
private
$followUpModel
;
public
function
__construct
(
$request
=
null
)
public
function
__construct
(
$request
=
null
)
{
{
parent
::
__construct
(
$request
);
parent
::
__construct
(
$request
);
$this
->
service_
=
new
FollowUpService
();
$this
->
followUpModel
=
new
OFollowUp
();
}
}
/**
/**
* 报备
* 报备
* @return \think\Response
*/
*/
public
function
report
(){
public
function
report
()
$params
=
$this
->
params
;
{
/* $params = $this->params;
if (!isset($params['report_agent_id']) || !isset($params['report_store_id']) || !isset($params['user_id']) ||
!isset($params['house_ids']) || !isset($params['vehicle']) ) {
return $this->response("101", "请求参数错误");
}*/
$params
=
array
(
$params
=
array
(
"user_id"
=>
1
,
"report_agent_id"
=>
1
,
"shop_ids"
=>
"1,2,3"
,
"report_store_id"
=>
1
,
""
"user_id"
=>
1
,
"house_ids"
=>
"1,2,3"
,
"vehicle"
=>
10
,
"intro"
=>
"123123123"
,
"to_see_time"
=>
date
(
"Y-m-d H:i:s"
,
time
()),
);
);
$result
=
$this
->
followUpModel
->
addFollowUp
(
$params
);
if
(
$result
[
"code"
]
==
200
){
return
$this
->
response
(
"200"
,
"request success"
,
[
"id"
,
$result
[
"msg"
]]);
}
else
{
return
$this
->
response
(
"101"
,
"request faild"
);
}
$this
->
response
(
"200"
,
"request success"
,[]);
}
}
}
}
\ No newline at end of file
application/api_broker/service/FollowUpService.php
0 → 100644
View file @
b70ff387
<?php
namespace
app\api_broker\service
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/1/26
* Time : 16:41
* Intro:
*/
class
FollowUpService
{
function
__construct
()
{
}
public
function
verifyReport
(){
}
}
\ No newline at end of file
application/model/OFollowUp.php
0 → 100644
View file @
b70ff387
<?php
namespace
app\model
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/1/26
* Time : 16:48
* Intro:
*/
use
think\Model
;
use
think\helper\Time
;
use
think\Db
;
class
OFollowUp
extends
Model
{
// 设置当前模型对应的完整数据表名称
protected
$table
=
'o_follow_up'
;
protected
$db
;
function
__construct
()
{
$this
->
db
=
Db
::
name
(
$this
->
table
);
}
/**
* 添加报备
* @param $params
* @return array
*/
public
function
addFollowUp
(
$params
)
{
Db
::
startTrans
();
try
{
$this
->
db
->
insert
(
$params
);
$id
=
$this
->
id
;
Db
::
commit
();
return
[
"code"
=>
"200"
,
"msg"
=>
$id
];
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
return
[
"code"
=>
"101"
,
"msg"
=>
"失败,数据异常"
];
}
}
}
\ No newline at end of file
application/route.php
View file @
b70ff387
...
@@ -175,4 +175,8 @@ Route::group('task',[
...
@@ -175,4 +175,8 @@ Route::group('task',[
'exclusiveExpirationTime'
=>
[
'task/exclusive/exclusiveExpirationTime'
,
[
'method'
=>
'get'
]]
//独家过期时间
'exclusiveExpirationTime'
=>
[
'task/exclusive/exclusiveExpirationTime'
,
[
'method'
=>
'get'
]]
//独家过期时间
]);
]);
Route
::
group
(
'broker'
,[
'report'
=>
[
'api_broker/FollowUp/report'
,
[
'method'
=>
'get|post'
]]
//报备
]);
//Route::miss('api/index/miss');//处理错误的url
//Route::miss('api/index/miss');//处理错误的url
\ 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