Commit 0674bd95 authored by zw's avatar zw

带看列表显示商铺地址

parent 787f4981
......@@ -463,8 +463,8 @@ class OrderLog extends Basic
public function selectReportAll()
{
$params = $this->params;
/* $params = array(
"order_id" => 38024,
/* $params = array(
"order_id" => 112,
);*/
if (!isset($params["order_id"])) {
return $this->response("101", "请求参数错误");
......
......@@ -391,7 +391,7 @@ class OrderLogService
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function selectListByOrderNo($order_id)
public function selectListByOrderNoV2($order_id)
{
$result = [];
$sort = 0;
......@@ -498,7 +498,7 @@ class OrderLogService
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function selectListByOrderNoV2($order_id)
public function selectListByOrderNo($order_id)
{
$result = [];
$sort = 0;
......@@ -511,6 +511,7 @@ class OrderLogService
$oPayLogModel = new OPayLogModel();
$oRefundModel = new ORefundModel();
$oBargainModel = new OBargainModel();
$oPayLogAdjustmentModel = new OPayLogAdjustment();
$orderData = $orderModel->selectOrderByOrderId("a.f_id,a.house_title,b.internal_address", ["order_id" => $order_id]);
......@@ -594,7 +595,15 @@ class OrderLogService
$result[$sort++] = $v2;
}
}
$field_adjustment = "a.id,a.paylog_id,a.new_paylog_id,a.type,a.money,a.create_time,a.update_time,c.name";
$adjustmentData = $oPayLogAdjustmentModel->getAdjustmentListByOrderId($field_adjustment, ["order_id" => $order_id]);
if (count($adjustmentData) > 0) {
foreach ($adjustmentData as $k2 => $v2) {
$v2["step_name"] = "adjustment";
$result[$sort++] = $v2;
}
}
return $this->sortByTime($result);
}
......@@ -837,109 +846,8 @@ class OrderLogService
$result = [];
$sort = 0;
//todo 1.验证订单是否存在
/* $oReportModel = new OReportModel();
$oMarchInModel = new OMarchInModel();
$followUpLogModel = new FollowUpLogModel();
$oPayLogModel = new OPayLogModel();
$oRefundModel = new ORefundModel();
$oBargainModel = new OBargainModel();*/
$gHousesFollowModel = new GHousesFollowUp();
/* $field_report = "a.id,a.create_time,a.user_name,a.user_phone,b.id as order_id,b.house_title,c.id as agent_id,c.name,c.img,d.store_name";
$reportData = $oReportModel->selectReportByUserId($field_report, [ "house_id" => $house_id ]);
if (count($result) <= 0 && count($reportData) <= 0) {
return [];
}
$order_ids = $report_ids = "";
$user_info_arr = [];
//报备
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"] = "报备【" . $v['user_name'] . "-" . $v["user_phone"] . "】";
$result[$sort++] = $v;
$order_ids .= $v["order_id"] . ",";
$report_ids .= $v["id"] . ",";
//todo 组装成order_id为key的数组
$user_info_arr[$v["order_id"]] = $v;
}
$order_ids = rtrim($order_ids, ",");
$report_ids = rtrim($report_ids, ",");
$orderParams["order_id"] = array( "in", $order_ids );
$reportParams["report_id"] = array( "in", $report_ids );
//进场 march in
$field_march_in = "a.id,a.reception_id,a.create_time,b.id as order_id,b.house_id,b.house_title,c.id as agent_id,c.name,c.img,d.store_name";
$marchInData = $oMarchInModel->getMarchInListByOrderId($field_march_in, $orderParams);
if (count($marchInData) > 0) {
foreach ($marchInData as $k => $v) {
$v["step_name"] = "march_in";
$v["step"] = "进场【" . $user_info_arr[$v['order_id']]['user_name'] . "-" . $user_info_arr[$v['order_id']]["user_phone"] . "】";
$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,
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);
if (count($followUpLogData) > 0) {
foreach ($followUpLogData as $k => $v) {
$v["step_name"] = "follow_up_log";
$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["img_path"] = CHAT_IMG_URL;
$result[$sort++] = $v;
}
}
//收款
$field_pay_log = "a.id,a.create_time,b.id as order_id,b.house_id,b.house_title,c.id as agent_id,c.name,c.img,d.store_name";
$payLogData = $oPayLogModel->getPayLogByOrderId($field_pay_log, $orderParams);
if (count($payLogData) > 0) {
foreach ($payLogData as $k => $v) {
$v["step_name"] = "pay_log";
$v["step"] = "收款【" . $user_info_arr[$v['order_id']]['user_name'] . "-" . $user_info_arr[$v['order_id']]["user_phone"] . "】";
$result[$sort++] = $v;
}
}
//退款
$field_refund = "a.id,a.create_time,b.id as order_id,b.house_id,b.house_title,c.id as agent_id,c.name,c.img,d.store_name";
$refundData = $oRefundModel->getRefundByOrderId($field_refund, $orderParams);
if (count($refundData) > 0) {
foreach ($refundData as $k => $v) {
$v["step_name"] = "refund";
$v["step"] = "退款【" . $user_info_arr[$v['order_id']]['user_name'] . "-" . $user_info_arr[$v['order_id']]["user_phone"] . "】";
$result[$sort++] = $v;
}
}
//成交报告
$field_bargain = "a.id,a.create_time,b.id as order_id,b.house_id,a.house_number,a.is_open,b.house_title,c.id as agent_id,c.name,c.img,d.store_name";
$bargainData = $oBargainModel->getBargainByOrderId($field_bargain, $orderParams);
if (count($bargainData) > 0) {
foreach ($bargainData as $k => $v) {
$v["step_name"] = "bargain";
$v["step"] = "成交报告【" . $user_info_arr[$v['order_id']]['user_name'] . "-" . $user_info_arr[$v['order_id']]["user_phone"] . "】";
$result[$sort++] = $v;
}
}*/
//楼盘跟进
$field_shop_follow_up = "a.id,a.follow_up_info,a.agent_id,a.create_time,b.name as agent_name,b.img,c.store_name";
$houseFollowUpData = $gHousesFollowModel->getShopFollowUpList($field_shop_follow_up, ["house_id" => $house_id]);
......
......@@ -35,6 +35,28 @@ class OPayLogAdjustment extends Model{
->select();
}
/**
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAdjustmentListByOrderId($field,$params){
$where_ = [];
if(isset($params["order_id"])){
$where_["b.order_id"] = $params["order_id"];
}
return $this->db_
->field($field)
->alias("a")
->join("o_paylog b","a.paylog_id=b.id")
->join("a_agents c","a.operation_id=c.id")
->where($where_)
->select();
}
public function getAdjustmentSum($field, $params)
{
$data = $this->db_
......
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