Commit ef7e9f6f authored by zhuwei's avatar zhuwei

客户电话跟进优化

parent c54d990c
......@@ -271,13 +271,14 @@ class Broker extends Basic
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/*
$params['content']='跟进内容';//跟进内容
/*$params['content']='跟进内容';//跟进内容
$params['labels_id']=1;//g_labels表主键
$params['user_id']=1;//u_users ID用户表id
$params['agent_id']=1;//agent表id-当前登录用户id
$params['type']='1';//0电话跟进 1普通跟进
*/
$params['user_status']='1';//0电话跟进 1普通跟进*/
$checkResult = $this->validate($params, "BrokerValidate.verifyStatus");
if (true !== $checkResult) {
......@@ -287,11 +288,18 @@ class Broker extends Basic
$user_id = $params['user_id'];
$user_status = $params['user_status'];
$Users = new Users();
$result = $Users->getUserCityInfo($user_id);
if($result){
$params['province'] = $result[0]['province'] ? $result[0]['province'] : '上海市';
$params['city'] = $result[0]['city']? $result[0]['province'] : '上海市';
$params['disc'] = $result[0]['disc']? $result[0]['disc'] : '黄浦区';
}
//主表查询商铺详细信息
$UPhoneFollowPp = new UPhoneFollowPp();
$result = $UPhoneFollowPp->savePhoneFollow($params);
//跟进,对客户状态进行更新 0:求租;1:已租;-1:无效
$Users = new Users();
$Users->update_user_status([ 'id' => $user_id, 'user_status' => $user_status ]);
if ($result == 1) {
......
......@@ -41,6 +41,16 @@ class UPhoneFollowPp extends BaseModel
if (isset($params["user_status"])) {
$arr["user_status"] = $params["user_status"];
}
if (isset($params["province"])) {
$arr["province"] = $params["province"];
}
if (isset($params["city"])) {
$arr["city"] = $params["city"];
}
if (isset($params["disc"])) {
$arr["disc"] = $params["disc"];
}
$result = $this->UPhoneFollowPp->insert($arr);
return $result;
}
......
......@@ -769,5 +769,17 @@ class Users extends Model
return $return;
}
public function getUserCityInfo($id)
{
$field='province,city,disc';
$params= [ 'id' => $id ];
$result = Db::table($this->table)
->field($field)
->where($params)
->select();
return $result;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment