Commit ce4f97b6 authored by zw's avatar zw

商铺列表详情显示对外地址 报备时间轴显示对内地址

parent 2eb1fc11
...@@ -375,11 +375,6 @@ class OrderLog extends Basic ...@@ -375,11 +375,6 @@ class OrderLog extends Basic
/** /**
* 报备时间轴 * 报备时间轴
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function selectReportAll() public function selectReportAll()
{ {
...@@ -390,17 +385,12 @@ class OrderLog extends Basic ...@@ -390,17 +385,12 @@ class OrderLog extends Basic
if (!isset($params["order_id"])) { if (!isset($params["order_id"])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
} }
$data = $this->service_->selectListByOrderNo($params["order_id"]); $data = [];
return $this->response("200", "request success", $data); return $this->response("200", "request success", $data);
} }
/** /**
* 报备时间轴 * 报备时间轴
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function selectReportAllV2() public function selectReportAllV2()
{ {
...@@ -411,7 +401,7 @@ class OrderLog extends Basic ...@@ -411,7 +401,7 @@ class OrderLog extends Basic
if (!isset($params["order_id"])) { if (!isset($params["order_id"])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
} }
$data = $this->service_->selectListByOrderNoV2($params["order_id"]); $data = [];
return $this->response("200", "request success", $data); return $this->response("200", "request success", $data);
} }
......
...@@ -98,7 +98,8 @@ class Shop extends Basic ...@@ -98,7 +98,8 @@ class Shop extends Basic
,shop_area_start,shop_area_end,shop_type,residue_num,shop_sign,is_carefully_chosen,rent_type,rent_price,is_exclusive_type"; ,shop_area_start,shop_area_end,shop_type,residue_num,shop_sign,is_carefully_chosen,rent_type,rent_price,is_exclusive_type";
} else { } else {
$field = "id,internal_title as title,internal_address as address,city,disc,business_district_id,status,industry_type // $field = "id,internal_title as title,internal_address as address,city,disc,business_district_id,status,industry_type
$field = "id,external_title as title,internal_address as address,city,disc,business_district_id,status,industry_type
,shop_area_start,shop_area_end,shop_type,residue_num,shop_sign,is_carefully_chosen,rent_type,rent_price,is_lock ,shop_area_start,shop_area_end,shop_type,residue_num,shop_sign,is_carefully_chosen,rent_type,rent_price,is_lock
,is_exclusive_type"; ,is_exclusive_type";
...@@ -374,7 +375,8 @@ class Shop extends Basic ...@@ -374,7 +375,8 @@ class Shop extends Basic
if ($params['site_area'] == 3) { if ($params['site_area'] == 3) {
$field = "a.id,a.internal_title as title,a.internal_address as address,a.city,a.disc,a.business_district_id,a.status, // $field = "a.id,a.internal_title as title,a.internal_address as address,a.city,a.disc,a.business_district_id,a.status,
$field = "a.id,a.external_title as title,a.internal_address as address,a.city,a.disc,a.business_district_id,a.status,
a.industry_type,a.shop_area_start,a.shop_area_end,a.shop_type,a.residue_num,a.shop_sign,a.is_carefully_chosen,a.rent_type, a.industry_type,a.shop_area_start,a.shop_area_end,a.shop_type,a.residue_num,a.shop_sign,a.is_carefully_chosen,a.rent_type,
a.rent_price,a.management_fee,a.slotting_fee,a.total,a.market_area,a.is_has_gas,a.file_path,a.longitude,a.latitude, a.rent_price,a.management_fee,a.slotting_fee,a.total,a.market_area,a.is_has_gas,a.file_path,a.longitude,a.latitude,
b.enter_num,b.internal_item_advantage as item_advantage,b.sign_rule,b.do_business_date, b.opening_date,b.traffic, b.enter_num,b.internal_item_advantage as item_advantage,b.sign_rule,b.do_business_date, b.opening_date,b.traffic,
...@@ -382,7 +384,8 @@ class Shop extends Basic ...@@ -382,7 +384,8 @@ class Shop extends Basic
a.is_show,a.is_exclusive_type,a.update_time,a.external_title,a.external_address,b.external_item_advantage,b.agent_start_time,b.agent_end_time"; a.is_show,a.is_exclusive_type,a.update_time,a.external_title,a.external_address,b.external_item_advantage,b.agent_start_time,b.agent_end_time";
$conditions['a.status'] = array("neq", 3); $conditions['a.status'] = array("neq", 3);
} else { } else {
$field = "a.id,a.internal_title,a.internal_address,a.external_title,a.external_address, //$field = "a.id,a.internal_title,a.internal_address,a.external_title,a.external_address,
$field = "a.id,a.external_title as internal_title,a.internal_address,a.external_title,a.external_address,
a.city,a.disc,a.business_district_id,a.status,a.industry_type,a.shop_area_start,a.shop_area_end,a.shop_type, a.city,a.disc,a.business_district_id,a.status,a.industry_type,a.shop_area_start,a.shop_area_end,a.shop_type,
a.residue_num,a.shop_sign,a.is_carefully_chosen,a.rent_type, a.rent_price,a.management_fee,a.slotting_fee, a.residue_num,a.shop_sign,a.is_carefully_chosen,a.rent_type, a.rent_price,a.management_fee,a.slotting_fee,
a.total,a.market_area,a.is_has_gas,a.file_path,a.longitude,a.latitude,a.is_show,a.is_exclusive_type, a.total,a.market_area,a.is_has_gas,a.file_path,a.longitude,a.latitude,a.is_show,a.is_exclusive_type,
......
...@@ -291,7 +291,7 @@ class OrderLogService ...@@ -291,7 +291,7 @@ class OrderLogService
$oBargainModel = new OBargainModel(); $oBargainModel = new OBargainModel();
$orderData = $orderModel->selectOrderByOrderId("f_id,house_title", [ "order_id" => $order_id ]); $orderData = $orderModel->selectOrderByOrderId("a.f_id,a.house_title,b.internal_address", [ "order_id" => $order_id ]);
//dump($orderData); //dump($orderData);
if (count($orderData) <= 0) { if (count($orderData) <= 0) {
return [ "101", "找不到此订单编号" ]; return [ "101", "找不到此订单编号" ];
...@@ -308,6 +308,7 @@ class OrderLogService ...@@ -308,6 +308,7 @@ class OrderLogService
//报备 //报备
$reportData[0]["step_name"] = "report"; $reportData[0]["step_name"] = "report";
$reportData[0]["house_title"] = $orderData[0]["house_title"]; $reportData[0]["house_title"] = $orderData[0]["house_title"];
$reportData[0]["internal_address"] = $orderData[0]["internal_address"];
$result[$sort++] = $reportData[0]; $result[$sort++] = $reportData[0];
//进场 march in //进场 march in
...@@ -376,233 +377,18 @@ class OrderLogService ...@@ -376,233 +377,18 @@ class OrderLogService
/** /**
* @param $order_id * @param $order_id
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function selectListByOrderNoV2($order_id) public function selectListByOrderNoV2($order_id)
{ {
$result = []; //todo 删除
$sort = 0;
//todo 1.验证订单是否存在
$orderModel = new OrderModel();
$oReportModel = new OReportModel();
$oMarchInModel = new OMarchInModel();
$followUpLogModel = new FollowUpLogModel();
$oPayLogModel = new OPayLogModel();
$oRefundModel = new ORefundModel();
$oBargainModel = new OBargainModel();
$oFinancialModel = new OFinancialAudit();
$orderData = $orderModel->selectOrderByOrderId("f_id,house_title", [ "order_id" => $order_id ]);
//dump($orderData);
if (count($orderData) <= 0) {
return [ "101", "找不到此订单编号" ];
}
$report_id = $orderData[0]["f_id"];
$field_report = "a.id,a.report_agent_id,a.report_agent_phone,a.report_agent_name,a.report_store_id,
a.user_id,a.user_phone,a.user_name,a.vehicle,a.intro,a.predict_see_time,a.create_time,b.store_name,c.district_name";
$reportData = $oReportModel->selectReportInfoById($field_report, [ "id" => $report_id ]);
if (count($reportData) == 0) {
return [ "101", "报备记录未找到" ];
}
//报备
$reportData[0]["step_name"] = "report";
$reportData[0]["house_title"] = $orderData[0]["house_title"];
$result[$sort++] = $reportData[0];
//进场 march in
$field_march_in = "id,reception_id,reception_name,report_id,order_no,march_in_remark,march_in_img,march_in_area,create_time";
$marchInData = $oMarchInModel->selectMarchInByOrderNo($field_march_in, [ "order_id" => $order_id ]);
if (count($marchInData) > 0) {
foreach ($marchInData as $k => $v) {
$v["step_name"] = "march_in";
$v["img_path"] = CHAT_IMG_URL;
$result[$sort++] = $v;
}
}
//跟进
$field_follow_up = "id,agent_id,agent_name,user_type,decision_maker,industry_type,area_requirement,price_requirement,province,city,
district,business_area,explain,explain_img,create_time";
$followUpLogData = $followUpLogModel->selectFollowUpListByReportId($field_follow_up, [ "report_id" => $report_id ]);
if (count($followUpLogData) > 0) {
foreach ($followUpLogData as $k => $v) {
$v["step_name"] = "follow_up_log";
$v = $this->convertFollowUp($v);
$v["img_path"] = CHAT_IMG_URL;
$result[$sort++] = $v;
}
}
//收款
$field_pay_log = "id,order_no,father_id,order_id,agent_id,agent_name,type,pay_type,money,house_number,industry_type,
remark,transfer_img,real_money,source,create_time";
$payLogData = $oPayLogModel->selectPayLogByOrderNo($field_pay_log, [ "order_id" => $order_id ]);
if (count($payLogData) > 0) {
$sortPayLogData = $this->arr2tree($payLogData);
foreach ($sortPayLogData as $k => $v) {
$v["step_name"] = "pay_log";
$v["img_path"] = CHAT_IMG_URL;
$result[$sort++] = $v;
}
}
//退款
$field_refund = "id,report_id,agent_id,agent_name,order_no,order_id,refund_money,status,name,bank,card_no,
remark,remark_img,create_time";
$refundData = $oRefundModel->selectRefundByOrderNo($field_refund, [ "order_id" => $order_id ]);
if (count($refundData) > 0) {
foreach ($refundData as $k => $v) {
$v["step_name"] = "refund";
$v["img_path"] = CHAT_IMG_URL;
$result[$sort++] = $v;
}
}
//成交报告
$field_bargain = "a.id,a.house_number,a.is_open,a.report_id,a.order_id,a.trade_type,a.submit_agent_id,a.industry_type,
a.estimated_receipt_date,a.submit_agent_name, a.price,a.commission,a.role,a.agent_id,a.scale,a.scale_fee,a.create_time,b.name,b.phone";
$bargainData = $oBargainModel->selectBargainListByOrderNo($field_bargain, [ "order_id" => $order_id ]);
if (count($bargainData) > 0) {
foreach ($bargainData as $k => $v) {
$v["step_name"] = "bargain";
$result[$sort++] = $v;
}
}
//审核流程
$field_financial = "id,bargain_id,agent_id,source,status,remark,audit_level,audit_id,audit_name,create_time,update_time";
$oFinancialData = $oFinancialModel->selectFinancialByOrderNo($field_financial, [ "order_id" => $order_id ]);
if (count($oFinancialData) > 0) {
foreach ($oFinancialData as $k => $v) {
$v["step_name"] = "financial";
$result[$sort++] = $v;
}
}
return $this->sortByTime($result);
} }
/** /**
* @param $order_id * @param $order_id
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/ */
public function selectListByOrderNo($order_id) public function selectListByOrderNo($order_id)
{ {
$result = []; //todo shanchu
$sort = 0;
//todo 1.验证订单是否存在
$orderModel = new OrderModel();
$oReportModel = new OReportModel();
$oMarchInModel = new OMarchInModel();
$followUpLogModel = new FollowUpLogModel();
$oPayLogModel = new OPayLogModel();
$oRefundModel = new ORefundModel();
$oBargainModel = new OBargainModel();
$oFinancialModel = new OFinancialAudit();
$orderData = $orderModel->selectOrderByOrderId("f_id,house_title", [ "order_id" => $order_id ]);
//dump($orderData);
if (count($orderData) <= 0) {
return [ "101", "找不到此订单编号" ];
}
$report_id = $orderData[0]["f_id"];
$field_report = "a.id,a.report_agent_id,a.report_agent_phone,a.report_agent_name,a.report_store_id,
a.user_id,a.user_phone,a.user_name,a.vehicle,a.intro,a.predict_see_time,a.create_time,b.store_name,c.district_name";
$reportData = $oReportModel->selectReportInfoById($field_report, [ "id" => $report_id ]);
if (count($reportData) == 0) {
return [ "101", "报备记录未找到" ];
}
//报备
$reportData[0]["step_name"] = "report";
$reportData[0]["house_title"] = $orderData[0]["house_title"];
$result[$sort++] = $reportData[0];
//进场 march in
$field_march_in = "id,reception_id,reception_name,report_id,order_no,march_in_remark,march_in_img,march_in_area,create_time";
$marchInData = $oMarchInModel->selectMarchInByOrderNo($field_march_in, [ "order_id" => $order_id ]);
if (count($marchInData) > 0) {
foreach ($marchInData as $k => $v) {
$v["step_name"] = "march_in";
$v["img_path"] = CHAT_IMG_URL;
$result[$sort++] = $v;
}
}
//跟进
$field_follow_up = "id,agent_id,agent_name,user_type,decision_maker,industry_type,area_requirement,price_requirement,province,city,
district,business_area,explain,explain_img,create_time";
$followUpLogData = $followUpLogModel->selectFollowUpListByReportId($field_follow_up, [ "report_id" => $report_id ]);
if (count($followUpLogData) > 0) {
foreach ($followUpLogData as $k => $v) {
$v["step_name"] = "follow_up_log";
$v = $this->convertFollowUp($v);
$v["img_path"] = CHAT_IMG_URL;
$result[$sort++] = $v;
}
}
//收款
$field_pay_log = "id,order_no,father_id,order_id,agent_id,agent_name,type,pay_type,money,house_number,industry_type,
remark,transfer_img,real_money,source,create_time";
$payLogData = $oPayLogModel->selectPayLogByOrderNo($field_pay_log, [ "order_id" => $order_id ]);
if (count($payLogData) > 0) {
$sortPayLogData = $this->arr2tree($payLogData);
foreach ($sortPayLogData as $k => $v) {
$v["step_name"] = "pay_log";
$v["img_path"] = CHAT_IMG_URL;
$result[$sort++] = $v;
}
}
//退款
$field_refund = "id,report_id,agent_id,agent_name,order_no,order_id,refund_money,status,name,bank,card_no,
remark,remark_img,create_time";
$refundData = $oRefundModel->selectRefundByOrderNo($field_refund, [ "order_id" => $order_id ]);
if (count($refundData) > 0) {
foreach ($refundData as $k => $v) {
$v["step_name"] = "refund";
$v["img_path"] = CHAT_IMG_URL;
$result[$sort++] = $v;
}
}
//成交报告
$field_bargain = "a.id,a.father_id,a.house_number,a.is_open,a.report_id,a.order_id,a.trade_type,a.submit_agent_id,a.industry_type,
a.estimated_receipt_date,a.submit_agent_name, a.price,a.commission,a.role,a.agent_id,a.scale,a.scale_fee,a.create_time,b.name,b.phone,a.is_commission";
$bargainData = $oBargainModel->selectBargainListByOrderNo($field_bargain, [ "order_id" => $order_id ]);
if (count($bargainData) > 0) {
$bargain_data_arr = $this->arr2TreeBargain($bargainData);
foreach ($bargain_data_arr as $k2 => $v2) {
$v2["step_name"] = "bargain";
$result[$sort++] = $v2;
}
}
//审核流程
$field_financial = "id,bargain_id,agent_id,source,status,remark,audit_level,audit_id,audit_name,create_time,update_time";
$oFinancialData = $oFinancialModel->selectFinancialByOrderNo($field_financial, [ "order_id" => $order_id ]);
if (count($oFinancialData) > 0) {
foreach ($oFinancialData as $k => $v) {
$v["step_name"] = "financial";
$result[$sort++] = $v;
}
}
return $this->sortByTime($result);
} }
public function arr2tree($list) public function arr2tree($list)
......
...@@ -37,20 +37,30 @@ class OrderModel extends Model ...@@ -37,20 +37,30 @@ class OrderModel extends Model
} }
/**
* @param $filed
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function selectOrderByOrderId($filed, $params) public function selectOrderByOrderId($filed, $params)
{ {
$where_ = []; $where_ = [];
if (isset($params["order_id"])) { if (isset($params["order_id"])) {
$where_["id"] = $params["order_id"]; $where_["a.id"] = $params["order_id"];
} }
if (isset($params["f_id"])) { if (isset($params["f_id"])) {
$where_["f_id"] = $params["f_id"]; $where_["a.f_id"] = $params["f_id"];
} }
if (isset($params["house_id"])) { if (isset($params["house_id"])) {
$where_["house_id"] = $params["house_id"]; $where_["a.house_id"] = $params["house_id"];
} }
$result = $this->db_ $result = $this->db_
->field($filed) ->field($filed)
->alias("a")
->join("g_houses b", "a.house_id = b.id", "left")
->where($where_) ->where($where_)
->select(); ->select();
//echo $this->db_->getLastSql(); //echo $this->db_->getLastSql();
......
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