Commit d513eda6 authored by zw's avatar zw

跟进

parent 318954c0
...@@ -4,6 +4,7 @@ namespace app\api_broker\controller; ...@@ -4,6 +4,7 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic; use app\api_broker\extend\Basic;
use app\api_broker\service\ReportService; use app\api_broker\service\ReportService;
use app\model\FollowUpLogModel;
/** /**
* Created by PhpStorm. * Created by PhpStorm.
...@@ -15,12 +16,13 @@ use app\api_broker\service\ReportService; ...@@ -15,12 +16,13 @@ use app\api_broker\service\ReportService;
class Report extends Basic class Report extends Basic
{ {
private $service_; private $service_;
private $fulModel;
public function __construct($request = null) public function __construct($request = null)
{ {
parent::__construct($request); parent::__construct($request);
$this->service_ = new ReportService(); $this->service_ = new ReportService();
$this->fulModel = new FollowUpLogModel();
} }
/** /**
...@@ -29,13 +31,13 @@ class Report extends Basic ...@@ -29,13 +31,13 @@ class Report extends Basic
*/ */
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']) || if (!isset($params['report_agent_id']) || !isset($params['report_store_id']) || !isset($params['user_id']) ||
!isset($params['house_ids']) || !isset($params['vehicle']) ) { !isset($params['house_ids']) || !isset($params['vehicle']) ) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
}*/ }
$params = array( /* $params = array(
"report_agent_id" => 1,//报备经纪人id "report_agent_id" => 1,//报备经纪人id
"report_store_id" => 1,//门店id "report_store_id" => 1,//门店id
"user_id" => 1,//用户id "user_id" => 1,//用户id
...@@ -43,7 +45,7 @@ class Report extends Basic ...@@ -43,7 +45,7 @@ class Report extends Basic
"vehicle" => 10,//交通工具 "vehicle" => 10,//交通工具
"intro" => "123123123",//备注 "intro" => "123123123",//备注
"predict_see_time" => date("Y-m-d H:i:s", time()),//预计到看时间 "predict_see_time" => date("Y-m-d H:i:s", time()),//预计到看时间
); );*/
//todo 检查经纪人状态 basic类做 //todo 检查经纪人状态 basic类做
//todo 验证用户id是否正常 //todo 验证用户id是否正常
...@@ -67,11 +69,70 @@ class Report extends Basic ...@@ -67,11 +69,70 @@ class Report extends Basic
} }
/** /**
* 根据报备的编号进场 * 根据报备的编号 进场
* @return \think\Response * @return \think\Response
*/ */
public function marchInByOrderId() public function marchInByOrderId()
{ {
return $this->response(); return $this->response();
} }
/**
* 新增跟进
* @return \think\Response
*/
public function addFollowUp(){
/*$params = array(
"report_id" => 1,
"agent_id" => 12,
"user_type" =>"1,2", // 用户类型
"decision_maker" =>"zhangsan",// 第一决策人
"industry_type" =>"1,2",//租商铺做什么
"area_requirement" =>"1,2",//面积要求
"price_requirement" =>"1,2", //价格要求
"province" =>"1,2", //省
"city" =>"1,2",//市
"district" =>"1,2",//区
"business_area" =>"1,2",//商圈
"other_area" =>"1,2",//其他地区
"explain" =>"1,2",//备注
"explain_img" =>"1,2"//备注图
);*/
$params = $this->params;
if (!isset($params['report_id']) || !isset($params['agent_id']) || !isset($params['user_type']) ||
!isset($params['industry_type']) || !isset($params['area_requirement']) || !isset($params['price_requirement'])) {
return $this->response("101", "请求参数错误");
}
$is_ok = $this->fulModel->addFollowUpLog($params);
if($is_ok > 0){
return $this->response("200","request success",[]);
}else{
return $this->response("101","request error");
}
}
public function getFollowUpList(){
$params = array(
"report_id" => 1,// 报备id
"agent_id" => 1,//非必填 经纪人id
);
$params = $this->params;
if(!isset($params["report_id"])){
return $this->response("101", "请求参数错误");
}
$field_ = "id,report_id,agent_id,user_type,decision_maker,industry_type,area_requirement,price_requirement,province
,city,district,business_area,other_area,explain,explain_img,create_time,update_time";
$where_ = [];
$where_["report_id"] = $params["report_id"];
if(isset($params["agent_id"])){
$where_["agent_id"] = $params["agent_id"];
}
$result = $this->fulModel->selectFollowUpList($field_,$where_);
}
} }
\ No newline at end of file
<?php
namespace app\model;
/**
* Created by PhpStorm.
* User: zw
* Date: 2017/12/21
* Time: 14:41
*/
use think\Db;
use think\Model;
class FollowUpLogModel extends Model
{
// 设置当前模型对应的完整数据表名称
protected $table = 'o_follow_up_log';
private $db_;
function __construct()
{
$this->db_ = Db::name($this->table);
}
public function addFollowUpLog($params){
$params["create_time"] = date("Y-m-d H:i:s", time());
$params["update_time"] = date("Y-m-d H:i:s", time());
Db::startTrans();
try {
$this->db_->insert($params);
Db::commit();
return 1;
} catch (\Exception $e) {
Db::rollback();
return 0;
}
}
public function selectFollowUpList($field_,$where_){
}
}
\ No newline at end of file
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