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
085bf7a8
Commit
085bf7a8
authored
Oct 10, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户来电记录
parent
06a246ca
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
95 additions
and
0 deletions
+95
-0
CallAgent.php
application/api_broker/controller/CallAgent.php
+54
-0
AUserCallAgent.php
application/model/AUserCallAgent.php
+39
-0
route.php
application/route.php
+2
-0
No files found.
application/api_broker/controller/CallAgent.php
0 → 100644
View file @
085bf7a8
<?php
namespace
app\api_broker\controller
;
/**
* Created by PhpStorm.
* User: zhuwei
* Date:
* Time:
*/
use
app\api_broker\extend\Basic
;
use
app\model\AUserCallAgent
;
use
think\Request
;
class
CallAgent
extends
Basic
{
protected
$aUserCallAgent
;
public
function
__construct
(
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
aUserCallAgent
=
new
AUserCallAgent
();
}
public
function
addUserCallAgent
(){
$params
=
$this
->
params
;
/*$params = array(
"user_id" => 1,
"agent_id" => 4,
);*/
if
(
!
isset
(
$params
[
"user_id"
])
or
!
isset
(
$params
[
"agent_id"
])
)
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
//先判断是否已经存在数据
$insert
[
"user_id"
]
=
$params
[
'user_id'
];
$insert
[
"agent_id"
]
=
$params
[
'agent_id'
];
$insert
[
"status"
]
=
0
;
$res
=
$this
->
aUserCallAgent
->
saveUserCallAgent
(
$insert
);
//int(1)
if
(
$res
)
{
return
$this
->
response
(
"200"
,
"成功"
);
}
else
{
return
$this
->
response
(
"101"
,
"失败"
);
}
}
}
\ No newline at end of file
application/model/AUserCallAgent.php
0 → 100755
View file @
085bf7a8
<?php
namespace
app\model
;
use
think\Db
;
use
think\Model
;
class
AUserCallAgent
extends
Model
{
// 设置当前模型对应的完整数据表名称
protected
$table
=
'a_user_call_agent'
;
public
function
saveUserCallAgent
(
$data
)
{
$time
=
date
(
"Y-m-d h:i:sa"
,
time
());
$data
[
'create_time'
]
=
$time
;
$data
[
'update_time'
]
=
$time
;
return
$this
->
insert
(
$data
);
}
/**
* 查询数据
* 朱伟
*/
public
function
getUserCallAgent
(
$field
,
$params
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
//->alias('a')
->
where
(
$params
)
->
select
();
//dump($this->getLastSql());
return
$result
;
}
}
application/route.php
View file @
085bf7a8
...
...
@@ -632,6 +632,8 @@ Route::group('broker', [
'bargainMain'
=>
[
'api_broker/Bargain/bargainList'
,
[
'method'
=>
'POST|GET'
]
],
'addUserCallAgent'
=>
[
'api_broker/CallAgent/addUserCallAgent'
,
[
'method'
=>
'POST|GET'
]
],
//客户来电记录
]);
...
...
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