Commit 33c77bbc authored by zw's avatar zw

异常捕获

parent fcc83182
...@@ -5,6 +5,7 @@ namespace app\api_broker\controller; ...@@ -5,6 +5,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; use app\model\FollowUpLogModel;
use think\Exception;
/** /**
* Created by PhpStorm. * Created by PhpStorm.
...@@ -82,30 +83,30 @@ class Report extends Basic ...@@ -82,30 +83,30 @@ class Report extends Basic
*/ */
public function addFollowUp() public function addFollowUp()
{ {
$params = array( /* $params = array(
"report_id" => 1, "report_id" => 1,
"agent_id" => 12, "agent_id" => 12,
"user_type" =>"1,2", // 用户类型 "user_type" =>"1,2", // 用户类型
"decision_maker" =>"zhangsan",// 第一决策人 "decision_maker" =>"zhangsan",// 第一决策人
"industry_type" =>"1,2",//租商铺做什么 "industry_type" =>"1,2",//租商铺做什么
"area_requirement" =>"1,2",//面积要求 "area_requirement" =>"1,2",//面积要求
"price_requirement" =>"1,2", //价格要求 "price_requirement" =>"1,2", //价格要求
"province" =>"1,2", //省 "province" =>"1,2", //省
"city" =>"1,2",//市 "city" =>"1,2",//市
"district" =>"1,2",//区 "district" =>"1,2",//区
"business_area" =>"1,2",//商圈 "business_area" =>"1,2",//商圈
"other_area" =>"1,2",//其他地区 "other_area" =>"1,2",//其他地区
"explain" =>"1,2",//备注 "explain" =>"1,2",//备注
"explain_img" =>"1,2"//备注图 "explain_img" =>"1,2"//备注图
); );*/
//$params = $this->params; $params = $this->params;
if (!isset($params['report_id']) || !isset($params['agent_id']) || !isset($params['user_type']) || 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'])) { !isset($params['industry_type']) || !isset($params['area_requirement']) || !isset($params['price_requirement'])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
} }
$params["agent_name"] = $this->agentName; $params["agent_name"] = $this->agentName;
$is_ok = $this->fulModel->addFollowUpLog($params); $is_ok = $this->fulModel->addFollowUpLog($params);
if ($is_ok > 0) { if ($is_ok > 0) {
return $this->response("200", "request success", []); return $this->response("200", "request success", []);
} else { } else {
...@@ -138,13 +139,17 @@ class Report extends Basic ...@@ -138,13 +139,17 @@ class Report extends Basic
if (isset($params["agent_id"])) { if (isset($params["agent_id"])) {
$where_["agent_id"] = $params["agent_id"]; $where_["agent_id"] = $params["agent_id"];
} }
$result = $this->fulModel->selectFollowUpList($field_, $where_, $order_); try {
if (count($result) > 0) { $result = $this->fulModel->selectFollowUpList($field_, $where_, $order_);
return $this->response("200", "request success", $result); if (count($result) > 0) {
} else { return $this->response("200", "request success", $result);
return $this->response("300", "not fund list", []); } else {
return $this->response("300", "not fund list", []);
}
} catch (Exception $e) {
return $this->response("101", "request error:" . $e);
} }
return $this->response("101", "request error");
} }
} }
\ 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