Commit 3b164f29 authored by zw's avatar zw

店铺动态

parent 539141ff
...@@ -160,25 +160,25 @@ class OrderLog extends Basic ...@@ -160,25 +160,25 @@ class OrderLog extends Basic
!isset($params["price"]) || !isset($params["commission"]) || !isset($params["commission_arr"])) { !isset($params["price"]) || !isset($params["commission"]) || !isset($params["commission_arr"])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
} }
/* $params = array( /* $params = array(
"submit_agent_id" => 1,//申请经纪人id "submit_agent_id" => 1,//申请经纪人id
"submit_agent_name" => 1,//申请经纪人id "submit_agent_name" => 1,//申请经纪人id
"report_id" => 1,//报备id "report_id" => 1,//报备id
"order_id" => 1, //关联order表id "order_id" => 1, //关联order表id
"order_no" => "123123123", //订单no "order_no" => "123123123", //订单no
"trade_type" => 10, //成交类型 10出租 20 增佣 30 代理 40 好处费 "trade_type" => 10, //成交类型 10出租 20 增佣 30 代理 40 好处费
"price" => 112131, //成交价格 存分 "price" => 112131, //成交价格 存分
"commission" => 111, //佣金 存分 "commission" => 111, //佣金 存分
//`role` '分佣方 1盘方 2客方 3 反签 4独家 5合作方', //`role` '分佣方 1盘方 2客方 3 反签 4独家 5合作方',
//`agent_id`'分佣经纪人id', //`agent_id`'分佣经纪人id',
//`scale`'分佣比例 如 5表示百分之5', //`scale`'分佣比例 如 5表示百分之5',
// `scale_fee` '应分佣金 存分 ', // `scale_fee` '应分佣金 存分 ',
"commission_arr" => '[ { "role" : 10, "agent_id" : 10, "scale" : 10, "scale_fee" : 1222 }, "commission_arr" => '[ { "role" : 10, "agent_id" : 10, "scale" : 10, "scale_fee" : 1222 },
{ "role": 11, "agent_id" : 12, "scale": 13, "scale_fee" : 1112 }]', { "role": 11, "agent_id" : 12, "scale": 13, "scale_fee" : 1112 }]',
);*/ );*/
$params["commission_arr"] = json_decode($params["commission_arr"], true); $params["commission_arr"] = json_decode($params["commission_arr"], true);
...@@ -536,18 +536,26 @@ class OrderLog extends Basic ...@@ -536,18 +536,26 @@ class OrderLog extends Basic
} }
} }
/** /**
* 店铺动态
* @return \think\Response * @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function getListByHouseId(){ public function getListByHouseId()
{
$params = $this->params; $params = $this->params;
/* $params = array( $params = array(
"house_id"=>1 "house_id"=>1
);*/ );
if (!isset($params["house_id"])) {
return $this->response("101", "请求参数错误");
}
$data = $this->service_->selectListByHouseId($params["house_id"]); $data = $this->service_->selectListByHouseId($params["house_id"]);
return $this->response("200","request success",$data); if (count($data) > 0) {
return $this->response("200", "request success", $data);
} else {
return $this->response("200", "request null");
}
} }
} }
\ No newline at end of file
...@@ -440,7 +440,10 @@ class OrderLogService ...@@ -440,7 +440,10 @@ class OrderLogService
/** /**
* 查询流程 商铺动态 * 查询流程 商铺动态
* @param $house_id * @param $house_id
* @return array * @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function selectListByHouseId($house_id) public function selectListByHouseId($house_id)
{ {
...@@ -463,19 +466,27 @@ class OrderLogService ...@@ -463,19 +466,27 @@ class OrderLogService
} }
$order_ids = $report_ids = ""; $order_ids = $report_ids = "";
$user_info_arr = [];
//报备 //报备
foreach ($reportData as $k => $v) { foreach ($reportData as $k => $v) {
$v["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $v["user_phone"]);
$v["step_name"] = "report"; $v["step_name"] = "report";
$v["step"] = "报备【" . $v['user_name'] . "- " . $v["user_phone"] . "】"; $v["step"] = "报备【" . $v['user_name'] . "-" . $v["user_phone"] . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
$order_ids .= $v["order_id"] . ","; $order_ids .= $v["order_id"] . ",";
$report_ids .= $v["id"] . ","; $report_ids .= $v["id"] . ",";
//todo 组装成order_id为key的数组
$user_info_arr[$v["order_id"]] = $v;
} }
$order_ids = rtrim($order_ids, ","); $order_ids = rtrim($order_ids, ",");
$report_ids = rtrim($report_ids, ","); $report_ids = rtrim($report_ids, ",");
$orderParams["order_id"] = array( "in", $order_ids ); $orderParams["order_id"] = array( "in", $order_ids );
$reportParams["report_id"] = array( "in", $report_ids ); $reportParams["report_id"] = array( "in", $report_ids );
...@@ -485,23 +496,24 @@ class OrderLogService ...@@ -485,23 +496,24 @@ class OrderLogService
if (count($marchInData) > 0) { if (count($marchInData) > 0) {
foreach ($marchInData as $k => $v) { foreach ($marchInData as $k => $v) {
$v["step_name"] = "march_in"; $v["step_name"] = "march_in";
$v["step"] = "进场【" . $v['house_title'] . "】"; $v["step"] = "进场【" . $user_info_arr[$v['order_id']]['user_name'] . "-" . $user_info_arr[$v['order_id']]["user_phone"] . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
} }
} }
//跟进 //跟进
$field_follow_up = "a.id,a.agent_id,a.agent_name,a.user_type,a.decision_maker,a.industry_type,a.area_requirement,a.price_requirement,a.province,a.city, $field_follow_up = "a.id,a.agent_id,a.agent_name,a.user_type,a.decision_maker,a.industry_type,a.area_requirement,a.price_requirement,a.province,a.city,
a.district,a.business_area,a.explain,a.explain_img,a.create_time,b.name,b.img,c.store_name"; a.district,a.business_area,a.explain,a.explain_img,a.create_time,b.name,b.img,c.store_name,d.user_name,d.user_phone";
$followUpLogData = $followUpLogModel->getFollowUpByOrderId($field_follow_up, $reportParams); $followUpLogData = $followUpLogModel->getFollowUpByOrderId($field_follow_up, $reportParams);
if (count($followUpLogData) > 0) { if (count($followUpLogData) > 0) {
foreach ($followUpLogData as $k => $v) { foreach ($followUpLogData as $k => $v) {
$v["step_name"] = "follow_up_log"; $v["step_name"] = "follow_up_log";
$v["step"] = "跟进"; $v["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $v["user_phone"]);
$v["step"] = "跟进【" . $v['user_name'] . "-" . $v['user_phone'] . "】";
$v = $this->convertFollowUp($v); $v = $this->convertFollowUp($v);
$v["img_path"] = CHAT_IMG_URL; $v["img_path"] = CHAT_IMG_URL;
$v["explain_img"] = $v["explain_img"];
$result[$sort++] = $v; $result[$sort++] = $v;
} }
} }
...@@ -512,7 +524,7 @@ class OrderLogService ...@@ -512,7 +524,7 @@ class OrderLogService
if (count($payLogData) > 0) { if (count($payLogData) > 0) {
foreach ($payLogData as $k => $v) { foreach ($payLogData as $k => $v) {
$v["step_name"] = "pay_log"; $v["step_name"] = "pay_log";
$v["step"] = "收款【" . $v['house_title'] . "】"; $v["step"] = "收款【" . $user_info_arr[$v['order_id']]['user_name'] . "-" . $user_info_arr[$v['order_id']]["user_phone"] . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
} }
} }
...@@ -525,7 +537,7 @@ class OrderLogService ...@@ -525,7 +537,7 @@ class OrderLogService
if (count($refundData) > 0) { if (count($refundData) > 0) {
foreach ($refundData as $k => $v) { foreach ($refundData as $k => $v) {
$v["step_name"] = "refund"; $v["step_name"] = "refund";
$v["step"] = "退款【" . $v['house_title'] . "】"; $v["step"] = "退款【" . $user_info_arr[$v['order_id']]['user_name'] . "-" . $user_info_arr[$v['order_id']]["user_phone"] ."】";
$result[$sort++] = $v; $result[$sort++] = $v;
} }
} }
...@@ -536,7 +548,7 @@ class OrderLogService ...@@ -536,7 +548,7 @@ class OrderLogService
if (count($bargainData) > 0) { if (count($bargainData) > 0) {
foreach ($bargainData as $k => $v) { foreach ($bargainData as $k => $v) {
$v["step_name"] = "bargain"; $v["step_name"] = "bargain";
$v["step"] = "成交报告【" . $v['house_title'] . "】"; $v["step"] = "成交报告【" . $user_info_arr[$v['order_id']]['user_name'] . "-" . $user_info_arr[$v['order_id']]["user_phone"] . "】";
$result[$sort++] = $v; $result[$sort++] = $v;
} }
} }
......
...@@ -107,6 +107,7 @@ class FollowUpLogModel extends Model ...@@ -107,6 +107,7 @@ class FollowUpLogModel extends Model
->alias("a") ->alias("a")
->join("a_agents b","a.agent_id = b.id","left") ->join("a_agents b","a.agent_id = b.id","left")
->join("a_store c","b.store_id = c.id","left") ->join("a_store c","b.store_id = c.id","left")
->join("o_report d","a.report_id = d.id","left")
->where($where_) ->where($where_)
->select(); ->select();
} }
......
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