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
80e00bb9
Commit
80e00bb9
authored
Aug 03, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增-客户电话跟进 1.新增验证规则,字段验证 2.bug修复
parent
8ff04a97
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
22 deletions
+56
-22
Broker.php
application/api_broker/controller/Broker.php
+10
-22
BrokerValidate.php
application/api_broker/validate/BrokerValidate.php
+36
-0
UPhoneFollowPp.php
application/model/UPhoneFollowPp.php
+10
-0
No files found.
application/api_broker/controller/Broker.php
View file @
80e00bb9
...
@@ -269,43 +269,31 @@ class Broker extends Basic
...
@@ -269,43 +269,31 @@ class Broker extends Basic
{
{
header
(
'Access-Control-Allow-Origin:*'
);
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/*$params['content']='跟进内容';//跟进内容
/*
$params['content']='跟进内容';//跟进内容
$params['labels_id']=1;//g_labels表主键
$params['labels_id']=1;//g_labels表主键
$params['user_id']=1;//u_users ID用户表id
$params['user_id']=1;//u_users ID用户表id
$params['agent_id']=1;//agent表id-当前登录用户id
$params['agent_id']=1;//agent表id-当前登录用户id
$params['type']='1';//B端agent表*/
$params['type']='1';//0电话跟进 1普通跟进
*/
if
(
!
isset
(
$params
[
'content'
])
||
!
isset
(
$params
[
'user_id'
])
||
!
isset
(
$params
[
'agent_id'
])
)
{
$checkResult
=
$this
->
validate
(
$params
,
"BrokerValidate.verifyStatus"
);
return
$this
->
response
(
"300"
,
"参数不全"
,
[
'remote_groupid'
=>
''
]);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"300"
,
$checkResult
);
}
}
$content
=
$params
[
'content'
];
$labels_id
=
empty
(
$params
[
'labels_id'
])
?
0
:
$params
[
'labels_id'
];
$user_id
=
$params
[
'user_id'
];
$user_id
=
$params
[
'user_id'
];
$agent_id
=
$params
[
'agent_id'
];
$user_status
=
$params
[
'user_status'
];
$user_status
=
$params
[
'user_status'
];
$type
=
$params
[
'type'
];
//0电话跟进 1普通跟进
//修复20180802 bug 此功能待完善 zw
if
(
$agent_id
==
0
){
return
$this
->
response
(
"300"
,
"请传入正确的经纪人id"
,
[
'remote_groupid'
=>
''
]);
}
//主表查询商铺详细信息
//主表查询商铺详细信息
$UPhoneFollowPp
=
new
UPhoneFollowPp
();
$UPhoneFollowPp
=
new
UPhoneFollowPp
();
$UPhoneFollowPp
->
content
=
$content
;
$result
=
$UPhoneFollowPp
->
savePhoneFollow
(
$params
);
$UPhoneFollowPp
->
labels_id
=
$labels_id
;
$UPhoneFollowPp
->
user_id
=
$user_id
;
$UPhoneFollowPp
->
agent_id
=
$agent_id
;
$UPhoneFollowPp
->
type
=
$type
;
$UPhoneFollowPp
->
user_status
=
$user_status
;
$UPhoneFollowPp
->
save
();
//dump($UPhoneFollowPp->id);exit;
//跟进,对客户状态进行更新 0:求租;1:已租;-1:无效
//跟进,对客户状态进行更新 0:求租;1:已租;-1:无效
$Users
=
new
Users
();
$Users
=
new
Users
();
$Users
->
update_user_status
([
'id'
=>
$user_id
,
'user_status'
=>
$user_status
]);
$Users
->
update_user_status
([
'id'
=>
$user_id
,
'user_status'
=>
$user_status
]);
if
(
$
UPhoneFollowPp
->
id
)
{
if
(
$
result
==
1
)
{
return
$this
->
response
(
"200"
,
"success!"
,
$
UPhoneFollowPp
->
id
);
return
$this
->
response
(
"200"
,
"success!"
,
$
result
);
}
else
{
}
else
{
return
$this
->
response
(
"101"
,
"失败!"
);
return
$this
->
response
(
"101"
,
"失败!"
);
}
}
...
...
application/api_broker/validate/BrokerValidate.php
0 → 100644
View file @
80e00bb9
<?php
namespace
app\api_broker\validate
;
use
think\Validate
;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2018/8/3
* Time: 上午10:11
*/
class
BrokerValidate
extends
Validate
{
protected
$rule
=
[
'type'
=>
'require|in:0,1,2'
,
'agent_id'
=>
'require|number|gt:0'
,
'labels_id'
=>
'number'
,
'user_id'
=>
'require|number|gt:0'
,
'user_status'
=>
'require|in:-1,0,1'
];
protected
$message
=
[
'type.require'
=>
'type为必填字段'
,
'type.number'
=>
'type只能为数字'
,
'agent_id.require'
=>
'agent_id为必填字段'
,
'agent_id.number'
=>
'agent_id只能为数字'
,
'labels_id.number'
=>
'labels_id只能为数字'
,
'user_id.require'
=>
'user_id为必填字段'
,
'user_id.number'
=>
'user_id只能为数字'
,
'user_status.require'
=>
'user_status为必填字段'
,
'user_status.number'
=>
'user_status只能为数字'
];
protected
$scene
=
[
'add_phone_follow_up_verify'
=>
[
'labels_id'
,
'user_id'
,
'agent_id'
,
'user_status'
,
'type'
],
];
}
application/model/UPhoneFollowPp.php
View file @
80e00bb9
...
@@ -16,6 +16,16 @@ class UPhoneFollowPp extends BaseModel
...
@@ -16,6 +16,16 @@ class UPhoneFollowPp extends BaseModel
$this
->
UPhoneFollowPp
=
Db
(
$this
->
table
);
$this
->
UPhoneFollowPp
=
Db
(
$this
->
table
);
}
}
/**
* 新增电话跟进-插入数据
* @param $data
* @return int|string
*/
public
function
savePhoneFollow
(
$data
)
{
$result
=
$this
->
UPhoneFollowPp
->
insert
(
$data
);
return
$result
;
}
/**
/**
* @return array|false|\PDOStatement|string|\think\Model
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DataNotFoundException
...
...
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